nouveau: Work around nv04-nv40 miptrees not matching nouveau_miptree.
authorYounes Manton <younes.m@gmail.com>
Sun, 6 Dec 2009 17:26:55 +0000 (12:26 -0500)
committerYounes Manton <younes.m@gmail.com>
Sun, 6 Dec 2009 17:34:27 +0000 (12:34 -0500)
Thanks to Bob Gleitsmann for the patch.

I'll clean this up in a better way later if noone else beats me to it.

src/gallium/drivers/nv04/nv04_miptree.c
src/gallium/drivers/nv04/nv04_state.h
src/gallium/drivers/nv10/nv10_miptree.c
src/gallium/drivers/nv10/nv10_state.h
src/gallium/drivers/nv20/nv20_miptree.c
src/gallium/drivers/nv20/nv20_state.h
src/gallium/drivers/nv30/nv30_miptree.c
src/gallium/drivers/nv30/nv30_state.h
src/gallium/drivers/nv40/nv40_miptree.c
src/gallium/drivers/nv40/nv40_state.h

index eeab6dfa30361e134e0972dceb61e692abf4c60b..e0a6948aeb45eef0017ca1e0d87c1716048646c8 100644 (file)
@@ -55,7 +55,7 @@ nv04_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt)
                FREE(mt);
                return NULL;
        }
-       
+       mt->bo = nouveau_bo(mt->buffer);
        return &mt->base;
 }
 
@@ -81,6 +81,7 @@ nv04_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt,
        mt->level[0].image_offset = CALLOC(1, sizeof(unsigned));
 
        pipe_buffer_reference(&mt->buffer, pb);
+       mt->bo = nouveau_bo(mt->buffer);
        return &mt->base;
 }
 
index 399f750dbe7caf4de1d33036b2704aa297fc81d7..81d1d2ebaa94a034c9dba060527403b765a29e22 100644 (file)
@@ -31,6 +31,7 @@ struct nv04_rasterizer_state {
 
 struct nv04_miptree {
        struct pipe_texture base;
+       struct nouveau_bo *bo;
 
        struct pipe_buffer *buffer;
        uint total_size;
index 439beeccc32c92acadb248a521a8b19a2c9bf234..6a52b6af362f498688facf2edaa12070a3fff015 100644 (file)
@@ -67,6 +67,7 @@ nv10_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt,
        mt->level[0].image_offset = CALLOC(1, sizeof(unsigned));
 
        pipe_buffer_reference(&mt->buffer, pb);
+       mt->bo = nouveau_bo(mt->buffer);
        return &mt->base;
 }
 
@@ -90,6 +91,7 @@ nv10_miptree_create(struct pipe_screen *screen, const struct pipe_texture *pt)
                FREE(mt);
                return NULL;
        }
+       mt->bo = nouveau_bo(mt->buffer);
        
        return &mt->base;
 }
index 3a3fd0d4f4f01f151ceaa00d975c7813d4bf02f0..2524ac02e29d95bb39cbc4879eb894a84e18456c 100644 (file)
@@ -126,6 +126,7 @@ struct nv10_depth_stencil_alpha_state {
 
 struct nv10_miptree {
        struct pipe_texture base;
+       struct nouveau_bo *bo;
 
        struct pipe_buffer *buffer;
        uint total_size;
index 2bde9fb75bcfc7abb85c571f4cdef5cfec782b1f..e2e01bd849b29286acbe0fd9296d1cc8fcfe6179 100644 (file)
@@ -77,6 +77,7 @@ nv20_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt,
        mt->level[0].image_offset = CALLOC(1, sizeof(unsigned));
 
        pipe_buffer_reference(&mt->buffer, pb);
+       mt->bo = nouveau_bo(mt->buffer);
        return &mt->base;
 }
 
@@ -132,6 +133,7 @@ nv20_miptree_create(struct pipe_screen *screen, const struct pipe_texture *pt)
                FREE(mt);
                return NULL;
        }
+       mt->bo = nouveau_bo(mt->buffer);
        
        return &mt->base;
 }
index 34f402fdcbf4140c74bb335109218287bf08533c..dde41065685d6186a0d1644ee30787116d1de4c8 100644 (file)
@@ -126,6 +126,7 @@ struct nv20_depth_stencil_alpha_state {
 
 struct nv20_miptree {
        struct pipe_texture base;
+       struct nouveau_bo *bo;
 
        struct pipe_buffer *buffer;
        uint total_size;
index 9e50a7cf6bff3cc0872af44b70fb7ecf63441976..920fe64c32f804ec51746dd63294146db4d9fb10 100644 (file)
@@ -115,6 +115,7 @@ nv30_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt)
                FREE(mt);
                return NULL;
        }
+       mt->bo = nouveau_bo(mt->buffer);
 
        return &mt->base;
 }
@@ -144,6 +145,7 @@ nv30_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt,
        mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR;
 
        pipe_buffer_reference(&mt->buffer, pb);
+       mt->bo = nouveau_bo(mt->buffer);
        return &mt->base;
 }
 
index e6f23bf166715c2fbcaf4e03d994212d6d74f2b9..e42e872de757257f3c2998b8e25e09b24d87a95e 100644 (file)
@@ -72,6 +72,7 @@ struct nv30_fragment_program {
 
 struct nv30_miptree {
        struct pipe_texture base;
+       struct nouveau_bo *bo;
 
        struct pipe_buffer *buffer;
        uint total_size;
index 8779c5572b97f77e215986ba11ad4fccb0e6f8b8..89ddf373e9e20be69652f5f1738e6e015713d8ee 100644 (file)
@@ -5,6 +5,8 @@
 
 #include "nv40_context.h"
 
+
+
 static void
 nv40_miptree_layout(struct nv40_miptree *mt)
 {
@@ -109,7 +111,7 @@ nv40_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt)
                FREE(mt);
                return NULL;
        }
-
+       mt->bo = nouveau_bo(mt->buffer);
        return &mt->base;
 }
 
@@ -138,6 +140,7 @@ nv40_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt,
        mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR;
 
        pipe_buffer_reference(&mt->buffer, pb);
+       mt->bo = nouveau_bo(mt->buffer);
        return &mt->base;
 }
 
index 8a9d8c8fdf608bc409f3b157f53a2edc38ba9a18..192074e7471c8fe382e8b5f1f5f037870628cd5a 100644 (file)
@@ -75,6 +75,7 @@ struct nv40_fragment_program {
 
 struct nv40_miptree {
        struct pipe_texture base;
+       struct nouveau_bo *bo;
 
        struct pipe_buffer *buffer;
        uint total_size;