Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Matt Roper and committed by
Lucas De Marchi
bd03427c 32e0fa9e

+25 -3
+7
drivers/gpu/drm/xe/xe_rtp.c
··· 378 378 { 379 379 return xe_gt_has_discontiguous_dss_groups(gt); 380 380 } 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 + }
+12
drivers/gpu/drm/xe/xe_rtp.h
··· 491 491 const struct xe_gt *gt, 492 492 const struct xe_hw_engine *hwe); 493 493 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 + 494 506 #endif
+6 -3
drivers/gpu/drm/xe/xe_tuning.c
··· 40 40 REG_FIELD_PREP(L3_PWM_TIMER_INIT_VAL_MASK, 0x7f))) 41 41 }, 42 42 { 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)), 44 45 XE_RTP_ACTIONS(CLR(CCCHKNREG1, ENCOMPPERFFIX), 45 46 SET(CCCHKNREG1, L3CMPCTRL)) 46 47 }, ··· 59 58 XE_RTP_ACTIONS(SET(XE2LPM_L3SQCREG3, COMPPWOVERFETCHEN)) 60 59 }, 61 60 { XE_RTP_NAME("Tuning: L2 Overfetch Compressible Only"), 62 - XE_RTP_RULES(GRAPHICS_VERSION_RANGE(2001, XE_RTP_END_VERSION_UNDEFINED)), 61 + XE_RTP_RULES(GRAPHICS_VERSION_RANGE(2001, XE_RTP_END_VERSION_UNDEFINED), 62 + FUNC(xe_rtp_match_has_flat_ccs)), 63 63 XE_RTP_ACTIONS(SET(L3SQCREG2, 64 64 COMPMEMRD256BOVRFETCHEN)) 65 65 }, 66 66 { XE_RTP_NAME("Tuning: L2 Overfetch Compressible Only - media"), 67 - XE_RTP_RULES(MEDIA_VERSION_RANGE(2000, XE_RTP_END_VERSION_UNDEFINED)), 67 + XE_RTP_RULES(MEDIA_VERSION_RANGE(2000, XE_RTP_END_VERSION_UNDEFINED), 68 + FUNC(xe_rtp_match_has_flat_ccs)), 68 69 XE_RTP_ACTIONS(SET(XE2LPM_L3SQCREG2, 69 70 COMPMEMRD256BOVRFETCHEN)) 70 71 },