Skip to content

Commit bd03427

Browse files
mattropeLucas De Marchi
authored andcommitted
drm/xe/xe3p_xpc: Skip compression tuning on platforms without flatccs
The compression overfetch tuning settings only apply to platforms that support FlatCCS. In Xe3p_XPC (and any future IPs that also lack compression) some of the registers being adjusted by this tuning will not exist or may have been repurposed for something else, so we should take care not to try to program them. Note that our xe_rtp_match_has_flatccs() function will also return false on platforms that do have FlatCCS in the hardware design, but have compression manually disabled in the BIOS. On such platforms the registers still exist (and it would be fine to continue programming them), but they would have no effect, so skipping that tuning is also safe. Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Reviewed-by: Shekhar Chauhan <shekhar.chauhan@intel.com> Link: https://lore.kernel.org/r/20251016-xe3p-v3-22-3dd173a3097a@intel.com Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
1 parent 32e0fa9 commit bd03427

3 files changed

Lines changed: 25 additions & 3 deletions

File tree

drivers/gpu/drm/xe/xe_rtp.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,3 +378,10 @@ bool xe_rtp_match_gt_has_discontiguous_dss_groups(const struct xe_device *xe,
378378
{
379379
return xe_gt_has_discontiguous_dss_groups(gt);
380380
}
381+
382+
bool xe_rtp_match_has_flat_ccs(const struct xe_device *xe,
383+
const struct xe_gt *gt,
384+
const struct xe_hw_engine *hwe)
385+
{
386+
return xe->info.has_flat_ccs;
387+
}

drivers/gpu/drm/xe/xe_rtp.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,4 +491,16 @@ bool xe_rtp_match_gt_has_discontiguous_dss_groups(const struct xe_device *xe,
491491
const struct xe_gt *gt,
492492
const struct xe_hw_engine *hwe);
493493

494+
/**
495+
* xe_rtp_match_has_flat_ccs - Match when platform has FlatCCS compression
496+
* @xe: Device structure
497+
* @gt: GT structure
498+
* @hwe: Engine instance
499+
*
500+
* Returns: true if platform has FlatCCS compression, false otherwise
501+
*/
502+
bool xe_rtp_match_has_flat_ccs(const struct xe_device *xe,
503+
const struct xe_gt *gt,
504+
const struct xe_hw_engine *hwe);
505+
494506
#endif

drivers/gpu/drm/xe/xe_tuning.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ static const struct xe_rtp_entry_sr gt_tunings[] = {
4040
REG_FIELD_PREP(L3_PWM_TIMER_INIT_VAL_MASK, 0x7f)))
4141
},
4242
{ XE_RTP_NAME("Tuning: Compression Overfetch"),
43-
XE_RTP_RULES(GRAPHICS_VERSION_RANGE(2001, XE_RTP_END_VERSION_UNDEFINED)),
43+
XE_RTP_RULES(GRAPHICS_VERSION_RANGE(2001, XE_RTP_END_VERSION_UNDEFINED),
44+
FUNC(xe_rtp_match_has_flat_ccs)),
4445
XE_RTP_ACTIONS(CLR(CCCHKNREG1, ENCOMPPERFFIX),
4546
SET(CCCHKNREG1, L3CMPCTRL))
4647
},
@@ -58,12 +59,14 @@ static const struct xe_rtp_entry_sr gt_tunings[] = {
5859
XE_RTP_ACTIONS(SET(XE2LPM_L3SQCREG3, COMPPWOVERFETCHEN))
5960
},
6061
{ XE_RTP_NAME("Tuning: L2 Overfetch Compressible Only"),
61-
XE_RTP_RULES(GRAPHICS_VERSION_RANGE(2001, XE_RTP_END_VERSION_UNDEFINED)),
62+
XE_RTP_RULES(GRAPHICS_VERSION_RANGE(2001, XE_RTP_END_VERSION_UNDEFINED),
63+
FUNC(xe_rtp_match_has_flat_ccs)),
6264
XE_RTP_ACTIONS(SET(L3SQCREG2,
6365
COMPMEMRD256BOVRFETCHEN))
6466
},
6567
{ XE_RTP_NAME("Tuning: L2 Overfetch Compressible Only - media"),
66-
XE_RTP_RULES(MEDIA_VERSION_RANGE(2000, XE_RTP_END_VERSION_UNDEFINED)),
68+
XE_RTP_RULES(MEDIA_VERSION_RANGE(2000, XE_RTP_END_VERSION_UNDEFINED),
69+
FUNC(xe_rtp_match_has_flat_ccs)),
6770
XE_RTP_ACTIONS(SET(XE2LPM_L3SQCREG2,
6871
COMPMEMRD256BOVRFETCHEN))
6972
},

0 commit comments

Comments
 (0)