Mesa (9.0): nvc0: point vertex runout at a valid address

Maarten Lankhorst mlankhorst at kemper.freedesktop.org
Tue Nov 20 18:32:29 UTC 2012


Module: Mesa
Branch: 9.0
Commit: 854b8099c3120f3b12624faccf768b2afaff88c8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=854b8099c3120f3b12624faccf768b2afaff88c8

Author: Ben Skeggs <bskeggs at redhat.com>
Date:   Mon Oct  8 10:16:49 2012 +1000

nvc0: point vertex runout at a valid address

Reviewed-by: Christoph Bumiller <e0425955 at student.tuwien.ac.at>
Signed-off-by: Ben Skeggs <bskeggs at redhat.com>
(cherry picked from commit c47a01c29cf14d11731c88bc8ed10a3f575c5a12)

---

 src/gallium/drivers/nvc0/nvc0_screen.c |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/nvc0/nvc0_screen.c b/src/gallium/drivers/nvc0/nvc0_screen.c
index eb74e95..8bb9ff6 100644
--- a/src/gallium/drivers/nvc0/nvc0_screen.c
+++ b/src/gallium/drivers/nvc0/nvc0_screen.c
@@ -589,7 +589,7 @@ nvc0_screen_create(struct nouveau_device *dev)
 
    for (i = 0; i < 5; ++i) {
       /* TIC and TSC entries for each unit (nve4+ only) */
-      /* auxiliary constants (6 user clip planes, base instance id */
+      /* auxiliary constants (6 user clip planes, base instance id) */
       BEGIN_NVC0(push, NVC0_3D(CB_SIZE), 3);
       PUSH_DATA (push, 512);
       PUSH_DATAh(push, screen->uniform_bo->offset + (5 << 16) + (i << 9));
@@ -610,6 +610,21 @@ nvc0_screen_create(struct nouveau_device *dev)
    BEGIN_NVC0(push, NVC0_3D(LINKED_TSC), 1);
    PUSH_DATA (push, 0);
 
+   /* return { 0.0, 0.0, 0.0, 0.0 } for out-of-bounds vtxbuf access */
+   BEGIN_NVC0(push, NVC0_3D(CB_SIZE), 3);
+   PUSH_DATA (push, 256);
+   PUSH_DATAh(push, screen->uniform_bo->offset + (5 << 16) + (6 << 9));
+   PUSH_DATA (push, screen->uniform_bo->offset + (5 << 16) + (6 << 9));
+   BEGIN_1IC0(push, NVC0_3D(CB_POS), 5);
+   PUSH_DATA (push, 0);
+   PUSH_DATAf(push, 0.0f);
+   PUSH_DATAf(push, 0.0f);
+   PUSH_DATAf(push, 0.0f);
+   PUSH_DATAf(push, 0.0f);
+   BEGIN_NVC0(push, NVC0_3D(VERTEX_RUNOUT_ADDRESS_HIGH), 2);
+   PUSH_DATAh(push, screen->uniform_bo->offset + (5 << 16) + (6 << 9));
+   PUSH_DATA (push, screen->uniform_bo->offset + (5 << 16) + (6 << 9));
+
    /* max MPs * max warps per MP (TODO: ask kernel) */
    if (screen->eng3d->oclass >= NVE4_3D_CLASS)
       screen->tls_size = 8 * 64;
@@ -734,10 +749,6 @@ nvc0_screen_create(struct nouveau_device *dev)
 
    IMMED_NVC0(push, NVC0_3D(EDGEFLAG), 1);
 
-   BEGIN_NVC0(push, NVC0_3D(VERTEX_RUNOUT_ADDRESS_HIGH), 2);
-   PUSH_DATA (push, 0xab);
-   PUSH_DATA (push, 0x00000000);
-
    PUSH_KICK (push);
 
    screen->tic.entries = CALLOC(4096, sizeof(void *));




More information about the mesa-commit mailing list