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 <imirkin@alum.mit.edu>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9740>
This commit is contained in:
Ilia Mirkin 2021-03-21 04:03:54 -04:00 committed by Marge Bot
parent 3e39d059df
commit ee3920b215

View file

@ -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);