Anuj Phogat <anuj.pho...@gmail.com> writes:

> Adding this variable better explains the computation for L3 way
> size in the function.
>
> Signed-off-by: Anuj Phogat <anuj.pho...@gmail.com>
> Cc: Francisco Jerez <curroje...@riseup.net>
> ---
>  src/intel/common/gen_l3_config.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/src/intel/common/gen_l3_config.c 
> b/src/intel/common/gen_l3_config.c
> index e17994b..76d2eb9 100644
> --- a/src/intel/common/gen_l3_config.c
> +++ b/src/intel/common/gen_l3_config.c
> @@ -274,12 +274,17 @@ gen_get_l3_config(const struct gen_device_info *devinfo,
>  static unsigned
>  get_l3_way_size(const struct gen_device_info *devinfo)
>  {
> +   unsigned way_size_per_bank;
> +

I'd rather declare the constant as const (which implies initializing it
using an initializer expression).

>     assert(devinfo->l3_banks);
>  
> -   if (devinfo->is_broxton)
> -      return 4;
> +   if (devinfo->is_broxton_2x6) {
> +      way_size_per_bank = 4;
> +   } else {
> +      way_size_per_bank = 2;
> +   }
>  
> -   return 2 * devinfo->l3_banks;
> +   return way_size_per_bank * devinfo->l3_banks;
>  }
>  
>  /**
> -- 
> 2.9.3

Attachment: signature.asc
Description: PGP signature

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to