Skip to content

Commit 009f0a6

Browse files
committed
Merge tag 'drm-xe-next-fixes-2024-01-16' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-next
Driver Changes: - Fix for definition of wakeref_t - Fix for an error code aliasing - Fix for VM_UNBIND_ALL in the case there are no bound VMAs - Fixes for a number of __iomem address space mismatches reported by sparse - Fixes for the assignment of exec_queue priority - A Fix for skip_guc_pc not taking effect - Workaround for a build problem on GCC 11 - A couple of fixes for error paths - Fix a Flat CCS compression metadata copy issue - Fix a misplace array bounds checking - Don't have display support depend on EXPERT (as discussed on IRC) Signed-off-by: Dave Airlie <airlied@redhat.com> From: =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240116102204.106520-1-thomas.hellstrom@linux.intel.com
2 parents cacea81 + bf3ff14 commit 009f0a6

18 files changed

+136
-91
lines changed

drivers/gpu/drm/xe/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ config DRM_XE
4747

4848
config DRM_XE_DISPLAY
4949
bool "Enable display support"
50-
depends on DRM_XE && EXPERT && DRM_XE=m
50+
depends on DRM_XE && DRM_XE=m
5151
select FB_IOMEM_HELPERS
5252
select I2C
5353
select I2C_ALGOBIT

drivers/gpu/drm/xe/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ subdir-ccflags-y += $(call cc-option, -Wunused-const-variable)
1717
subdir-ccflags-y += $(call cc-option, -Wpacked-not-aligned)
1818
subdir-ccflags-y += $(call cc-option, -Wformat-overflow)
1919
subdir-ccflags-y += $(call cc-option, -Wformat-truncation)
20-
subdir-ccflags-y += $(call cc-option, -Wstringop-overflow)
2120
subdir-ccflags-y += $(call cc-option, -Wstringop-truncation)
2221
# The following turn off the warnings enabled by -Wextra
2322
ifeq ($(findstring 2, $(KBUILD_EXTRA_WARN)),)

drivers/gpu/drm/xe/compat-i915-headers/intel_wakeref.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55

66
#include <linux/types.h>
77

8-
typedef bool intel_wakeref_t;
8+
typedef unsigned long intel_wakeref_t;

drivers/gpu/drm/xe/tests/xe_bo.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,13 @@ static void ccs_test_run_tile(struct xe_device *xe, struct xe_tile *tile,
125125

126126
bo = xe_bo_create_user(xe, NULL, NULL, SZ_1M, DRM_XE_GEM_CPU_CACHING_WC,
127127
ttm_bo_type_device, bo_flags);
128-
129-
xe_bo_lock(bo, false);
130-
131128
if (IS_ERR(bo)) {
132129
KUNIT_FAIL(test, "Failed to create bo.\n");
133130
return;
134131
}
135132

133+
xe_bo_lock(bo, false);
134+
136135
kunit_info(test, "Verifying that CCS data is cleared on creation.\n");
137136
ret = ccs_test_migrate(tile, bo, false, 0ULL, 0xdeadbeefdeadbeefULL,
138137
test);

drivers/gpu/drm/xe/tests/xe_migrate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ static void xe_migrate_sanity_test(struct xe_migrate *m, struct kunit *test)
331331
xe_res_first_sg(xe_bo_sg(pt), 0, pt->size, &src_it);
332332

333333
emit_pte(m, bb, NUM_KERNEL_PDE - 1, xe_bo_is_vram(pt), false,
334-
&src_it, XE_PAGE_SIZE, pt);
334+
&src_it, XE_PAGE_SIZE, pt->ttm.resource);
335335

336336
run_sanity_job(m, xe, bb, bb->len, "Writing PTE for our fake PT", test);
337337

drivers/gpu/drm/xe/xe_bo.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ static struct xe_mem_region *res_to_mem_region(struct ttm_resource *res)
125125
static void try_add_system(struct xe_device *xe, struct xe_bo *bo,
126126
u32 bo_flags, u32 *c)
127127
{
128-
xe_assert(xe, *c < ARRAY_SIZE(bo->placements));
129-
130128
if (bo_flags & XE_BO_CREATE_SYSTEM_BIT) {
129+
xe_assert(xe, *c < ARRAY_SIZE(bo->placements));
130+
131131
bo->placements[*c] = (struct ttm_place) {
132132
.mem_type = XE_PL_TT,
133133
};
@@ -145,6 +145,8 @@ static void add_vram(struct xe_device *xe, struct xe_bo *bo,
145145
struct xe_mem_region *vram;
146146
u64 io_size;
147147

148+
xe_assert(xe, *c < ARRAY_SIZE(bo->placements));
149+
148150
vram = to_xe_ttm_vram_mgr(ttm_manager_type(&xe->ttm, mem_type))->vram;
149151
xe_assert(xe, vram && vram->usable_size);
150152
io_size = vram->io_size;
@@ -175,8 +177,6 @@ static void add_vram(struct xe_device *xe, struct xe_bo *bo,
175177
static void try_add_vram(struct xe_device *xe, struct xe_bo *bo,
176178
u32 bo_flags, u32 *c)
177179
{
178-
xe_assert(xe, *c < ARRAY_SIZE(bo->placements));
179-
180180
if (bo->props.preferred_gt == XE_GT1) {
181181
if (bo_flags & XE_BO_CREATE_VRAM1_BIT)
182182
add_vram(xe, bo, bo->placements, bo_flags, XE_PL_VRAM1, c);
@@ -193,9 +193,9 @@ static void try_add_vram(struct xe_device *xe, struct xe_bo *bo,
193193
static void try_add_stolen(struct xe_device *xe, struct xe_bo *bo,
194194
u32 bo_flags, u32 *c)
195195
{
196-
xe_assert(xe, *c < ARRAY_SIZE(bo->placements));
197-
198196
if (bo_flags & XE_BO_CREATE_STOLEN_BIT) {
197+
xe_assert(xe, *c < ARRAY_SIZE(bo->placements));
198+
199199
bo->placements[*c] = (struct ttm_place) {
200200
.mem_type = XE_PL_STOLEN,
201201
.flags = bo_flags & (XE_BO_CREATE_PINNED_BIT |
@@ -442,7 +442,7 @@ static int xe_ttm_io_mem_reserve(struct ttm_device *bdev,
442442

443443
if (vram->mapping &&
444444
mem->placement & TTM_PL_FLAG_CONTIGUOUS)
445-
mem->bus.addr = (u8 *)vram->mapping +
445+
mem->bus.addr = (u8 __force *)vram->mapping +
446446
mem->bus.offset;
447447

448448
mem->bus.offset += vram->io_start;
@@ -734,7 +734,7 @@ static int xe_bo_move(struct ttm_buffer_object *ttm_bo, bool evict,
734734
/* Create a new VMAP once kernel BO back in VRAM */
735735
if (!ret && resource_is_vram(new_mem)) {
736736
struct xe_mem_region *vram = res_to_mem_region(new_mem);
737-
void *new_addr = vram->mapping +
737+
void __iomem *new_addr = vram->mapping +
738738
(new_mem->start << PAGE_SHIFT);
739739

740740
if (XE_WARN_ON(new_mem->start == XE_BO_INVALID_OFFSET)) {

drivers/gpu/drm/xe/xe_device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ int xe_device_probe(struct xe_device *xe)
484484

485485
err = xe_device_set_has_flat_ccs(xe);
486486
if (err)
487-
return err;
487+
goto err_irq_shutdown;
488488

489489
err = xe_mmio_probe_vram(xe);
490490
if (err)

drivers/gpu/drm/xe/xe_device_types.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ struct xe_mem_region {
9797
*/
9898
resource_size_t actual_physical_size;
9999
/** @mapping: pointer to VRAM mappable space */
100-
void *__iomem mapping;
100+
void __iomem *mapping;
101101
};
102102

103103
/**
@@ -146,7 +146,7 @@ struct xe_tile {
146146
size_t size;
147147

148148
/** @regs: pointer to tile's MMIO space (starting with registers) */
149-
void *regs;
149+
void __iomem *regs;
150150
} mmio;
151151

152152
/**
@@ -159,7 +159,7 @@ struct xe_tile {
159159
size_t size;
160160

161161
/** @regs: pointer to tile's additional MMIO-extension space */
162-
void *regs;
162+
void __iomem *regs;
163163
} mmio_ext;
164164

165165
/** @mem: memory management info for tile */
@@ -301,7 +301,7 @@ struct xe_device {
301301
/** @size: size of MMIO space for device */
302302
size_t size;
303303
/** @regs: pointer to MMIO space for device */
304-
void *regs;
304+
void __iomem *regs;
305305
} mmio;
306306

307307
/** @mem: memory info for device */

drivers/gpu/drm/xe/xe_exec.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ int xe_exec_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
115115
struct xe_sched_job *job;
116116
struct dma_fence *rebind_fence;
117117
struct xe_vm *vm;
118-
bool write_locked;
118+
bool write_locked, skip_retry = false;
119119
ktime_t end = 0;
120120
int err = 0;
121121

@@ -227,7 +227,8 @@ int xe_exec_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
227227
}
228228

229229
if (xe_exec_queue_is_lr(q) && xe_exec_queue_ring_full(q)) {
230-
err = -EWOULDBLOCK;
230+
err = -EWOULDBLOCK; /* Aliased to -EAGAIN */
231+
skip_retry = true;
231232
goto err_exec;
232233
}
233234

@@ -337,7 +338,7 @@ int xe_exec_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
337338
up_write(&vm->lock);
338339
else
339340
up_read(&vm->lock);
340-
if (err == -EAGAIN)
341+
if (err == -EAGAIN && !skip_retry)
341342
goto retry;
342343
err_syncs:
343344
for (i = 0; i < num_syncs; i++)

drivers/gpu/drm/xe/xe_exec_queue.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ static struct xe_exec_queue *__xe_exec_queue_create(struct xe_device *xe,
6767
q->sched_props.timeslice_us = hwe->eclass->sched_props.timeslice_us;
6868
q->sched_props.preempt_timeout_us =
6969
hwe->eclass->sched_props.preempt_timeout_us;
70+
if (q->flags & EXEC_QUEUE_FLAG_KERNEL &&
71+
q->flags & EXEC_QUEUE_FLAG_HIGH_PRIORITY)
72+
q->sched_props.priority = XE_EXEC_QUEUE_PRIORITY_KERNEL;
73+
else
74+
q->sched_props.priority = XE_EXEC_QUEUE_PRIORITY_NORMAL;
7075

7176
if (xe_exec_queue_is_parallel(q)) {
7277
q->parallel.composite_fence_ctx = dma_fence_context_alloc(1);

0 commit comments

Comments
 (0)