Skip to content

Commit 3ff6edb

Browse files
sgruszkajlawryno
authored andcommitted
accel/ivpu: Do not use SSID 1
The SSID=1 is used by the firmware as default value in case SSID mapping is not initialized. This allows detecting use of miss-configured memory contexts. The future FW versions may not allow using SSID=1. SSID=65 is valid value, number of contexts are limited by number of available command queues, but SSID can be any u16 value. Fixes: 35b1376 ("accel/ivpu: Introduce a new DRM driver for Intel VPU") Co-developed-by: Andrzej Kacprowski <[email protected]> Signed-off-by: Andrzej Kacprowski <[email protected]> Signed-off-by: Stanislaw Gruszka <[email protected]> Reviewed-by: Jeffrey Hugo <[email protected]> Signed-off-by: Jacek Lawrynowicz <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 6013aa8 commit 3ff6edb

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

drivers/accel/ivpu/ivpu_drv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,8 +474,8 @@ static int ivpu_dev_init(struct ivpu_device *vdev)
474474

475475
vdev->hw->ops = &ivpu_hw_mtl_ops;
476476
vdev->platform = IVPU_PLATFORM_INVALID;
477-
vdev->context_xa_limit.min = IVPU_GLOBAL_CONTEXT_MMU_SSID + 1;
478-
vdev->context_xa_limit.max = IVPU_CONTEXT_LIMIT;
477+
vdev->context_xa_limit.min = IVPU_USER_CONTEXT_MIN_SSID;
478+
vdev->context_xa_limit.max = IVPU_USER_CONTEXT_MAX_SSID;
479479
atomic64_set(&vdev->unique_id_counter, 0);
480480
xa_init_flags(&vdev->context_xa, XA_FLAGS_ALLOC);
481481
xa_init_flags(&vdev->submitted_jobs_xa, XA_FLAGS_ALLOC1);

drivers/accel/ivpu/ivpu_drv.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@
2525
#define PCI_DEVICE_ID_MTL 0x7d1d
2626

2727
#define IVPU_GLOBAL_CONTEXT_MMU_SSID 0
28-
#define IVPU_CONTEXT_LIMIT 64
28+
/* SSID 1 is used by the VPU to represent invalid context */
29+
#define IVPU_USER_CONTEXT_MIN_SSID 2
30+
#define IVPU_USER_CONTEXT_MAX_SSID (IVPU_USER_CONTEXT_MIN_SSID + 63)
31+
2932
#define IVPU_NUM_ENGINES 2
3033

3134
#define IVPU_PLATFORM_SILICON 0

0 commit comments

Comments
 (0)