From 1024dad4d936b6a618e58522071c37a0989832f1 Mon Sep 17 00:00:00 2001 From: Anuj Phogat Date: Sat, 10 Jun 2017 15:48:21 -0700 Subject: [PATCH] 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 --- src/intel/common/gen_l3_config.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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; } /** -- 2.30.2