freedreno: allow ctx->batch to be NULL
authorRob Clark <robdclark@chromium.org>
Tue, 4 Feb 2020 21:46:56 +0000 (13:46 -0800)
committerMarge Bot <eric+marge@anholt.net>
Tue, 4 Feb 2020 23:59:33 +0000 (23:59 +0000)
commit2c07e03b792d57ae807a6953f0d8ff5f4bcdffd0
tree97ab2a8f6f94ec9795c6a5f62ba8739fae75c8da
parent22d2cbe6856fea65bf01dc96941b5127f17dacab
freedreno: allow ctx->batch to be NULL

This was mostly true already, now that we use `fd_context_batch()` for
first access to batch in draw/clear/grid paths.  So we can drop the old
code in `batch_flush()` that tried to prevent `ctx->batch` from being
NULL.

Fixes a crash with a large number of tabs in chromium.

Cc: "20.0" mesa-stable@lists.freedesktop.org
Signed-off-by: Rob Clark <robdclark@chromium.org>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3700>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3700>
src/gallium/drivers/freedreno/freedreno_batch.c
src/gallium/drivers/freedreno/freedreno_batch_cache.c
src/gallium/drivers/freedreno/freedreno_context.c
src/gallium/drivers/freedreno/freedreno_state.c