Skip to content

Commit f8caa80

Browse files
committed
drm/xe/pxp: Add PXP queue tracking and session start
We expect every queue that uses PXP to be marked as doing so, to allow the driver to correctly manage the encryption status. The API for doing this from userspace is coming in the next patch, while this patch implement the management side of things. When a PXP queue is created, the driver will do the following: - Start the default PXP session if it is not already running; - assign an rpm ref to the queue to keep for its lifetime (this is required because PXP HWDRM sessions are killed by the HW suspend flow). Since PXP start and termination can race each other, this patch also introduces locking and a state machine to keep track of the pending operations. Note that since we'll need to take the lock from the suspend/resume paths as well, we can't do submissions while holding it, which means we need a slightly more complicated state machine to keep track of intermediate steps. v4: new patch in the series, split from the following interface patch to keep review manageable. Lock and status rework to not do submissions under lock. v5: Improve comments and error logs (John) Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: John Harrison <John.C.Harrison@Intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250129174140.948829-8-daniele.ceraolospurio@intel.com
1 parent 0387d46 commit f8caa80

File tree

5 files changed

+419
-6
lines changed

5 files changed

+419
-6
lines changed

drivers/gpu/drm/xe/xe_exec_queue.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ static struct xe_exec_queue *__xe_exec_queue_alloc(struct xe_device *xe,
7878
INIT_LIST_HEAD(&q->lr.link);
7979
INIT_LIST_HEAD(&q->multi_gt_link);
8080
INIT_LIST_HEAD(&q->hw_engine_group_link);
81+
INIT_LIST_HEAD(&q->pxp.link);
8182

8283
q->sched_props.timeslice_us = hwe->eclass->sched_props.timeslice_us;
8384
q->sched_props.preempt_timeout_us =

drivers/gpu/drm/xe/xe_exec_queue_types.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,12 @@ struct xe_exec_queue {
130130
struct list_head link;
131131
} lr;
132132

133+
/** @pxp: PXP info tracking */
134+
struct {
135+
/** @pxp.link: link into the list of PXP exec queues */
136+
struct list_head link;
137+
} pxp;
138+
133139
/** @ops: submission backend exec queue operations */
134140
const struct xe_exec_queue_ops *ops;
135141

0 commit comments

Comments
 (0)