Skip to contentSkip to conversation

nv50, nvc0: unlock tic and update address when invalidating resource

PATCH New Ilia Mirkin 1 participant 1 message Sep 15, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nv50, nvc0: unlock tic and update address when invalidating resource

When updating texture buffers, we might end up replacing the whole buffer. When the resource is invalidated, we never actually recreate the sampler view, so we have to make sure that it gets reuploaded, and that it gets the proper new address.

This fixes arb_direct_state_access-texture-buffer.

---
 src/gallium/drivers/nouveau/nv50/nv50_context.c | 6 ++++++
 src/gallium/drivers/nouveau/nvc0/nvc0_context.c | 6 ++++++
 2 files changed, 12 insertions(+)
src/gallium/drivers/nouveau/nv50/nv50_context.c +6 -0
index 4108f48..fadb812 100644
@@ -212,8 +212,14 @@ nv50_invalidate_resource_storage(struct nouveau_context *ctx,
       for (i = 0; i < nv50->num_textures[s]; ++i) {
          if (nv50->textures[s][i] &&
              nv50->textures[s][i]->texture == res) {
+            struct nv50_tic_entry *tic = nv50_tic_entry(nv50->textures[s][i]);
             nv50->dirty |= NV50_NEW_TEXTURES;
             nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_TEXTURES);
+            nv50_screen_tic_unlock(nv50->screen, tic);
+            tic->id = -1;
+            tic->tic[1] = nv04_resource(res)->address;
+            tic->tic[2] &= 0xffffff00;
+            tic->tic[2] |= nv04_resource(res)->address >> 32;
             if (!--ref)
                return ref;
          }
src/gallium/drivers/nouveau/nvc0/nvc0_context.c +6 -0
index f7604f1..e6d2700 100644
@@ -229,9 +229,15 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx,
       for (i = 0; i < nvc0->num_textures[s]; ++i) {
          if (nvc0->textures[s][i] &&
              nvc0->textures[s][i]->texture == res) {
+            struct nv50_tic_entry *tic = nv50_tic_entry(nvc0->textures[s][i]);
             nvc0->textures_dirty[s] |= 1 << i;
             nvc0->dirty |= NVC0_NEW_TEXTURES;
             nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_TEX(s, i));
+            nvc0_screen_tic_unlock(nvc0->screen, tic);
+            tic->id = -1;
+            tic->tic[1] = nv04_resource(res)->address;
+            tic->tic[2] &= 0xffffff00;
+            tic->tic[2] |= nv04_resource(res)->address >> 32;
             if (!--ref)
                return ref;
          }
Signature · 6 lines
2.4.6

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau