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

drm/xe/xe2: Add performance tuning for L3 cache flushing

A recommended performance tuning for LNL related to L3 cache flushing
was recently introduced in Bspec. Implement it.

Unlike the other existing tuning settings, we limit this one for LNL
only, since there is no info about whether this would be applicable to
other platforms yet. In the future we can come back and use IP version
ranges if applicable.

v2:
- Fix reference to Bspec. (Sai Teja, Tejas)
- Use correct register name for "Tuning: L3 RW flush all Cache". (Sai
Teja)
- Use SCRATCH3_LBCF (with the underscore) for better readability.
v3:
- Limit setting to LNL only. (Matt)

Bspec: 72161
Cc: Sai Teja Pottumuttu <sai.teja.pottumuttu@intel.com>
Cc: Tejas Upadhyay <tejas.upadhyay@intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240920211459.255181-5-gustavo.sousa@intel.com
(cherry picked from commit 876253165f3eaaacacb8c8bed16a9df4b6081479)
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>

authored by

Gustavo Sousa and committed by
Lucas De Marchi
6ef5a042 3bf90935

+13
+5
drivers/gpu/drm/xe/regs/xe_gt_regs.h
··· 380 380 #define L3SQCREG3 XE_REG_MCR(0xb108) 381 381 #define COMPPWOVERFETCHEN REG_BIT(28) 382 382 383 + #define SCRATCH3_LBCF XE_REG_MCR(0xb154) 384 + #define RWFLUSHALLEN REG_BIT(17) 385 + 383 386 #define XEHP_L3SQCREG5 XE_REG_MCR(0xb158) 384 387 #define L3_PWM_TIMER_INIT_VAL_MASK REG_GENMASK(9, 0) 385 388 ··· 399 396 #define XE2LPM_L3SQCREG2 XE_REG_MCR(0xb604) 400 397 401 398 #define XE2LPM_L3SQCREG3 XE_REG_MCR(0xb608) 399 + 400 + #define XE2LPM_SCRATCH3_LBCF XE_REG_MCR(0xb654) 402 401 403 402 #define XE2LPM_L3SQCREG5 XE_REG_MCR(0xb658) 404 403
+8
drivers/gpu/drm/xe/xe_tuning.c
··· 75 75 XE_RTP_ACTIONS(FIELD_SET(STATELESS_COMPRESSION_CTRL, UNIFIED_COMPRESSION_FORMAT, 76 76 REG_FIELD_PREP(UNIFIED_COMPRESSION_FORMAT, 0))) 77 77 }, 78 + { XE_RTP_NAME("Tuning: L3 RW flush all Cache"), 79 + XE_RTP_RULES(GRAPHICS_VERSION(2004)), 80 + XE_RTP_ACTIONS(SET(SCRATCH3_LBCF, RWFLUSHALLEN)) 81 + }, 82 + { XE_RTP_NAME("Tuning: L3 RW flush all cache - media"), 83 + XE_RTP_RULES(MEDIA_VERSION(2000)), 84 + XE_RTP_ACTIONS(SET(XE2LPM_SCRATCH3_LBCF, RWFLUSHALLEN)) 85 + }, 78 86 79 87 {} 80 88 };