From 4132337b8a8f8a9b0de8f4c7e2987a2604b092e3 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Wed, 13 Jan 2021 22:59:40 -0800 Subject: [PATCH] anv/gen12: Implement programming of pixel pipe hashing tables. See previous commit "iris/gen12: Implement programming of pixel pipe hashing tables." for the rationale. Reviewed-by: Jason Ekstrand Part-of: --- src/intel/vulkan/genX_state.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/src/intel/vulkan/genX_state.c b/src/intel/vulkan/genX_state.c index f779bf3a..b6e984d 100644 --- a/src/intel/vulkan/genX_state.c +++ b/src/intel/vulkan/genX_state.c @@ -106,6 +106,48 @@ genX(emit_slice_hashing_state)(struct anv_device *device, anv_batch_emit(batch, GENX(3DSTATE_3D_MODE), mode) { mode.SliceHashingTableEnable = true; } +#elif GEN_VERSIONx10 == 120 + /* For each n calculate ppipes_of[n], equal to the number of pixel pipes + * present with n active dual subslices. + */ + unsigned ppipes_of[3] = {}; + + for (unsigned n = 0; n < ARRAY_SIZE(ppipes_of); n++) { + for (unsigned p = 0; p < ARRAY_SIZE(device->info.ppipe_subslices); p++) + ppipes_of[n] += (device->info.ppipe_subslices[p] == n); + } + + /* Gen12 has three pixel pipes. */ + assert(ppipes_of[0] + ppipes_of[1] + ppipes_of[2] == 3); + + if (ppipes_of[2] == 3 || ppipes_of[0] == 2) { + /* All three pixel pipes have the maximum number of active dual + * subslices, or there is only one active pixel pipe: Nothing to do. + */ + return; + } + + anv_batch_emit(batch, GENX(3DSTATE_SUBSLICE_HASH_TABLE), p) { + p.SliceHashControl[0] = TABLE_0; + + if (ppipes_of[2] == 2 && ppipes_of[0] == 1) + calculate_pixel_hashing_table(8, 16, 2, 2, 0, p.TwoWayTableEntry[0]); + else if (ppipes_of[2] == 1 && ppipes_of[1] == 1 && ppipes_of[0] == 1) + calculate_pixel_hashing_table(8, 16, 3, 3, 0, p.TwoWayTableEntry[0]); + + if (ppipes_of[2] == 2 && ppipes_of[1] == 1) + calculate_pixel_hashing_table(8, 16, 5, 4, 0, p.ThreeWayTableEntry[0]); + else if (ppipes_of[2] == 2 && ppipes_of[0] == 1) + calculate_pixel_hashing_table(8, 16, 2, 2, 0, p.ThreeWayTableEntry[0]); + else if (ppipes_of[2] == 1 && ppipes_of[1] == 1 && ppipes_of[0] == 1) + calculate_pixel_hashing_table(8, 16, 3, 3, 0, p.ThreeWayTableEntry[0]); + else + unreachable("Illegal fusing."); + } + + anv_batch_emit(batch, GENX(3DSTATE_3D_MODE), p) { + p.SubsliceHashingTableEnable = true; + } #endif } -- 2.7.4