Commit f0997a06 authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'drm-xe-fixes-2026-04-30' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-fixes



API Fixes:
 - Add missing pad and extensions check (Jonathan)
 - Reject unsafe PAT indices for CPU cached memory (Jia)

 Driver Fixes:
 - Drop registration of guc_submit_wedged_fini from xe_guc_submit_wedge (Brost)
 - Xe3p tuning and workaround fixes (Roper, Gustavo)
 - USE drm mm instead of drm SA for CCS read/write (Satya)
 - Fix leaks and null derefs (Shuicheng)
 - Fix Wa_18022495364 (Tvrtko)

Signed-off-by: default avatarDave Airlie <airlied@redhat.com>

From: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patch.msgid.link/afO05KvmFMn_7qcY@intel.com
parents b006ef5f 662f9ddc
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -88,6 +88,7 @@ xe-y += xe_bb.o \
	xe_irq.o \
	xe_late_bind_fw.o \
	xe_lrc.o \
	xe_mem_pool.o \
	xe_migrate.o \
	xe_mmio.o \
	xe_mmio_gem.o \
+1 −1
Original line number Diff line number Diff line
@@ -583,7 +583,7 @@
#define   DISABLE_128B_EVICTION_COMMAND_UDW	REG_BIT(36 - 32)
#define   LSCFE_SAME_ADDRESS_ATOMICS_COALESCING_DISABLE	REG_BIT(35 - 32)

#define ROW_CHICKEN5				XE_REG_MCR(0xe7f0)
#define ROW_CHICKEN5				XE_REG_MCR(0xe7f0, XE_REG_OPTION_MASKED)
#define   CPSS_AWARE_DIS			REG_BIT(3)

#define SARB_CHICKEN1				XE_REG_MCR(0xe90c)
+6 −2
Original line number Diff line number Diff line
@@ -2322,8 +2322,10 @@ struct xe_bo *xe_bo_init_locked(struct xe_device *xe, struct xe_bo *bo,
	}

	/* XE_BO_FLAG_GGTTx requires XE_BO_FLAG_GGTT also be set */
	if ((flags & XE_BO_FLAG_GGTT_ALL) && !(flags & XE_BO_FLAG_GGTT))
	if ((flags & XE_BO_FLAG_GGTT_ALL) && !(flags & XE_BO_FLAG_GGTT)) {
		xe_bo_free(bo);
		return ERR_PTR(-EINVAL);
	}

	if (flags & (XE_BO_FLAG_VRAM_MASK | XE_BO_FLAG_STOLEN) &&
	    !(flags & XE_BO_FLAG_IGNORE_MIN_PAGE_SIZE) &&
@@ -2342,8 +2344,10 @@ struct xe_bo *xe_bo_init_locked(struct xe_device *xe, struct xe_bo *bo,
		alignment = SZ_4K >> PAGE_SHIFT;
	}

	if (type == ttm_bo_type_device && aligned_size != size)
	if (type == ttm_bo_type_device && aligned_size != size) {
		xe_bo_free(bo);
		return ERR_PTR(-EINVAL);
	}

	if (!bo) {
		bo = xe_bo_alloc();
+2 −1
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
#include "xe_ggtt_types.h"

struct xe_device;
struct xe_mem_pool_node;
struct xe_vm;

#define XE_BO_MAX_PLACEMENTS	3
@@ -88,7 +89,7 @@ struct xe_bo {
	bool ccs_cleared;

	/** @bb_ccs: BB instructions of CCS read/write. Valid only for VF */
	struct xe_bb *bb_ccs[XE_SRIOV_VF_CCS_CTX_COUNT];
	struct xe_mem_pool_node *bb_ccs[XE_SRIOV_VF_CCS_CTX_COUNT];

	/**
	 * @cpu_caching: CPU caching mode. Currently only used for userspace
+18 −5
Original line number Diff line number Diff line
@@ -258,6 +258,13 @@ struct dma_buf *xe_gem_prime_export(struct drm_gem_object *obj, int flags)
	return ERR_PTR(ret);
}

/*
 * Takes ownership of @storage: on success it is transferred to the returned
 * drm_gem_object; on failure it is freed before returning the error.
 * This matches the contract of xe_bo_init_locked() which frees @storage on
 * its error paths, so callers need not (and must not) free @storage after
 * this call.
 */
static struct drm_gem_object *
xe_dma_buf_init_obj(struct drm_device *dev, struct xe_bo *storage,
		    struct dma_buf *dma_buf)
@@ -271,8 +278,10 @@ xe_dma_buf_init_obj(struct drm_device *dev, struct xe_bo *storage,
	int ret = 0;

	dummy_obj = drm_gpuvm_resv_object_alloc(&xe->drm);
	if (!dummy_obj)
	if (!dummy_obj) {
		xe_bo_free(storage);
		return ERR_PTR(-ENOMEM);
	}

	dummy_obj->resv = resv;
	xe_validation_guard(&ctx, &xe->val, &exec, (struct xe_val_flags) {}, ret) {
@@ -281,6 +290,7 @@ xe_dma_buf_init_obj(struct drm_device *dev, struct xe_bo *storage,
		if (ret)
			break;

		/* xe_bo_init_locked() frees storage on error */
		bo = xe_bo_init_locked(xe, storage, NULL, resv, NULL, dma_buf->size,
				       0, /* Will require 1way or 2way for vm_bind */
				       ttm_bo_type_sg, XE_BO_FLAG_SYSTEM, &exec);
@@ -368,12 +378,15 @@ struct drm_gem_object *xe_gem_prime_import(struct drm_device *dev,
		goto out_err;
	}

	/* Errors here will take care of freeing the bo. */
	/*
	 * xe_dma_buf_init_obj() takes ownership of bo on both success
	 * and failure, so we must not touch bo after this call.
	 */
	obj = xe_dma_buf_init_obj(dev, bo, dma_buf);
	if (IS_ERR(obj))
	if (IS_ERR(obj)) {
		dma_buf_detach(dma_buf, attach);
		return obj;


	}
	get_dma_buf(dma_buf);
	obj->import_attach = attach;
	return obj;
Loading