Skip to content

Commit

Permalink
drm/xe/guc: Enable WA_DUAL_QUEUE for newer platforms
Browse files Browse the repository at this point in the history
The DUAL_QUEUE_WA tells the GuC to not allow concurrent submissions
on RCS and CCSes with different address spaces, which on DG2 is
required as a WA for an HW bug. On newer platforms, this block has
been moved in HW at the CS level, by stalling the RCS/CCS context
switch when one of the other RCS/CCSes is busy with a different
address space. While functionally correct, having a submission
stalled on the HW limits the GuC ability to shuffle things around and
can cause complications if the non-stalled submission runs for a long
time, because the GuC doesn't know that the stalled submission isn't
actually running and might declare it as hung. Therefore, we enable
the DUAL_QUEUE_WA on all newer platforms to move management back to
the GuC.

Note that the GuC specs also recommend enabling this for all platforms
starting from MTL that have a CCS.

v2: only apply the WA on GTs that have CCS engines
v3: split comment (Jonathan)

Signed-off-by: Daniele Ceraolo Spurio <[email protected]>
Cc: John Harrison <[email protected]>
Cc: Jesus Narvaez <[email protected]>
Cc: Jonathan Cavitt <[email protected]>
Reviewed-by: Jonathan Cavitt <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
dceraolo committed Dec 16, 2024
1 parent cda0641 commit d9a1ae0
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion drivers/gpu/drm/xe/xe_guc.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,34 @@ static u32 guc_ctl_ads_flags(struct xe_guc *guc)
return flags;
}

static bool needs_wa_dual_queue(struct xe_gt *gt)
{
/*
* The DUAL_QUEUE_WA tells the GuC to not allow concurrent submissions
* on RCS and CCSes with different address spaces, which on DG2 is
* required as a WA for an HW bug.
*/
if (XE_WA(gt, 22011391025))
return true;

/*
* On newer platforms, the HW has been updated to not allow parallel
* execution of different address spaces, so the RCS/CCS will stall the
* context switch if one of the other RCS/CCSes is busy with a different
* address space. While functionally correct, having a submission
* stalled on the HW limits the GuC ability to shuffle things around and
* can cause complications if the non-stalled submission runs for a long
* time, because the GuC doesn't know that the stalled submission isn't
* actually running and might declare it as hung. Therefore, we enable
* the DUAL_QUEUE_WA on all newer platforms on GTs that have CCS engines
* to move management back to the GuC.
*/
if (CCS_MASK(gt) && GRAPHICS_VERx100(gt_to_xe(gt)) >= 1270)
return true;

return false;
}

static u32 guc_ctl_wa_flags(struct xe_guc *guc)
{
struct xe_device *xe = guc_to_xe(guc);
Expand All @@ -159,7 +187,7 @@ static u32 guc_ctl_wa_flags(struct xe_guc *guc)
if (XE_WA(gt, 14014475959))
flags |= GUC_WA_HOLD_CCS_SWITCHOUT;

if (XE_WA(gt, 22011391025))
if (needs_wa_dual_queue(gt))
flags |= GUC_WA_DUAL_QUEUE;

/*
Expand Down

0 comments on commit d9a1ae0

Please sign in to comment.