i965: Add a variable for way size per bank in get_l3_way_size()
authorAnuj Phogat <anuj.phogat@gmail.com>
Sat, 10 Jun 2017 22:48:21 +0000 (15:48 -0700)
committerAnuj Phogat <anuj.phogat@gmail.com>
Tue, 20 Jun 2017 19:18:26 +0000 (12:18 -0700)
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 <anuj.phogat@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
src/intel/common/gen_l3_config.c

index 150ec261a5f3cbda4fb95ea21bab49bf4780c0ce..21ee5ca5dcae7d7c2d3ab098ee634039c7419ea7 100644 (file)
@@ -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;
 }
 
 /**