Not sure I agree this is a cleanup.

The code here is independent of hardware, while the initialization of
tess_offchip_block_dw_size in radv_device.c has the specific hardware
this applies to.

We add unnecessary asserts here and I'd argue the hardware bug should
be explained when tess_offchip_block_dw_size is initialized in
radv_device.c .
On Thu, Nov 8, 2018 at 1:58 PM Samuel Pitoiset
<samuel.pitoi...@gmail.com> wrote:
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoi...@gmail.com>
> ---
>  src/amd/vulkan/radv_device.c | 17 ++++++++---------
>  1 file changed, 8 insertions(+), 9 deletions(-)
>
> diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
> index 92254bed2e..145be67c85 100644
> --- a/src/amd/vulkan/radv_device.c
> +++ b/src/amd/vulkan/radv_device.c
> @@ -2046,16 +2046,15 @@ radv_get_hs_offchip_param(struct radv_device *device, 
> uint32_t *max_offchip_buff
>         max_offchip_buffers = max_offchip_buffers_per_se *
>                 device->physical_device->rad_info.max_se;
>
> -       switch (device->tess_offchip_block_dw_size) {
> -       default:
> -               assert(0);
> -               /* fall through */
> -       case 8192:
> -               offchip_granularity = V_03093C_X_8K_DWORDS;
> -               break;
> -       case 4096:
> +       /* Hawaii has a bug with offchip buffers > 256 that can be worked
> +        * around by setting 4K granularity.
> +        */
> +       if (device->tess_offchip_block_dw_size == 4096) {
> +               assert(device->physical_device->rad_info.family == 
> CHIP_HAWAII);
>                 offchip_granularity = V_03093C_X_4K_DWORDS;
> -               break;
> +       } else {
> +               assert(device->tess_offchip_block_dw_size == 8192);
> +               offchip_granularity = V_03093C_X_8K_DWORDS;
>         }
>
>         switch (device->physical_device->rad_info.chip_class) {
> --
> 2.19.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to