From 822687f4c06fd178a64295d45780bdc962b2939c Mon Sep 17 00:00:00 2001 From: Nanley Chery Date: Wed, 30 Nov 2022 14:47:47 -0800 Subject: [PATCH] intel/dev: Add a has_illegal_ccs_values flag Whether or not CCS can be used without initialization depends on the platform: - On gfx7-8, each CCS element is 1-bit and encodes "fast-cleared" or "pass-through". So, those platforms have no illegal values. - On gfx9-11, each CCS element is 2-bits and some bit combinations are invalid. - On gfx12+, each CCS element is 4-bits but they have no truly illegal values. Unused encodings are interpreted as "pass-through". Refer to the "MCS/CCS Buffers for Render Target(s)" sections of the PRMs for more info. Reviewed-by: Ivan Briano Reviewed-by: Kenneth Graunke Part-of: --- src/intel/dev/intel_device_info.c | 6 +++++- src/intel/dev/intel_device_info.h | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/intel/dev/intel_device_info.c b/src/intel/dev/intel_device_info.c index 5d32853be91..2dc93006bbd 100644 --- a/src/intel/dev/intel_device_info.c +++ b/src/intel/dev/intel_device_info.c @@ -563,6 +563,7 @@ static const struct intel_device_info intel_device_info_chv = { .gt = 1, \ .has_llc = false, \ .has_sample_with_hiz = true, \ + .has_illegal_ccs_values = true, \ .num_slices = 1, \ .num_thread_per_eu = 6, \ .max_vs_threads = 112, \ @@ -614,7 +615,8 @@ static const struct intel_device_info intel_device_info_chv = { #define GFX9_FEATURES \ GFX8_FEATURES, \ GFX9_HW_INFO, \ - .has_sample_with_hiz = true + .has_sample_with_hiz = true, \ + .has_illegal_ccs_values = true static const struct intel_device_info intel_device_info_skl_gt1 = { GFX9_FEATURES, .gt = 1, @@ -837,6 +839,7 @@ static const struct intel_device_info intel_device_info_cfl_gt3 = { .has_64bit_int = false, \ .has_integer_dword_mul = false, \ .has_sample_with_hiz = false, \ + .has_illegal_ccs_values = true, \ .gt = _gt, .num_slices = _slices, .l3_banks = _l3, \ .num_subslices = _subslices, \ .max_eus_per_subslice = 8 @@ -890,6 +893,7 @@ static const struct intel_device_info intel_device_info_icl_gt0_5 = { GFX11_URB_MIN_MAX_ENTRIES, \ }, \ .disable_ccs_repack = true, \ + .has_illegal_ccs_values = true, \ .simulator_id = 28 static const struct intel_device_info intel_device_info_ehl_4x8 = { diff --git a/src/intel/dev/intel_device_info.h b/src/intel/dev/intel_device_info.h index 48ac149ab2c..ded43553cc7 100644 --- a/src/intel/dev/intel_device_info.h +++ b/src/intel/dev/intel_device_info.h @@ -134,6 +134,11 @@ struct intel_device_info bool supports_simd16_3src; bool disable_ccs_repack; + /** + * True if CCS needs to be initialized before use. + */ + bool has_illegal_ccs_values; + /** * True if CCS uses a flat virtual address translation to a memory * carve-out, rather than aux map translations, or additional surfaces.