[Mesa-dev] [PATCH 2/2] i965: Add way_size_per_bank variable in get_l3_way_size()
Francisco Jerez
currojerez at riseup.net
Mon Jun 12 18:12:04 UTC 2017
Anuj Phogat <anuj.phogat at gmail.com> writes:
> Adding this variable better explains the computation for L3 way
> size in the function.
>
> Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
> Cc: Francisco Jerez <currojerez at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 212 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170612/942d4a71/attachment.sig>
More information about the mesa-dev
mailing list