pan/blit: Fix a NULL dereference in the preload path

The ZS view can be NULL if a stencil-only buffer is attached to the FB.

Fixes: 1de393fec5 ("panfrost: Fix ZS reloading on Bifrost v6")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12095>
This commit is contained in:
Boris Brezillon 2021-05-19 10:56:49 +02:00
parent 2dd13257c8
commit 9f4dab0f2d

View file

@ -1132,7 +1132,9 @@ pan_preload_emit_pre_frame_dcd(struct pan_pool *desc_pool,
pan_preload_emit_dcd(desc_pool, fb, zs, coords, tsd, rsd, dcd, always_write);
if (zs) {
enum pipe_format fmt = fb->zs.view.zs->image->layout.format;
enum pipe_format fmt = fb->zs.view.zs ?
fb->zs.view.zs->image->layout.format :
fb->zs.view.s->image->layout.format;
bool always = false;
/* If we're dealing with a combined ZS resource and only one