Skip to content

Commit 402377b

Browse files
mattropeLucas De Marchi
authored andcommitted
drm/xe/cri: Setup MOCS table
CRI has a new MOCS table, but uses the same general ops as other Xe2/Xe3 platforms. Bspec: 71582 Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Reviewed-by: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com> Link: https://patch.msgid.link/20251021-cri-v1-3-bf11e61d9f49@intel.com Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
1 parent 5e0de2d commit 402377b

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

drivers/gpu/drm/xe/xe_mocs.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,23 @@ static const struct xe_mocs_ops xe2_mocs_ops = {
568568
.dump = xe2_mocs_dump,
569569
};
570570

571+
/*
572+
* Note that the "L3" and "L4" register fields actually control the L2 and L3
573+
* caches respectively on this platform.
574+
*/
575+
static const struct xe_mocs_entry xe3p_xpc_mocs_table[] = {
576+
/* Defer to PAT */
577+
MOCS_ENTRY(0, XE2_L3_0_WB | L4_3_UC, 0),
578+
/* UC */
579+
MOCS_ENTRY(1, IG_PAT | XE2_L3_3_UC | L4_3_UC, 0),
580+
/* L2 */
581+
MOCS_ENTRY(2, IG_PAT | XE2_L3_0_WB | L4_3_UC, 0),
582+
/* L3 */
583+
MOCS_ENTRY(3, IG_PAT | XE2_L3_3_UC | L4_0_WB, 0),
584+
/* L2 + L3 */
585+
MOCS_ENTRY(4, IG_PAT | XE2_L3_0_WB | L4_0_WB, 0),
586+
};
587+
571588
static unsigned int get_mocs_settings(struct xe_device *xe,
572589
struct xe_mocs_info *info)
573590
{
@@ -576,6 +593,15 @@ static unsigned int get_mocs_settings(struct xe_device *xe,
576593
memset(info, 0, sizeof(struct xe_mocs_info));
577594

578595
switch (xe->info.platform) {
596+
case XE_CRESCENTISLAND:
597+
info->ops = &xe2_mocs_ops;
598+
info->table_size = ARRAY_SIZE(xe3p_xpc_mocs_table);
599+
info->table = xe3p_xpc_mocs_table;
600+
info->num_mocs_regs = XE2_NUM_MOCS_ENTRIES;
601+
info->uc_index = 1;
602+
info->wb_index = 4;
603+
info->unused_entries_index = 4;
604+
break;
579605
case XE_NOVALAKE_S:
580606
case XE_PANTHERLAKE:
581607
case XE_LUNARLAKE:

0 commit comments

Comments
 (0)