Skip to content

Commit 3bf9093

Browse files
guludolucasdemarchi
authored andcommitted
drm/xe/xe2: Extend performance tuning to media GT
With exception of "Tuning: L3 cache - media", we are currently applying recommended performance tuning settings only for the primary GT. Let's also implement them for the media GT when applicable. According to our spec, media GT registers CCCHKNREG1 and L3SQCREG* exist only in Xe2_LPM and their offsets do not match their primary GT counterparts. Furthermore, the range where CCCHKNREG1 belongs is not listed as a multicast range on the media GT. As such, we need to have Xe2_LPM-specific definitions for those registers and apply the setting only for that specific IP. Both Xe2_HPM and Xe2_LPM contain STATELESS_COMPRESSION_CTRL and the offset on the media GT matches the one on the primary one. So we can simply have a copy of "Tuning: Stateless compression control" for the media GT. v2: - Fix implementation with respect to multicast vs non-multicast registers. (Matt) - Add missing XE2LPM_CCCHKNREG1 on second action of "Tuning: Compression Overfetch - media". v3: - STATELESS_COMPRESSION_CTRL on Xe2_HPM is also a multicast register, do not define a XE2HPM_STATELESS_COMPRESSION_CTRL register. (Tejas) Bspec: 72161 Cc: Matt Roper <[email protected]> Reviewed-by: Tejas Upadhyay <[email protected]> Signed-off-by: Gustavo Sousa <[email protected]> Signed-off-by: Matt Roper <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit e1f8139) Signed-off-by: Lucas De Marchi <[email protected]>
1 parent 7929ffc commit 3bf9093

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

drivers/gpu/drm/xe/regs/xe_gt_regs.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@
169169
#define XEHP_SLICE_COMMON_ECO_CHICKEN1 XE_REG_MCR(0x731c, XE_REG_OPTION_MASKED)
170170
#define MSC_MSAA_REODER_BUF_BYPASS_DISABLE REG_BIT(14)
171171

172+
#define XE2LPM_CCCHKNREG1 XE_REG(0x82a8)
173+
172174
#define VF_PREEMPTION XE_REG(0x83a4, XE_REG_OPTION_MASKED)
173175
#define PREEMPTION_VERTEX_COUNT REG_GENMASK(15, 0)
174176

@@ -391,6 +393,10 @@
391393
#define SCRATCH1LPFC XE_REG(0xb474)
392394
#define EN_L3_RW_CCS_CACHE_FLUSH REG_BIT(0)
393395

396+
#define XE2LPM_L3SQCREG2 XE_REG_MCR(0xb604)
397+
398+
#define XE2LPM_L3SQCREG3 XE_REG_MCR(0xb608)
399+
394400
#define XE2LPM_L3SQCREG5 XE_REG_MCR(0xb658)
395401

396402
#define XE2_TDF_CTRL XE_REG(0xb418)

drivers/gpu/drm/xe/xe_tuning.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,40 @@ static const struct xe_rtp_entry_sr gt_tunings[] = {
4242
XE_RTP_ACTIONS(CLR(CCCHKNREG1, ENCOMPPERFFIX),
4343
SET(CCCHKNREG1, L3CMPCTRL))
4444
},
45+
{ XE_RTP_NAME("Tuning: Compression Overfetch - media"),
46+
XE_RTP_RULES(MEDIA_VERSION(2000)),
47+
XE_RTP_ACTIONS(CLR(XE2LPM_CCCHKNREG1, ENCOMPPERFFIX),
48+
SET(XE2LPM_CCCHKNREG1, L3CMPCTRL))
49+
},
4550
{ XE_RTP_NAME("Tuning: Enable compressible partial write overfetch in L3"),
4651
XE_RTP_RULES(GRAPHICS_VERSION_RANGE(2001, XE_RTP_END_VERSION_UNDEFINED)),
4752
XE_RTP_ACTIONS(SET(L3SQCREG3, COMPPWOVERFETCHEN))
4853
},
54+
{ XE_RTP_NAME("Tuning: Enable compressible partial write overfetch in L3 - media"),
55+
XE_RTP_RULES(MEDIA_VERSION(2000)),
56+
XE_RTP_ACTIONS(SET(XE2LPM_L3SQCREG3, COMPPWOVERFETCHEN))
57+
},
4958
{ XE_RTP_NAME("Tuning: L2 Overfetch Compressible Only"),
5059
XE_RTP_RULES(GRAPHICS_VERSION_RANGE(2001, XE_RTP_END_VERSION_UNDEFINED)),
5160
XE_RTP_ACTIONS(SET(L3SQCREG2,
5261
COMPMEMRD256BOVRFETCHEN))
5362
},
63+
{ XE_RTP_NAME("Tuning: L2 Overfetch Compressible Only - media"),
64+
XE_RTP_RULES(MEDIA_VERSION(2000)),
65+
XE_RTP_ACTIONS(SET(XE2LPM_L3SQCREG2,
66+
COMPMEMRD256BOVRFETCHEN))
67+
},
5468
{ XE_RTP_NAME("Tuning: Stateless compression control"),
5569
XE_RTP_RULES(GRAPHICS_VERSION_RANGE(2001, XE_RTP_END_VERSION_UNDEFINED)),
5670
XE_RTP_ACTIONS(FIELD_SET(STATELESS_COMPRESSION_CTRL, UNIFIED_COMPRESSION_FORMAT,
5771
REG_FIELD_PREP(UNIFIED_COMPRESSION_FORMAT, 0)))
5872
},
73+
{ XE_RTP_NAME("Tuning: Stateless compression control - media"),
74+
XE_RTP_RULES(MEDIA_VERSION_RANGE(1301, 2000)),
75+
XE_RTP_ACTIONS(FIELD_SET(STATELESS_COMPRESSION_CTRL, UNIFIED_COMPRESSION_FORMAT,
76+
REG_FIELD_PREP(UNIFIED_COMPRESSION_FORMAT, 0)))
77+
},
78+
5979
{}
6080
};
6181

0 commit comments

Comments
 (0)