diff --git a/src/intel/common/intel_l3_config.c b/src/intel/common/intel_l3_config.c index d752fcf12b6..a48e33bf759 100644 --- a/src/intel/common/intel_l3_config.c +++ b/src/intel/common/intel_l3_config.c @@ -180,7 +180,7 @@ get_l3_list(const struct intel_device_info *devinfo) case 12: if (devinfo->platform == INTEL_PLATFORM_DG1 || - devinfo->platform == INTEL_PLATFORM_DG2) + intel_device_info_is_dg2(devinfo)) return &empty_l3_list; else return &tgl_l3_list; diff --git a/src/intel/dev/intel_device_info.h b/src/intel/dev/intel_device_info.h index d94e9e703a8..e3f93bd65e0 100644 --- a/src/intel/dev/intel_device_info.h +++ b/src/intel/dev/intel_device_info.h @@ -43,6 +43,11 @@ struct drm_i915_query_topology_info; #define INTEL_DEVICE_MAX_EUS_PER_SUBSLICE (16) /* Maximum on gfx12 */ #define INTEL_DEVICE_MAX_PIXEL_PIPES (3) /* Maximum on gfx12 */ +#define INTEL_PLATFORM_GROUP_START(group, new_enum) \ + new_enum, INTEL_PLATFORM_ ## group ## _START = new_enum +#define INTEL_PLATFORM_GROUP_END(group, new_enum) \ + new_enum, INTEL_PLATFORM_ ## group ## _END = new_enum + enum intel_platform { INTEL_PLATFORM_GFX3 = 1, INTEL_PLATFORM_I965, @@ -65,9 +70,20 @@ enum intel_platform { INTEL_PLATFORM_RKL, INTEL_PLATFORM_DG1, INTEL_PLATFORM_ADL, - INTEL_PLATFORM_DG2, + INTEL_PLATFORM_GROUP_START(DG2, INTEL_PLATFORM_DG2_G10), + INTEL_PLATFORM_GROUP_END(DG2, INTEL_PLATFORM_DG2_G11), }; +#undef INTEL_PLATFORM_GROUP_START +#undef INTEL_PLATFORM_GROUP_END + +#define intel_platform_in_range(platform, platform_range) \ + (((platform) >= INTEL_PLATFORM_ ## platform_range ## _START) && \ + ((platform) <= INTEL_PLATFORM_ ## platform_range ## _END)) + +#define intel_device_info_is_dg2(devinfo) \ + intel_platform_in_range((devinfo)->platform, DG2) + /** * Intel hardware information and quirks */ diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c index 1848659d344..4fdece4f5c7 100644 --- a/src/intel/isl/isl.c +++ b/src/intel/isl/isl.c @@ -99,7 +99,7 @@ static void isl_device_setup_mocs(struct isl_device *dev) { if (dev->info->ver >= 12) { - if (dev->info->platform == INTEL_PLATFORM_DG2) { + if (intel_device_info_is_dg2(dev->info)) { /* L3CC=WB; BSpec: 45101 */ dev->mocs.internal = 3 << 1; dev->mocs.external = 3 << 1;