gallium: adapt nv drivers to interface cleanups
authorRoland Scheidegger <sroland@vmware.com>
Wed, 2 Dec 2009 15:55:33 +0000 (16:55 +0100)
committerRoland Scheidegger <sroland@vmware.com>
Wed, 2 Dec 2009 15:55:33 +0000 (16:55 +0100)
13 files changed:
src/gallium/drivers/nv04/nv04_miptree.c
src/gallium/drivers/nv04/nv04_surface_2d.c
src/gallium/drivers/nv04/nv04_transfer.c
src/gallium/drivers/nv10/nv10_miptree.c
src/gallium/drivers/nv10/nv10_transfer.c
src/gallium/drivers/nv20/nv20_miptree.c
src/gallium/drivers/nv20/nv20_transfer.c
src/gallium/drivers/nv30/nv30_miptree.c
src/gallium/drivers/nv30/nv30_transfer.c
src/gallium/drivers/nv40/nv40_miptree.c
src/gallium/drivers/nv40/nv40_transfer.c
src/gallium/drivers/nv50/nv50_miptree.c
src/gallium/drivers/nv50/nv50_transfer.c

index 4fd72c82e62e879ceb09e29d45b2e6bce52e84bc..eeab6dfa30361e134e0972dceb61e692abf4c60b 100644 (file)
@@ -10,28 +10,21 @@ static void
 nv04_miptree_layout(struct nv04_miptree *nv04mt)
 {
        struct pipe_texture *pt = &nv04mt->base;
-       uint width = pt->width0, height = pt->height0;
        uint offset = 0;
        int nr_faces, l;
 
        nr_faces = 1;
 
        for (l = 0; l <= pt->last_level; l++) {
-
-               pt->nblocksx[l] = pf_get_nblocksx(&pt->block, width);
-               pt->nblocksy[l] = pf_get_nblocksy(&pt->block, height);
-               
                nv04mt->level[l].pitch = pt->width0;
                nv04mt->level[l].pitch = (nv04mt->level[l].pitch + 63) & ~63;
-
-               width  = u_minify(width, 1);
-               height = u_minify(height, 1);
        }
 
        for (l = 0; l <= pt->last_level; l++) {
-
                nv04mt->level[l].image_offset = 
                        CALLOC(nr_faces, sizeof(unsigned));
+               /* XXX guess was obviously missing */
+               nv04mt->level[l].image_offset[0] = offset;
                offset += nv04mt->level[l].pitch * u_minify(pt->height0, l);
        }
 
@@ -128,7 +121,7 @@ nv04_miptree_surface_new(struct pipe_screen *pscreen, struct pipe_texture *pt,
        ns->base.zslice = zslice;
        ns->pitch = nv04mt->level[level].pitch;
 
-       ns->base.offset = nv04mt->level[level].image_offset;
+       ns->base.offset = nv04mt->level[level].image_offset[0];
 
        return &ns->base;
 }
index 8be134b83dd8898dc8ef00f30c54c9f382c19a55..932893eef597bfc58ce0ad96338cc885e794670b 100644 (file)
@@ -155,10 +155,10 @@ nv04_surface_copy_swizzle(struct nv04_surface_2d *ctx,
            sub_w = MIN2(sub_w, w - x);
 
            /* Must be 64-byte aligned */
-           assert(!((dst->offset + nv04_swizzle_bits(dx+x, dy+y) * dst->texture->block.size) & 63));
+           assert(!((dst->offset + nv04_swizzle_bits(dx+x, dy+y) * pf_get_blocksize(dst->texture->format)) & 63));
 
            BEGIN_RING(chan, swzsurf, NV04_SWIZZLED_SURFACE_OFFSET, 1);
-           OUT_RELOCl(chan, dst_bo, dst->offset + nv04_swizzle_bits(dx+x, dy+y) * dst->texture->block.size,
+           OUT_RELOCl(chan, dst_bo, dst->offset + nv04_swizzle_bits(dx+x, dy+y) * pf_get_blocksize(dst->texture->format),
                              NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
 
            BEGIN_RING(chan, sifm, NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION, 9);
@@ -177,7 +177,7 @@ nv04_surface_copy_swizzle(struct nv04_surface_2d *ctx,
            OUT_RING  (chan, src_pitch |
                             NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_ORIGIN_CENTER |
                             NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_FILTER_POINT_SAMPLE);
-           OUT_RELOCl(chan, src_bo, src->offset + (sy+y) * src_pitch + (sx+x) * src->texture->block.size,
+           OUT_RELOCl(chan, src_bo, src->offset + (sy+y) * src_pitch + (sx+x) * pf_get_blocksize(src->texture->format),
                              NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_RD);
            OUT_RING  (chan, 0);
          }
@@ -198,9 +198,9 @@ nv04_surface_copy_m2mf(struct nv04_surface_2d *ctx,
        unsigned src_pitch = ((struct nv04_surface *)src)->pitch;
        unsigned dst_pitch = ((struct nv04_surface *)dst)->pitch;
        unsigned dst_offset = dst->offset + dy * dst_pitch +
-                             dx * dst->texture->block.size;
+                             dx * pf_get_blocksize(dst->texture->format);
        unsigned src_offset = src->offset + sy * src_pitch +
-                             sx * src->texture->block.size;
+                             sx * pf_get_blocksize(src->texture->format);
 
        WAIT_RING (chan, 3 + ((h / 2047) + 1) * 9);
        BEGIN_RING(chan, m2mf, NV04_MEMORY_TO_MEMORY_FORMAT_DMA_BUFFER_IN, 2);
@@ -219,7 +219,7 @@ nv04_surface_copy_m2mf(struct nv04_surface_2d *ctx,
                           NOUVEAU_BO_VRAM | NOUVEAU_BO_GART | NOUVEAU_BO_WR);
                OUT_RING  (chan, src_pitch);
                OUT_RING  (chan, dst_pitch);
-               OUT_RING  (chan, w * src->texture->block.size);
+               OUT_RING  (chan, w * pf_get_blocksize(src->texture->format));
                OUT_RING  (chan, count);
                OUT_RING  (chan, 0x0101);
                OUT_RING  (chan, 0);
index e6456429f4e7f4d918dfe1c0a3d3d8d3247e60a6..e8ff686b4ab16bc6148464bc80a195610df0c21f 100644 (file)
@@ -24,9 +24,6 @@ nv04_compatible_transfer_tex(struct pipe_texture *pt, unsigned level,
        template->width0 = u_minify(pt->width0, level);
        template->height0 = u_minify(pt->height0, level);
        template->depth0 = 1;
-       template->block = pt->block;
-       template->nblocksx[0] = pt->nblocksx[level];
-       template->nblocksy[0] = pt->nblocksx[level];
        template->last_level = 0;
        template->nr_samples = pt->nr_samples;
 
@@ -49,14 +46,10 @@ nv04_transfer_new(struct pipe_screen *pscreen, struct pipe_texture *pt,
                return NULL;
 
        pipe_texture_reference(&tx->base.texture, pt);
-       tx->base.format = pt->format;
        tx->base.x = x;
        tx->base.y = y;
        tx->base.width = w;
        tx->base.height = h;
-       tx->base.block = pt->block;
-       tx->base.nblocksx = pt->nblocksx[level];
-       tx->base.nblocksy = pt->nblocksy[level];
        tx->base.stride = mt->level[level].pitch;
        tx->base.usage = usage;
        tx->base.face = face;
@@ -158,7 +151,7 @@ nv04_transfer_map(struct pipe_screen *pscreen, struct pipe_transfer *ptx)
                                    pipe_transfer_buffer_flags(ptx));
 
        return map + ns->base.offset +
-              ptx->y * ns->pitch + ptx->x * ptx->block.size;
+              ptx->y * ns->pitch + ptx->x * pf_get_blocksize(ptx->texture->format);
 }
 
 static void
index b2a6c59b74921a8398599faaff5116ec7e53d519..439beeccc32c92acadb248a521a8b19a2c9bf234 100644 (file)
@@ -11,7 +11,7 @@ nv10_miptree_layout(struct nv10_miptree *nv10mt)
 {
        struct pipe_texture *pt = &nv10mt->base;
        boolean swizzled = FALSE;
-       uint width = pt->width0, height = pt->height0;
+       uint width = pt->width0;
        uint offset = 0;
        int nr_faces, l, f;
 
@@ -22,21 +22,16 @@ nv10_miptree_layout(struct nv10_miptree *nv10mt)
        }
        
        for (l = 0; l <= pt->last_level; l++) {
-
-               pt->nblocksx[l] = pf_get_nblocksx(&pt->block, width);
-               pt->nblocksy[l] = pf_get_nblocksy(&pt->block, height);
-
                if (swizzled)
-                       nv10mt->level[l].pitch = pt->nblocksx[l] * pt->block.size;
+                       nv10mt->level[l].pitch = pf_get_stride(pt->format, width);
                else
-                       nv10mt->level[l].pitch = pt->nblocksx[0] * pt->block.size;
+                       nv10mt->level[l].pitch = pf_get_stride(pt->format, pt->width0);
                nv10mt->level[l].pitch = (nv10mt->level[l].pitch + 63) & ~63;
 
                nv10mt->level[l].image_offset =
                        CALLOC(nr_faces, sizeof(unsigned));
 
                width  = u_minify(width, 1);
-               height = u_minify(height, 1);
 
        }
 
index ec54297ab01fa9de1703e5482200c0d5e5847d77..9e44d37367fe3f6850e1dcac7505cc7da5c8ed19 100644 (file)
@@ -24,9 +24,6 @@ nv10_compatible_transfer_tex(struct pipe_texture *pt, unsigned level,
        template->width0 = u_minify(pt->width0, level);
        template->height0 = u_minify(pt->height0, level);
        template->depth0 = 1;
-       template->block = pt->block;
-       template->nblocksx[0] = pt->nblocksx[level];
-       template->nblocksy[0] = pt->nblocksx[level];
        template->last_level = 0;
        template->nr_samples = pt->nr_samples;
 
@@ -49,14 +46,10 @@ nv10_transfer_new(struct pipe_screen *pscreen, struct pipe_texture *pt,
                return NULL;
 
        pipe_texture_reference(&tx->base.texture, pt);
-       tx->base.format = pt->format;
        tx->base.x = x;
        tx->base.y = y;
        tx->base.width = w;
        tx->base.height = h;
-       tx->base.block = pt->block;
-       tx->base.nblocksx = pt->nblocksx[level];
-       tx->base.nblocksy = pt->nblocksy[level];
        tx->base.stride = mt->level[level].pitch;
        tx->base.usage = usage;
        tx->base.face = face;
@@ -158,7 +151,7 @@ nv10_transfer_map(struct pipe_screen *pscreen, struct pipe_transfer *ptx)
                                    pipe_transfer_buffer_flags(ptx));
 
        return map + ns->base.offset +
-              ptx->y * ns->pitch + ptx->x * ptx->block.size;
+              ptx->y * ns->pitch + ptx->x * pf_get_blocksize(ptx->texture->format);
 }
 
 static void
index 554e28e47ddff7b09b076fdc9af6d1a3d6123f30..2bde9fb75bcfc7abb85c571f4cdef5cfec782b1f 100644 (file)
@@ -10,7 +10,7 @@ static void
 nv20_miptree_layout(struct nv20_miptree *nv20mt)
 {
        struct pipe_texture *pt = &nv20mt->base;
-       uint width = pt->width0, height = pt->height0;
+       uint width = pt->width0;
        uint offset = 0;
        int nr_faces, l, f;
        uint wide_pitch = pt->tex_usage & (PIPE_TEXTURE_USAGE_SAMPLER |
@@ -26,19 +26,15 @@ nv20_miptree_layout(struct nv20_miptree *nv20mt)
        }
        
        for (l = 0; l <= pt->last_level; l++) {
-               pt->nblocksx[l] = pf_get_nblocksx(&pt->block, width);
-               pt->nblocksy[l] = pf_get_nblocksy(&pt->block, height);
-
                if (wide_pitch && (pt->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR))
-                       nv20mt->level[l].pitch = align(pt->width0 * pt->block.size, 64);
+                       nv20mt->level[l].pitch = align(pf_get_stride(pt->format, pt->width0), 64);
                else
-                       nv20mt->level[l].pitch = u_minify(pt->width0, l) * pt->block.size;
+                       nv20mt->level[l].pitch = pf_get_stride(pt->format, width);
 
                nv20mt->level[l].image_offset =
                        CALLOC(nr_faces, sizeof(unsigned));
 
                width  = u_minify(width, 1);
-               height = u_minify(height, 1);
        }
 
        for (f = 0; f < nr_faces; f++) {
index 87b5c14a3c23ad4f58b12a142cc4ee7364897767..f2e0a34db9f4882f21f315529b75fc9e31a51964 100644 (file)
@@ -24,9 +24,6 @@ nv20_compatible_transfer_tex(struct pipe_texture *pt, unsigned level,
        template->width0 = u_minify(pt->width0, level);
        template->height0 = u_minify(pt->height0, level);
        template->depth0 = 1;
-       template->block = pt->block;
-       template->nblocksx[0] = pt->nblocksx[level];
-       template->nblocksy[0] = pt->nblocksx[level];
        template->last_level = 0;
        template->nr_samples = pt->nr_samples;
 
@@ -49,14 +46,10 @@ nv20_transfer_new(struct pipe_screen *pscreen, struct pipe_texture *pt,
                return NULL;
 
        pipe_texture_reference(&tx->base.texture, pt);
-       tx->base.format = pt->format;
        tx->base.x = x;
        tx->base.y = y;
        tx->base.width = w;
        tx->base.height = h;
-       tx->base.block = pt->block;
-       tx->base.nblocksx = pt->nblocksx[level];
-       tx->base.nblocksy = pt->nblocksy[level];
        tx->base.stride = mt->level[level].pitch;
        tx->base.usage = usage;
        tx->base.face = face;
@@ -158,7 +151,7 @@ nv20_transfer_map(struct pipe_screen *pscreen, struct pipe_transfer *ptx)
                                    pipe_transfer_buffer_flags(ptx));
 
        return map + ns->base.offset +
-              ptx->y * ns->pitch + ptx->x * ptx->block.size;
+              ptx->y * ns->pitch + ptx->x * pf_get_blocksize(ptx->texture->format);
 }
 
 static void
index b4c306d12721cefaa0bef7763356a874049faf4d..9e50a7cf6bff3cc0872af44b70fb7ecf63441976 100644 (file)
@@ -9,7 +9,7 @@ static void
 nv30_miptree_layout(struct nv30_miptree *nv30mt)
 {
        struct pipe_texture *pt = &nv30mt->base;
-       uint width = pt->width0, height = pt->height0, depth = pt->depth0;
+       uint width = pt->width0;
        uint offset = 0;
        int nr_faces, l, f;
        uint wide_pitch = pt->tex_usage & (PIPE_TEXTURE_USAGE_SAMPLER |
@@ -28,20 +28,15 @@ nv30_miptree_layout(struct nv30_miptree *nv30mt)
        }
 
        for (l = 0; l <= pt->last_level; l++) {
-               pt->nblocksx[l] = pf_get_nblocksx(&pt->block, width);
-               pt->nblocksy[l] = pf_get_nblocksy(&pt->block, height);
-
                if (wide_pitch && (pt->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR))
-                       nv30mt->level[l].pitch = align(pt->width0 * pt->block.size, 64);
+                       nv30mt->level[l].pitch = align(pf_get_stride(pt->format, pt->width0), 64);
                else
-                       nv30mt->level[l].pitch = u_minify(pt->width0, l) * pt->block.size;
+                       nv30mt->level[l].pitch = pf_get_stride(pt->format, width);
 
                nv30mt->level[l].image_offset =
                        CALLOC(nr_faces, sizeof(unsigned));
 
                width  = u_minify(width, 1);
-               height = u_minify(height, 1);
-               depth  = u_minify(depth, 1);
        }
 
        for (f = 0; f < nr_faces; f++) {
index 5e429b4d85c9adf059d30d214dc7b86f959084eb..c8c3bd1f177430c9fedf32c7fb3fa683dec6f6a1 100644 (file)
@@ -24,9 +24,6 @@ nv30_compatible_transfer_tex(struct pipe_texture *pt, unsigned level,
        template->width0 = u_minify(pt->width0, level);
        template->height0 = u_minify(pt->height0, level);
        template->depth0 = 1;
-       template->block = pt->block;
-       template->nblocksx[0] = pt->nblocksx[level];
-       template->nblocksy[0] = pt->nblocksx[level];
        template->last_level = 0;
        template->nr_samples = pt->nr_samples;
 
@@ -49,14 +46,10 @@ nv30_transfer_new(struct pipe_screen *pscreen, struct pipe_texture *pt,
                return NULL;
 
        pipe_texture_reference(&tx->base.texture, pt);
-       tx->base.format = pt->format;
        tx->base.x = x;
        tx->base.y = y;
        tx->base.width = w;
        tx->base.height = h;
-       tx->base.block = pt->block;
-       tx->base.nblocksx = pt->nblocksx[level];
-       tx->base.nblocksy = pt->nblocksy[level];
        tx->base.stride = mt->level[level].pitch;
        tx->base.usage = usage;
        tx->base.face = face;
@@ -158,7 +151,7 @@ nv30_transfer_map(struct pipe_screen *pscreen, struct pipe_transfer *ptx)
                                    pipe_transfer_buffer_flags(ptx));
 
        return map + ns->base.offset +
-              ptx->y * ns->pitch + ptx->x * ptx->block.size;
+              ptx->y * ns->pitch + ptx->x * pf_get_blocksize(ptx->texture->format);
 }
 
 static void
index f73bedff6d8b9545cc231737707bace321334a18..8779c5572b97f77e215986ba11ad4fccb0e6f8b8 100644 (file)
@@ -9,7 +9,7 @@ static void
 nv40_miptree_layout(struct nv40_miptree *mt)
 {
        struct pipe_texture *pt = &mt->base;
-       uint width = pt->width0, height = pt->height0, depth = pt->depth0;
+       uint width = pt->width0;
        uint offset = 0;
        int nr_faces, l, f;
        uint wide_pitch = pt->tex_usage & (PIPE_TEXTURE_USAGE_SAMPLER |
@@ -28,20 +28,15 @@ nv40_miptree_layout(struct nv40_miptree *mt)
        }
 
        for (l = 0; l <= pt->last_level; l++) {
-               pt->nblocksx[l] = pf_get_nblocksx(&pt->block, width);
-               pt->nblocksy[l] = pf_get_nblocksy(&pt->block, height);
-
                if (wide_pitch && (pt->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR))
-                       mt->level[l].pitch = align(pt->width0 * pt->block.size, 64);
+                       mt->level[l].pitch = align(pf_get_stride(pt->format, pt->width0), 64);
                else
-                       mt->level[l].pitch = u_minify(pt->width0, l) * pt->block.size;
+                       mt->level[l].pitch = pf_get_stride(pt->format, width);
 
                mt->level[l].image_offset =
                        CALLOC(nr_faces, sizeof(unsigned));
 
                width  = u_minify(width, 1);
-               height = u_minify(height, 1);
-               depth  = u_minify(depth, 1);
        }
 
        for (f = 0; f < nr_faces; f++) {
index 36e253c96f99e3a7fb7538fcb10f5963b6d0f702..1ee5cf39e011d39625beaecc130aa2610cf8ddeb 100644 (file)
@@ -24,9 +24,6 @@ nv40_compatible_transfer_tex(struct pipe_texture *pt, unsigned level,
        template->width0 = u_minify(pt->width0, level);
        template->height0 = u_minify(pt->height0, level);
        template->depth0 = 1;
-       template->block = pt->block;
-       template->nblocksx[0] = pt->nblocksx[level];
-       template->nblocksy[0] = pt->nblocksx[level];
        template->last_level = 0;
        template->nr_samples = pt->nr_samples;
 
@@ -49,14 +46,10 @@ nv40_transfer_new(struct pipe_screen *pscreen, struct pipe_texture *pt,
                return NULL;
 
        pipe_texture_reference(&tx->base.texture, pt);
-       tx->base.format = pt->format;
        tx->base.x = x;
        tx->base.y = y;
        tx->base.width = w;
        tx->base.height = h;
-       tx->base.block = pt->block;
-       tx->base.nblocksx = pt->nblocksx[level];
-       tx->base.nblocksy = pt->nblocksy[level];
        tx->base.stride = mt->level[level].pitch;
        tx->base.usage = usage;
        tx->base.face = face;
@@ -158,7 +151,7 @@ nv40_transfer_map(struct pipe_screen *pscreen, struct pipe_transfer *ptx)
                                    pipe_transfer_buffer_flags(ptx));
 
        return map + ns->base.offset +
-              ptx->y * ns->pitch + ptx->x * ptx->block.size;
+              ptx->y * ns->pitch + ptx->x * pf_get_blocksize(ptx->texture->format);
 }
 
 static void
index 3d58746793f76549cc8fb04e0ec16abc8959b96d..40ee6659993b566439eb62d1c3ecda3eeb3e0669 100644 (file)
@@ -91,13 +91,11 @@ nv50_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *tmp)
 
        for (l = 0; l <= pt->last_level; l++) {
                struct nv50_miptree_level *lvl = &mt->level[l];
-
-               pt->nblocksx[l] = pf_get_nblocksx(&pt->block, width);
-               pt->nblocksy[l] = pf_get_nblocksy(&pt->block, height);
+               unsigned nblocksy = pf_get_nblocksy(pt->format, height);
 
                lvl->image_offset = CALLOC(mt->image_nr, sizeof(int));
-               lvl->pitch = align(pt->nblocksx[l] * pt->block.size, 64);
-               lvl->tile_mode = get_tile_mode(pt->nblocksy[l], depth);
+               lvl->pitch = align(pf_get_stride(pt->format, width), 64);
+               lvl->tile_mode = get_tile_mode(nblocksy, depth);
 
                width = u_minify(width, 1);
                height = u_minify(height, 1);
@@ -118,7 +116,7 @@ nv50_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *tmp)
                        unsigned tile_d = get_tile_depth(lvl->tile_mode);
 
                        size  = lvl->pitch;
-                       size *= align(pt->nblocksy[l], tile_h);
+                       size *= align(pf_get_nblocksy(pt->format, u_minify(pt->height0, l)), tile_h);
                        size *= align(u_minify(pt->depth0, l), tile_d);
 
                        lvl->image_offset[i] = mt->total_size;
index 39d65279fc05005edd3e0886784942de793f86b6..4705f96f57284374b995aa57cd6d88984d0acb0c 100644 (file)
@@ -16,6 +16,8 @@ struct nv50_transfer {
        int level_depth;
        int level_x;
        int level_y;
+       unsigned nblocksx;
+       unsigned nblocksy;
 };
 
 static void
@@ -151,20 +153,11 @@ nv50_transfer_new(struct pipe_screen *pscreen, struct pipe_texture *pt,
                return NULL;
 
        pipe_texture_reference(&tx->base.texture, pt);
-       tx->base.format = pt->format;
+       tx->nblocksx = pf_get_nblocksx(pt->format, u_minify(pt->width0, level));
+       tx->nblocksy = pf_get_nblocksy(pt->format, u_minify(pt->height0, level));
        tx->base.width = w;
        tx->base.height = h;
-       tx->base.block = pt->block;
-       if (!pt->nblocksx[level]) {
-               tx->base.nblocksx = pf_get_nblocksx(&pt->block,
-                                                   u_minify(pt->width0, level));
-               tx->base.nblocksy = pf_get_nblocksy(&pt->block,
-                                                   u_minify(pt->height0, level));
-       } else {
-               tx->base.nblocksx = pt->nblocksx[level];
-               tx->base.nblocksy = pt->nblocksy[level];
-       }
-       tx->base.stride = tx->base.nblocksx * pt->block.size;
+       tx->base.stride = tx->nblocksx * pf_get_blocksize(pt->format);
        tx->base.usage = usage;
 
        tx->level_pitch = lvl->pitch;
@@ -173,10 +166,10 @@ nv50_transfer_new(struct pipe_screen *pscreen, struct pipe_texture *pt,
        tx->level_depth = u_minify(mt->base.base.depth0, level);
        tx->level_offset = lvl->image_offset[image];
        tx->level_tiling = lvl->tile_mode;
-       tx->level_x = pf_get_nblocksx(&tx->base.block, x);
-       tx->level_y = pf_get_nblocksy(&tx->base.block, y);
+       tx->level_x = pf_get_nblocksx(pt->format, x);
+       tx->level_y = pf_get_nblocksy(pt->format, y);
        ret = nouveau_bo_new(dev, NOUVEAU_BO_GART | NOUVEAU_BO_MAP, 0,
-                            tx->base.nblocksy * tx->base.stride, &tx->bo);
+                            tx->nblocksy * tx->base.stride, &tx->bo);
        if (ret) {
                FREE(tx);
                return NULL;
@@ -185,22 +178,22 @@ nv50_transfer_new(struct pipe_screen *pscreen, struct pipe_texture *pt,
        if (pt->target == PIPE_TEXTURE_3D)
                tx->level_offset += get_zslice_offset(lvl->tile_mode, zslice,
                                                      lvl->pitch,
-                                                     tx->base.nblocksy);
+                                                     tx->nblocksy);
 
        if (usage & PIPE_TRANSFER_READ) {
-               nx = pf_get_nblocksx(&tx->base.block, tx->base.width);
-               ny = pf_get_nblocksy(&tx->base.block, tx->base.height);
+               nx = pf_get_nblocksx(pt->format, tx->base.width);
+               ny = pf_get_nblocksy(pt->format, tx->base.height);
 
                nv50_transfer_rect_m2mf(pscreen, mt->base.bo, tx->level_offset,
                                        tx->level_pitch, tx->level_tiling,
                                        x, y,
-                                       tx->base.nblocksx, tx->base.nblocksy,
+                                       tx->nblocksx, tx->nblocksy,
                                        tx->level_depth,
                                        tx->bo, 0,
                                        tx->base.stride, tx->bo->tile_mode,
                                        0, 0,
-                                       tx->base.nblocksx, tx->base.nblocksy, 1,
-                                       tx->base.block.size, nx, ny,
+                                       tx->nblocksx, tx->nblocksy, 1,
+                                       pf_get_blocksize(pt->format), nx, ny,
                                        NOUVEAU_BO_VRAM | NOUVEAU_BO_GART,
                                        NOUVEAU_BO_GART);
        }
@@ -213,23 +206,24 @@ nv50_transfer_del(struct pipe_transfer *ptx)
 {
        struct nv50_transfer *tx = (struct nv50_transfer *)ptx;
        struct nv50_miptree *mt = nv50_miptree(ptx->texture);
+       struct pipe_texture *pt = ptx->texture;
 
-       unsigned nx = pf_get_nblocksx(&tx->base.block, tx->base.width);
-       unsigned ny = pf_get_nblocksy(&tx->base.block, tx->base.height);
+       unsigned nx = pf_get_nblocksx(pt->format, tx->base.width);
+       unsigned ny = pf_get_nblocksy(pt->format, tx->base.height);
 
        if (ptx->usage & PIPE_TRANSFER_WRITE) {
-               struct pipe_screen *pscreen = ptx->texture->screen;
+               struct pipe_screen *pscreen = pt->screen;
 
                nv50_transfer_rect_m2mf(pscreen, tx->bo, 0,
                                        tx->base.stride, tx->bo->tile_mode,
                                        0, 0,
-                                       tx->base.nblocksx, tx->base.nblocksy, 1,
+                                       tx->nblocksx, tx->nblocksy, 1,
                                        mt->base.bo, tx->level_offset,
                                        tx->level_pitch, tx->level_tiling,
                                        tx->level_x, tx->level_y,
-                                       tx->base.nblocksx, tx->base.nblocksy,
+                                       tx->nblocksx, tx->nblocksy,
                                        tx->level_depth,
-                                       tx->base.block.size, nx, ny,
+                                       pf_get_blocksize(pt->format), nx, ny,
                                        NOUVEAU_BO_GART, NOUVEAU_BO_VRAM |
                                        NOUVEAU_BO_GART);
        }