Module: Mesa Branch: main Commit: 29c2f32a57c8da512b6229d2b4087b0bd88500d8 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=29c2f32a57c8da512b6229d2b4087b0bd88500d8
Author: Jordan Justen <[email protected]> Date: Tue Oct 26 01:03:07 2021 -0700 intel/dev: Add platform enum with DG2 G10 & G11 Based on Lionel's "intel/devinfo: store the different kind of DG2". Ref: 361b3fee3c5 ("intel: move away from booleans to identify platforms") Ref: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9e22cfc5e9b92556a56d8a564cdab31045f29010 Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13797> --- src/intel/common/intel_l3_config.c | 2 +- src/intel/dev/intel_device_info.h | 18 +++++++++++++++++- src/intel/isl/isl.c | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) 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;
