Re: [Mesa-dev] [PATCH] intel: devinfo: fix assertion on devices with odd number of EUs

2018-05-04 Thread Kenneth Graunke
On Monday, April 23, 2018 9:52:37 AM PDT Lionel Landwerlin wrote:
> I forgot to change the assert in the second helper function in a
> previous change.
> 
> This hit the assert() on a Broadwell platform with quite a few EUs
> fused off :
>https://i.imgur.com/4Wx6tjz.png

Not sure this link will stay live forever...

Reviewed-by: Kenneth Graunke 

> Fixes: c1900f5b0fb ("intel: devinfo: add helper functions to fill fusing 
> masks values")
> Signed-off-by: Lionel Landwerlin 
> ---
>  src/intel/dev/gen_device_info.c | 6 +-
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/src/intel/dev/gen_device_info.c b/src/intel/dev/gen_device_info.c
> index dfeab6e6060..aa72d96e178 100644
> --- a/src/intel/dev/gen_device_info.c
> +++ b/src/intel/dev/gen_device_info.c
> @@ -1044,11 +1044,7 @@ gen_device_info_update_from_topology(struct 
> gen_device_info *devinfo,
> for (int b = 0; b < eu_mask_len; b++)
>n_eus += __builtin_popcount(devinfo->eu_masks[b]);
> 
> -   /* We expect the total number of EUs to be uniformly distributed 
> throughout
> -* the subslices.
> -*/
> -   assert(n_subslices && (n_eus % n_subslices) == 0);
> -   devinfo->num_eu_per_subslice = n_eus / n_subslices;
> +   devinfo->num_eu_per_subslice = DIV_ROUND_UP(n_eus, n_subslices);
>  }
> 
>  bool
> --
> 2.17.0
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 



signature.asc
Description: This is a digitally signed message part.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] intel: devinfo: fix assertion on devices with odd number of EUs

2018-04-23 Thread Lionel Landwerlin
I forgot to change the assert in the second helper function in a
previous change.

This hit the assert() on a Broadwell platform with quite a few EUs
fused off :
   https://i.imgur.com/4Wx6tjz.png

Fixes: c1900f5b0fb ("intel: devinfo: add helper functions to fill fusing masks 
values")
Signed-off-by: Lionel Landwerlin 
---
 src/intel/dev/gen_device_info.c | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/intel/dev/gen_device_info.c b/src/intel/dev/gen_device_info.c
index dfeab6e6060..aa72d96e178 100644
--- a/src/intel/dev/gen_device_info.c
+++ b/src/intel/dev/gen_device_info.c
@@ -1044,11 +1044,7 @@ gen_device_info_update_from_topology(struct 
gen_device_info *devinfo,
for (int b = 0; b < eu_mask_len; b++)
   n_eus += __builtin_popcount(devinfo->eu_masks[b]);

-   /* We expect the total number of EUs to be uniformly distributed throughout
-* the subslices.
-*/
-   assert(n_subslices && (n_eus % n_subslices) == 0);
-   devinfo->num_eu_per_subslice = n_eus / n_subslices;
+   devinfo->num_eu_per_subslice = DIV_ROUND_UP(n_eus, n_subslices);
 }

 bool
--
2.17.0
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev