From ee3920b215a4802cdc1045655ea6d95fcbccb8be Mon Sep 17 00:00:00 2001 From: Ilia Mirkin Date: Sun, 21 Mar 2021 04:03:54 -0400 Subject: [PATCH] nv50: add appropriate space check before adding new pushbuffer nouveau_pushbuf_data does not check that there are available pushes in the current batch. So add a space check for this. Avoids crashes with the HUD and glxspheres. Signed-off-by: Ilia Mirkin Reviewed-by: Karol Herbst Part-of: --- src/gallium/drivers/nouveau/nv50/nv50_compute.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gallium/drivers/nouveau/nv50/nv50_compute.c b/src/gallium/drivers/nouveau/nv50/nv50_compute.c index 1a78a371405..95fa696a086 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_compute.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_compute.c @@ -216,6 +216,8 @@ nv50_compute_upload_input(struct nv50_context *nv50, const uint32_t *input) nouveau_pushbuf_bufctx(push, nv50->bufctx); nouveau_pushbuf_validate(push); + nouveau_pushbuf_space(push, 0, 0, 1); + BEGIN_NV04(push, NV50_CP(USER_PARAM(0)), size / 4); nouveau_pushbuf_data(push, bo, offset, size);