Skip to content

Commit 3c4c39c

Browse files
committed
Merge tag 'drm-misc-fixes-2025-05-28' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixes
Short summary of fixes pull: drm-scheduler: - signal scheduled fence when killing job dummycon: - trigger deferred takeover when switching consoles ivpu: - improve logging - update firmware filenames - reorder steps in command-queue unregistering Signed-off-by: Simona Vetter <[email protected]> From: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 0ff41df + 4557cc8 commit 3c4c39c

File tree

6 files changed

+42
-23
lines changed

6 files changed

+42
-23
lines changed

drivers/accel/ivpu/ivpu_fw.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,18 @@ static struct {
5555
int gen;
5656
const char *name;
5757
} fw_names[] = {
58-
{ IVPU_HW_IP_37XX, "vpu_37xx.bin" },
58+
{ IVPU_HW_IP_37XX, "intel/vpu/vpu_37xx_v1.bin" },
5959
{ IVPU_HW_IP_37XX, "intel/vpu/vpu_37xx_v0.0.bin" },
60-
{ IVPU_HW_IP_40XX, "vpu_40xx.bin" },
60+
{ IVPU_HW_IP_40XX, "intel/vpu/vpu_40xx_v1.bin" },
6161
{ IVPU_HW_IP_40XX, "intel/vpu/vpu_40xx_v0.0.bin" },
62-
{ IVPU_HW_IP_50XX, "vpu_50xx.bin" },
62+
{ IVPU_HW_IP_50XX, "intel/vpu/vpu_50xx_v1.bin" },
6363
{ IVPU_HW_IP_50XX, "intel/vpu/vpu_50xx_v0.0.bin" },
6464
};
6565

6666
/* Production fw_names from the table above */
67-
MODULE_FIRMWARE("intel/vpu/vpu_37xx_v0.0.bin");
68-
MODULE_FIRMWARE("intel/vpu/vpu_40xx_v0.0.bin");
69-
MODULE_FIRMWARE("intel/vpu/vpu_50xx_v0.0.bin");
67+
MODULE_FIRMWARE("intel/vpu/vpu_37xx_v1.bin");
68+
MODULE_FIRMWARE("intel/vpu/vpu_40xx_v1.bin");
69+
MODULE_FIRMWARE("intel/vpu/vpu_50xx_v1.bin");
7070

7171
static int ivpu_fw_request(struct ivpu_device *vdev)
7272
{

drivers/accel/ivpu/ivpu_gem.c

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static inline void ivpu_dbg_bo(struct ivpu_device *vdev, struct ivpu_bo *bo, con
2828
{
2929
ivpu_dbg(vdev, BO,
3030
"%6s: bo %8p vpu_addr %9llx size %8zu ctx %d has_pages %d dma_mapped %d mmu_mapped %d wc %d imported %d\n",
31-
action, bo, bo->vpu_addr, ivpu_bo_size(bo), bo->ctx ? bo->ctx->id : 0,
31+
action, bo, bo->vpu_addr, ivpu_bo_size(bo), bo->ctx_id,
3232
(bool)bo->base.pages, (bool)bo->base.sgt, bo->mmu_mapped, bo->base.map_wc,
3333
(bool)bo->base.base.import_attach);
3434
}
@@ -94,8 +94,6 @@ ivpu_bo_alloc_vpu_addr(struct ivpu_bo *bo, struct ivpu_mmu_context *ctx,
9494
ivpu_err(vdev, "Failed to add BO to context %u: %d\n", ctx->id, ret);
9595
}
9696

97-
ivpu_dbg_bo(vdev, bo, "alloc");
98-
9997
mutex_unlock(&bo->lock);
10098

10199
drm_dev_exit(idx);
@@ -215,7 +213,7 @@ struct drm_gem_object *ivpu_gem_prime_import(struct drm_device *dev,
215213
return ERR_PTR(ret);
216214
}
217215

218-
static struct ivpu_bo *ivpu_bo_alloc(struct ivpu_device *vdev, u64 size, u32 flags)
216+
static struct ivpu_bo *ivpu_bo_alloc(struct ivpu_device *vdev, u64 size, u32 flags, u32 ctx_id)
219217
{
220218
struct drm_gem_shmem_object *shmem;
221219
struct ivpu_bo *bo;
@@ -233,13 +231,16 @@ static struct ivpu_bo *ivpu_bo_alloc(struct ivpu_device *vdev, u64 size, u32 fla
233231
return ERR_CAST(shmem);
234232

235233
bo = to_ivpu_bo(&shmem->base);
234+
bo->ctx_id = ctx_id;
236235
bo->base.map_wc = flags & DRM_IVPU_BO_WC;
237236
bo->flags = flags;
238237

239238
mutex_lock(&vdev->bo_list_lock);
240239
list_add_tail(&bo->bo_list_node, &vdev->bo_list);
241240
mutex_unlock(&vdev->bo_list_lock);
242241

242+
ivpu_dbg_bo(vdev, bo, "alloc");
243+
243244
return bo;
244245
}
245246

@@ -278,8 +279,13 @@ static void ivpu_gem_bo_free(struct drm_gem_object *obj)
278279
mutex_unlock(&vdev->bo_list_lock);
279280

280281
drm_WARN_ON(&vdev->drm, !dma_resv_test_signaled(obj->resv, DMA_RESV_USAGE_READ));
282+
drm_WARN_ON(&vdev->drm, ivpu_bo_size(bo) == 0);
283+
drm_WARN_ON(&vdev->drm, bo->base.vaddr);
281284

282285
ivpu_bo_unbind_locked(bo);
286+
drm_WARN_ON(&vdev->drm, bo->mmu_mapped);
287+
drm_WARN_ON(&vdev->drm, bo->ctx);
288+
283289
mutex_destroy(&bo->lock);
284290

285291
drm_WARN_ON(obj->dev, bo->base.pages_use_count > 1);
@@ -314,15 +320,18 @@ int ivpu_bo_create_ioctl(struct drm_device *dev, void *data, struct drm_file *fi
314320
if (size == 0)
315321
return -EINVAL;
316322

317-
bo = ivpu_bo_alloc(vdev, size, args->flags);
323+
bo = ivpu_bo_alloc(vdev, size, args->flags, file_priv->ctx.id);
318324
if (IS_ERR(bo)) {
319325
ivpu_err(vdev, "Failed to allocate BO: %pe (ctx %u size %llu flags 0x%x)",
320326
bo, file_priv->ctx.id, args->size, args->flags);
321327
return PTR_ERR(bo);
322328
}
323329

324330
ret = drm_gem_handle_create(file, &bo->base.base, &args->handle);
325-
if (!ret)
331+
if (ret)
332+
ivpu_err(vdev, "Failed to create handle for BO: %pe (ctx %u size %llu flags 0x%x)",
333+
bo, file_priv->ctx.id, args->size, args->flags);
334+
else
326335
args->vpu_addr = bo->vpu_addr;
327336

328337
drm_gem_object_put(&bo->base.base);
@@ -345,7 +354,7 @@ ivpu_bo_create(struct ivpu_device *vdev, struct ivpu_mmu_context *ctx,
345354
drm_WARN_ON(&vdev->drm, !PAGE_ALIGNED(range->end));
346355
drm_WARN_ON(&vdev->drm, !PAGE_ALIGNED(size));
347356

348-
bo = ivpu_bo_alloc(vdev, size, flags);
357+
bo = ivpu_bo_alloc(vdev, size, flags, IVPU_GLOBAL_CONTEXT_MMU_SSID);
349358
if (IS_ERR(bo)) {
350359
ivpu_err(vdev, "Failed to allocate BO: %pe (vpu_addr 0x%llx size %llu flags 0x%x)",
351360
bo, range->start, size, flags);
@@ -452,7 +461,7 @@ static void ivpu_bo_print_info(struct ivpu_bo *bo, struct drm_printer *p)
452461
mutex_lock(&bo->lock);
453462

454463
drm_printf(p, "%-9p %-3u 0x%-12llx %-10lu 0x%-8x %-4u",
455-
bo, bo->ctx ? bo->ctx->id : 0, bo->vpu_addr, bo->base.base.size,
464+
bo, bo->ctx_id, bo->vpu_addr, bo->base.base.size,
456465
bo->flags, kref_read(&bo->base.base.refcount));
457466

458467
if (bo->base.pages)

drivers/accel/ivpu/ivpu_gem.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ struct ivpu_bo {
2121
u64 vpu_addr;
2222
u32 flags;
2323
u32 job_status; /* Valid only for command buffer */
24+
u32 ctx_id;
2425
bool mmu_mapped;
2526
};
2627

drivers/accel/ivpu/ivpu_job.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,17 +247,17 @@ static int ivpu_cmdq_unregister(struct ivpu_file_priv *file_priv, struct ivpu_cm
247247
if (!cmdq->db_id)
248248
return 0;
249249

250+
ret = ivpu_jsm_unregister_db(vdev, cmdq->db_id);
251+
if (!ret)
252+
ivpu_dbg(vdev, JOB, "DB %d unregistered\n", cmdq->db_id);
253+
250254
if (vdev->fw->sched_mode == VPU_SCHEDULING_MODE_HW) {
251255
ret = ivpu_jsm_hws_destroy_cmdq(vdev, file_priv->ctx.id, cmdq->id);
252256
if (!ret)
253257
ivpu_dbg(vdev, JOB, "Command queue %d destroyed, ctx %d\n",
254258
cmdq->id, file_priv->ctx.id);
255259
}
256260

257-
ret = ivpu_jsm_unregister_db(vdev, cmdq->db_id);
258-
if (!ret)
259-
ivpu_dbg(vdev, JOB, "DB %d unregistered\n", cmdq->db_id);
260-
261261
xa_erase(&file_priv->vdev->db_xa, cmdq->db_id);
262262
cmdq->db_id = 0;
263263

drivers/gpu/drm/scheduler/sched_entity.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ static void drm_sched_entity_kill_jobs_work(struct work_struct *wrk)
176176
{
177177
struct drm_sched_job *job = container_of(wrk, typeof(*job), work);
178178

179+
drm_sched_fence_scheduled(job->s_fence, NULL);
179180
drm_sched_fence_finished(job->s_fence, -ESRCH);
180181
WARN_ON(job->s_fence->parent);
181182
job->sched->ops->free_job(job);

drivers/video/console/dummycon.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,15 @@ static bool dummycon_blank(struct vc_data *vc, enum vesa_blank_mode blank,
8585
/* Redraw, so that we get putc(s) for output done while blanked */
8686
return true;
8787
}
88+
89+
static bool dummycon_switch(struct vc_data *vc)
90+
{
91+
/*
92+
* Redraw, so that we get putc(s) for output done while switched
93+
* away. Informs deferred consoles to take over the display.
94+
*/
95+
return true;
96+
}
8897
#else
8998
static void dummycon_putc(struct vc_data *vc, u16 c, unsigned int y,
9099
unsigned int x) { }
@@ -95,6 +104,10 @@ static bool dummycon_blank(struct vc_data *vc, enum vesa_blank_mode blank,
95104
{
96105
return false;
97106
}
107+
static bool dummycon_switch(struct vc_data *vc)
108+
{
109+
return false;
110+
}
98111
#endif
99112

100113
static const char *dummycon_startup(void)
@@ -124,11 +137,6 @@ static bool dummycon_scroll(struct vc_data *vc, unsigned int top,
124137
return false;
125138
}
126139

127-
static bool dummycon_switch(struct vc_data *vc)
128-
{
129-
return false;
130-
}
131-
132140
/*
133141
* The console `switch' structure for the dummy console
134142
*

0 commit comments

Comments
 (0)