Skip to content

Commit 328e089

Browse files
baluvivekrodrigovivi
authored andcommitted
drm/xe: Leverage ComputeCS read L3 caching
On platforms that support read L3 caching, set the default mocs index in CCS RING_CMD_CTL to leverage the read caching in L3. Currently PVC and Xe2 platforms have the support. Bspec: 72161 Signed-off-by: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Link: https://lore.kernel.org/r/20230929051539.3157441-1-lucas.demarchi@intel.com Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
1 parent 30603b5 commit 328e089

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

drivers/gpu/drm/xe/xe_hw_engine.c

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -316,22 +316,25 @@ static void
316316
hw_engine_setup_default_state(struct xe_hw_engine *hwe)
317317
{
318318
struct xe_gt *gt = hwe->gt;
319+
struct xe_device *xe = gt_to_xe(gt);
320+
/*
321+
* RING_CMD_CCTL specifies the default MOCS entry that will be
322+
* used by the command streamer when executing commands that
323+
* don't have a way to explicitly specify a MOCS setting.
324+
* The default should usually reference whichever MOCS entry
325+
* corresponds to uncached behavior, although use of a WB cached
326+
* entry is recommended by the spec in certain circumstances on
327+
* specific platforms.
328+
* Bspec: 72161
329+
*/
319330
const u8 mocs_write_idx = gt->mocs.uc_index;
320-
/* TODO: missing handling of HAS_L3_CCS_READ platforms */
321-
const u8 mocs_read_idx = gt->mocs.uc_index;
331+
const u8 mocs_read_idx = hwe->class == XE_ENGINE_CLASS_COMPUTE &&
332+
(GRAPHICS_VER(xe) >= 20 || xe->info.platform == XE_PVC) ?
333+
gt->mocs.wb_index : gt->mocs.uc_index;
322334
u32 ring_cmd_cctl_val = REG_FIELD_PREP(CMD_CCTL_WRITE_OVERRIDE_MASK, mocs_write_idx) |
323335
REG_FIELD_PREP(CMD_CCTL_READ_OVERRIDE_MASK, mocs_read_idx);
324336
struct xe_rtp_process_ctx ctx = XE_RTP_PROCESS_CTX_INITIALIZER(hwe);
325337
const struct xe_rtp_entry_sr engine_entries[] = {
326-
/*
327-
* RING_CMD_CCTL specifies the default MOCS entry that will be
328-
* used by the command streamer when executing commands that
329-
* don't have a way to explicitly specify a MOCS setting.
330-
* The default should usually reference whichever MOCS entry
331-
* corresponds to uncached behavior, although use of a WB cached
332-
* entry is recommended by the spec in certain circumstances on
333-
* specific platforms.
334-
*/
335338
{ XE_RTP_NAME("RING_CMD_CCTL_default_MOCS"),
336339
XE_RTP_RULES(GRAPHICS_VERSION_RANGE(1200, XE_RTP_END_VERSION_UNDEFINED)),
337340
XE_RTP_ACTIONS(FIELD_SET(RING_CMD_CCTL(0),

0 commit comments

Comments
 (0)