From beb680aae431fe2ba36594a8aec004e1e1aeb004 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Thu, 18 Mar 2021 11:03:35 +0200 Subject: [PATCH] intel/dev: store size of CS prefetch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lionel Landwerlin Reviewed-by: Marcin Ĺšlusarz Part-of: --- src/intel/dev/gen_device_info.c | 19 +++++++++++++++---- src/intel/dev/gen_device_info.h | 6 ++++++ src/intel/dev/gen_device_info_test.c | 1 + 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/intel/dev/gen_device_info.c b/src/intel/dev/gen_device_info.c index 5fb02946669..ad2a8be69ac 100644 --- a/src/intel/dev/gen_device_info.c +++ b/src/intel/dev/gen_device_info.c @@ -86,6 +86,7 @@ gen_device_name_to_pci_device_id(const char *name) static const struct gen_device_info gen_device_info_gen3 = { .gen = 3, .simulator_id = -1, + .cs_prefetch_size = 512, }; static const struct gen_device_info gen_device_info_i965 = { @@ -103,6 +104,7 @@ static const struct gen_device_info gen_device_info_i965 = { }, .timestamp_frequency = 12500000, .simulator_id = -1, + .cs_prefetch_size = 512, }; static const struct gen_device_info gen_device_info_g4x = { @@ -124,6 +126,7 @@ static const struct gen_device_info gen_device_info_g4x = { }, .timestamp_frequency = 12500000, .simulator_id = -1, + .cs_prefetch_size = 512, }; static const struct gen_device_info gen_device_info_ilk = { @@ -143,6 +146,7 @@ static const struct gen_device_info gen_device_info_ilk = { }, .timestamp_frequency = 12500000, .simulator_id = -1, + .cs_prefetch_size = 512, }; static const struct gen_device_info gen_device_info_snb_gt1 = { @@ -172,6 +176,7 @@ static const struct gen_device_info gen_device_info_snb_gt1 = { }, .timestamp_frequency = 12500000, .simulator_id = -1, + .cs_prefetch_size = 512, }; static const struct gen_device_info gen_device_info_snb_gt2 = { @@ -201,6 +206,7 @@ static const struct gen_device_info gen_device_info_snb_gt2 = { }, .timestamp_frequency = 12500000, .simulator_id = -1, + .cs_prefetch_size = 512, }; #define GEN7_FEATURES \ @@ -211,7 +217,8 @@ static const struct gen_device_info gen_device_info_snb_gt2 = { .has_pln = true, \ .has_64bit_float = true, \ .has_surface_tile_offset = true, \ - .timestamp_frequency = 12500000 + .timestamp_frequency = 12500000, \ + .cs_prefetch_size = 512 static const struct gen_device_info gen_device_info_ivb_gt1 = { GEN7_FEATURES, .is_ivybridge = true, .gt = 1, @@ -412,7 +419,8 @@ static const struct gen_device_info gen_device_info_hsw_gt3 = { .max_tes_threads = 504, \ .max_gs_threads = 504, \ .max_wm_threads = 384, \ - .timestamp_frequency = 12500000 + .timestamp_frequency = 12500000, \ + .cs_prefetch_size = 512 static const struct gen_device_info gen_device_info_bdw_gt1 = { GEN8_FEATURES, .gt = 1, @@ -521,6 +529,7 @@ static const struct gen_device_info gen_device_info_chv = { .max_tes_threads = 336, \ .max_cs_threads = 56, \ .timestamp_frequency = 12000000, \ + .cs_prefetch_size = 512, \ .urb = { \ .min_entries = { \ [MESA_SHADER_VERTEX] = 64, \ @@ -804,7 +813,8 @@ static const struct gen_device_info gen_device_info_cfl_gt3 = { .max_gs_threads = 224, \ .max_tcs_threads = 224, \ .max_tes_threads = 364, \ - .max_cs_threads = 56 + .max_cs_threads = 56, \ + .cs_prefetch_size = 512 #define GEN11_FEATURES(_gt, _slices, _subslices, _l3) \ GEN8_FEATURES, \ @@ -937,7 +947,8 @@ static const struct gen_device_info gen_device_info_ehl_2x4 = { .has_integer_dword_mul = false, \ .gt = _gt, .num_slices = _slices, .l3_banks = _l3, \ .simulator_id = 22, \ - .num_eu_per_subslice = 16 + .num_eu_per_subslice = 16, \ + .cs_prefetch_size = 512 #define dual_subslices(args...) { args, } diff --git a/src/intel/dev/gen_device_info.h b/src/intel/dev/gen_device_info.h index 4b3db81ad4a..3fdeeb08da9 100644 --- a/src/intel/dev/gen_device_info.h +++ b/src/intel/dev/gen_device_info.h @@ -236,6 +236,12 @@ struct gen_device_info unsigned max_entries[4]; } urb; + /** + * Size of the command streamer prefetch. This is important to know for + * self modifying batches. + */ + unsigned cs_prefetch_size; + /** * For the longest time the timestamp frequency for Gen's timestamp counter * could be assumed to be 12.5MHz, where the least significant bit neatly diff --git a/src/intel/dev/gen_device_info_test.c b/src/intel/dev/gen_device_info_test.c index f104163db69..3079fdefa19 100644 --- a/src/intel/dev/gen_device_info_test.c +++ b/src/intel/dev/gen_device_info_test.c @@ -27,6 +27,7 @@ main(int argc, char *argv[]) assert(devinfo.num_eu_per_subslice != 0); assert(devinfo.num_thread_per_eu != 0); assert(devinfo.timestamp_frequency != 0); + assert(devinfo.cs_prefetch_size > 0); } return 0;