diff options
author | Ilia Mirkin <imirkin@alum.mit.edu> | 2015-06-21 19:03:35 -0400 |
---|---|---|
committer | Emil Velikov <emil.l.velikov@gmail.com> | 2015-07-01 15:22:39 +0100 |
commit | 36250def23c31b02b7bf55785fab2c2644d0a52f (patch) | |
tree | 805896c26bf99ba184b56aad0abb151b4c57fb43 | |
parent | 8bcc8f4b480a7eb261e950af5c76f74c34c59abf (diff) |
nv50,nvc0: make sure to pushbuf_refn before putting bo into pushbuf_data
Without first running the bo through pushbuf_refn, the nouveau drm
library will have uninitialized structures regarding this bo, and will
insert incorrect data.
This fixes supertuxkart 0.9 crash on start (where it ends up doing a lot
of indirect draws).
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 78d58e642549fbf340fdb4fca06720d2891216a8)
-rw-r--r-- | src/gallium/drivers/nouveau/nv50/nv50_query.c | 1 | ||||
-rw-r--r-- | src/gallium/drivers/nouveau/nv50/nv50_vbo.c | 1 | ||||
-rw-r--r-- | src/gallium/drivers/nouveau/nvc0/nvc0_query.c | 1 | ||||
-rw-r--r-- | src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c | 1 |
4 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_query.c b/src/gallium/drivers/nouveau/nv50/nv50_query.c index c867bca1dfe..67a36e1af9d 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_query.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_query.c @@ -406,6 +406,7 @@ nv50_query_pushbuf_submit(struct nouveau_pushbuf *push, /* XXX: does this exist ? */ #define NV50_IB_ENTRY_1_NO_PREFETCH (0 << (31 - 8)) + PUSH_REFN(push, q->bo, NOUVEAU_BO_RD | NOUVEAU_BO_GART); nouveau_pushbuf_space(push, 0, 0, 1); nouveau_pushbuf_data(push, q->bo, q->offset + result_offset, 4 | NV50_IB_ENTRY_1_NO_PREFETCH); diff --git a/src/gallium/drivers/nouveau/nv50/nv50_vbo.c b/src/gallium/drivers/nouveau/nv50/nv50_vbo.c index c1590eefe9f..1fd33b8aa59 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_vbo.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_vbo.c @@ -628,6 +628,7 @@ nv50_draw_elements(struct nv50_context *nv50, boolean shorten, BEGIN_NV04(push, NV50_3D(VERTEX_BEGIN_GL), 1); PUSH_DATA (push, prim); + PUSH_REFN(push, buf->bo, NOUVEAU_BO_RD | buf->domain); nouveau_pushbuf_space(push, 8, 0, 1); switch (index_size) { diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_query.c b/src/gallium/drivers/nouveau/nvc0/nvc0_query.c index 3a6df9dcf87..8a87b00d8db 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_query.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_query.c @@ -610,6 +610,7 @@ nvc0_query_pushbuf_submit(struct nouveau_pushbuf *push, #define NVC0_IB_ENTRY_1_NO_PREFETCH (1 << (31 - 8)) + PUSH_REFN(push, q->bo, NOUVEAU_BO_RD | NOUVEAU_BO_GART); nouveau_pushbuf_space(push, 0, 0, 1); nouveau_pushbuf_data(push, q->bo, q->offset + result_offset, 4 | NVC0_IB_ENTRY_1_NO_PREFETCH); diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c b/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c index 657b8c0fe82..8cf2584b0ce 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c @@ -829,6 +829,7 @@ nvc0_draw_indirect(struct nvc0_context *nvc0, const struct pipe_draw_info *info) } PUSH_DATA(push, nvc0_prim_gl(info->mode)); #define NVC0_IB_ENTRY_1_NO_PREFETCH (1 << (31 - 8)) + PUSH_REFN(push, buf->bo, NOUVEAU_BO_RD | buf->domain); nouveau_pushbuf_space(push, 0, 0, 1); nouveau_pushbuf_data(push, buf->bo, offset, NVC0_IB_ENTRY_1_NO_PREFETCH | size); |