etnaviv: handle NULL views in set_sampler_views
authorChristian Gmeiner <christian.gmeiner@gmail.com>
Sat, 23 Jan 2021 15:15:38 +0000 (16:15 +0100)
committerMarge Bot <eric+marge@anholt.net>
Mon, 25 Jan 2021 20:42:22 +0000 (20:42 +0000)
commit81ab9fe2d0c2c2d9961107c88209f2fff1f136c4
treef0b8f2f457897710947bfdeba9d6123b9d612a48
parentf180bf3e032264e10936eb64dede9d15ce785511
etnaviv: handle NULL views in set_sampler_views

Passing NULL for the views parameter should be the same as passing an
array of NULL, according to the documentation. So let's respect that
detail.

This fixes a crash when using GALLIUM_HUD. The wrong handling of views
parameter was causing problems starting with
2813688f8db ("gallium/hud: don't use cso_context to restore VBs, constbuf 0 and sampler views").

Cc: <mesa-stable@lists.freedesktop.org>
Fixes: c9e8b49b885 ("etnaviv: gallium driver for Vivante GPUs")
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8670>
src/gallium/drivers/etnaviv/etnaviv_texture.c