Skip to content

Commit aaa0807

Browse files
vsbelgaumrodrigovivi
authored andcommitted
drm/xe/bmg: Apply Wa_22019338487
Extend this WA to BMG GT as well. In this case media GT is not affected. The cap frequencies and max allowed ggtt writes are different as well. On BMG, we need to do a flush after 1100 GGTT writes, and we need to limit the GT frequency request to 2133 Mhz during driver load and leave it at that value after driver unloads. v3: Fix checkpatch issue Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240701231529.2582452-2-vinay.belgaumkar@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
1 parent b0b2b50 commit aaa0807

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

drivers/gpu/drm/xe/xe_ggtt.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,18 @@ static unsigned int probe_gsm_size(struct pci_dev *pdev)
7474

7575
static void ggtt_update_access_counter(struct xe_ggtt *ggtt)
7676
{
77+
struct xe_gt *gt = XE_WA(ggtt->tile->primary_gt, 22019338487) ? ggtt->tile->primary_gt :
78+
ggtt->tile->media_gt;
79+
u32 max_gtt_writes = XE_WA(ggtt->tile->primary_gt, 22019338487) ? 1100 : 63;
7780
/*
7881
* Wa_22019338487: GMD_ID is a RO register, a dummy write forces gunit
7982
* to wait for completion of prior GTT writes before letting this through.
8083
* This needs to be done for all GGTT writes originating from the CPU.
8184
*/
8285
lockdep_assert_held(&ggtt->lock);
8386

84-
if ((++ggtt->access_count % 63) == 0) {
85-
xe_mmio_write32(ggtt->tile->media_gt, GMD_ID, 0x0);
87+
if ((++ggtt->access_count % max_gtt_writes) == 0) {
88+
xe_mmio_write32(gt, GMD_ID, 0x0);
8689
ggtt->access_count = 0;
8790
}
8891
}
@@ -218,7 +221,9 @@ int xe_ggtt_init_early(struct xe_ggtt *ggtt)
218221
ggtt->size = GUC_GGTT_TOP;
219222

220223
if (GRAPHICS_VERx100(xe) >= 1270)
221-
ggtt->pt_ops = ggtt->tile->media_gt && XE_WA(ggtt->tile->media_gt, 22019338487) ?
224+
ggtt->pt_ops = (ggtt->tile->media_gt &&
225+
XE_WA(ggtt->tile->media_gt, 22019338487)) ||
226+
XE_WA(ggtt->tile->primary_gt, 22019338487) ?
222227
&xelpg_pt_wa_ops : &xelpg_pt_ops;
223228
else
224229
ggtt->pt_ops = &xelp_pt_ops;

drivers/gpu/drm/xe/xe_gt.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -821,8 +821,7 @@ int xe_gt_sanitize_freq(struct xe_gt *gt)
821821
int ret = 0;
822822

823823
if ((!xe_uc_fw_is_available(&gt->uc.gsc.fw) ||
824-
xe_uc_fw_is_loaded(&gt->uc.gsc.fw)) &&
825-
XE_WA(gt, 22019338487))
824+
xe_uc_fw_is_loaded(&gt->uc.gsc.fw)) && XE_WA(gt, 22019338487))
826825
ret = xe_guc_pc_restore_stashed_freq(&gt->uc.guc.pc);
827826

828827
return ret;

drivers/gpu/drm/xe/xe_guc_pc.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
#define GT_FREQUENCY_SCALER 3
4747

4848
#define LNL_MERT_FREQ_CAP 800
49+
#define BMG_MERT_FREQ_CAP 2133
4950

5051
/**
5152
* DOC: GuC Power Conservation (PC)
@@ -704,10 +705,14 @@ static u32 pc_max_freq_cap(struct xe_guc_pc *pc)
704705
{
705706
struct xe_gt *gt = pc_to_gt(pc);
706707

707-
if (XE_WA(gt, 22019338487))
708-
return min(LNL_MERT_FREQ_CAP, pc->rp0_freq);
709-
else
708+
if (XE_WA(gt, 22019338487)) {
709+
if (xe_gt_is_media_type(gt))
710+
return min(LNL_MERT_FREQ_CAP, pc->rp0_freq);
711+
else
712+
return min(BMG_MERT_FREQ_CAP, pc->rp0_freq);
713+
} else {
710714
return pc->rp0_freq;
715+
}
711716
}
712717

713718
/**

drivers/gpu/drm/xe/xe_wa_oob.rules

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@
2828
GRAPHICS_VERSION(2004)
2929
13011645652 GRAPHICS_VERSION(2004)
3030
22019338487 MEDIA_VERSION(2000)
31+
GRAPHICS_VERSION(2001)

0 commit comments

Comments
 (0)