From: Anuj Phogat Date: Sat, 10 Jun 2017 22:48:21 +0000 (-0700) Subject: i965: Add a variable for way size per bank in get_l3_way_size() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1024dad4d936b6a618e58522071c37a0989832f1;p=mesa.git i965: Add a variable for way size per bank in get_l3_way_size() Adding this variable better explains the computation of L3 way size in the function. V2: Use const variable for way_size_per_bank. Signed-off-by: Anuj Phogat Reviewed-by: Francisco Jerez --- diff --git a/src/intel/common/gen_l3_config.c b/src/intel/common/gen_l3_config.c index 150ec261a5f..21ee5ca5dca 100644 --- a/src/intel/common/gen_l3_config.c +++ b/src/intel/common/gen_l3_config.c @@ -271,12 +271,11 @@ gen_get_l3_config(const struct gen_device_info *devinfo, static unsigned get_l3_way_size(const struct gen_device_info *devinfo) { - assert(devinfo->l3_banks); - - if (devinfo->is_broxton) - return 4; + const unsigned way_size_per_bank = + devinfo->gen >= 9 && devinfo->l3_banks == 1 ? 4 : 2; - return 2 * devinfo->l3_banks; + assert(devinfo->l3_banks); + return way_size_per_bank * devinfo->l3_banks; } /**