summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nv30
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2008-06-29 13:26:04 +1000
committerBen Skeggs <skeggsb@gmail.com>2008-06-29 15:00:28 +1000
commitb6478021d572d9ec30212d6e6992496ee4cf347d (patch)
tree99fd64089ed7dff15f5a6a7c60c17f4bad3a3e45 /src/gallium/drivers/nv30
parentcc8e628563a1cfb26752bc014a75f3087cd8986d (diff)
nouveau: adapt to cpp->pf_block changes
Diffstat (limited to 'src/gallium/drivers/nv30')
-rw-r--r--src/gallium/drivers/nv30/nv30_miptree.c10
-rw-r--r--src/gallium/drivers/nv30/nv30_state.c10
-rw-r--r--src/gallium/drivers/nv30/nv30_state_fb.c8
3 files changed, 16 insertions, 12 deletions
diff --git a/src/gallium/drivers/nv30/nv30_miptree.c b/src/gallium/drivers/nv30/nv30_miptree.c
index 6078b1865e..ad0b257fe2 100644
--- a/src/gallium/drivers/nv30/nv30_miptree.c
+++ b/src/gallium/drivers/nv30/nv30_miptree.c
@@ -28,12 +28,14 @@ nv30_miptree_layout(struct nv30_miptree *nv30mt)
pt->width[l] = width;
pt->height[l] = height;
pt->depth[l] = depth;
+ pt->nblocksx[l] = pf_get_nblocksx(&pt->block, width);
+ pt->nblocksy[l] = pf_get_nblocksy(&pt->block, height);
if (swizzled)
pitch = pt->width[l];
pitch = (pitch + 63) & ~63;
- nv30mt->level[l].pitch = pitch * pt->cpp;
+ nv30mt->level[l].pitch = pitch * pt->block.size;
nv30mt->level[l].image_offset =
CALLOC(nr_faces, sizeof(unsigned));
@@ -114,10 +116,12 @@ nv30_miptree_surface_new(struct pipe_screen *pscreen, struct pipe_texture *pt,
return NULL;
pipe_buffer_reference(ws, &ps->buffer, nv30mt->buffer);
ps->format = pt->format;
- ps->cpp = pt->cpp;
ps->width = pt->width[level];
ps->height = pt->height[level];
- ps->pitch = nv30mt->level[level].pitch / ps->cpp;
+ ps->nblocksx = pt->nblocksx[level];
+ ps->nblocksy = pt->nblocksy[level];
+ ps->block = pt->block;
+ ps->stride = nv30mt->level[level].pitch;
if (pt->target == PIPE_TEXTURE_CUBE) {
ps->offset = nv30mt->level[level].image_offset[face];
diff --git a/src/gallium/drivers/nv30/nv30_state.c b/src/gallium/drivers/nv30/nv30_state.c
index 84f016eead..c1618041bb 100644
--- a/src/gallium/drivers/nv30/nv30_state.c
+++ b/src/gallium/drivers/nv30/nv30_state.c
@@ -631,21 +631,21 @@ nv30_set_framebuffer_state(struct pipe_context *pipe,
}
if (rt_enable & NV34TCL_RT_ENABLE_COLOR0) {
- uint32_t pitch = rt[0]->pitch * rt[0]->cpp;
+ uint32_t pitch = rt[0]->stride;
if (zeta) {
- pitch |= (zeta->pitch * zeta->cpp)<<16;
+ pitch |= (zeta->stride << 16);
} else {
- pitch |= pitch<<16;
+ pitch |= (pitch << 16);
}
BEGIN_RING(rankine, NV34TCL_COLOR0_PITCH, 1);
- OUT_RING ( pitch );
+ OUT_RING (pitch);
nv30->rt[0] = rt[0]->buffer;
}
if (rt_enable & NV34TCL_RT_ENABLE_COLOR1) {
BEGIN_RING(rankine, NV34TCL_COLOR1_PITCH, 1);
- OUT_RING (rt[1]->pitch * rt[1]->cpp);
+ OUT_RING (rt[1]->stride);
nv30->rt[1] = rt[1]->buffer;
}
diff --git a/src/gallium/drivers/nv30/nv30_state_fb.c b/src/gallium/drivers/nv30/nv30_state_fb.c
index 73c97e298a..a20df9f75d 100644
--- a/src/gallium/drivers/nv30/nv30_state_fb.c
+++ b/src/gallium/drivers/nv30/nv30_state_fb.c
@@ -59,11 +59,11 @@ nv30_state_framebuffer_validate(struct nv30_context *nv30)
}
if (rt_enable & NV34TCL_RT_ENABLE_COLOR0) {
- uint32_t pitch = rt[0]->pitch * rt[0]->cpp;
+ uint32_t pitch = rt[0]->stride;
if (zeta) {
- pitch |= (zeta->pitch * zeta->cpp)<<16;
+ pitch |= (zeta->stride << 16);
} else {
- pitch |= pitch<<16;
+ pitch |= (pitch << 16);
}
so_method(so, nv30->screen->rankine, NV34TCL_DMA_COLOR0, 1);
@@ -84,7 +84,7 @@ nv30_state_framebuffer_validate(struct nv30_context *nv30)
so_method(so, nv30->screen->rankine, NV34TCL_COLOR1_OFFSET, 2);
so_reloc (so, rt[1]->buffer, rt[1]->offset, rt_flags |
NOUVEAU_BO_LOW, 0, 0);
- so_data (so, rt[1]->pitch * rt[1]->cpp);
+ so_data (so, rt[1]->stride);
}
/*
if (rt_enable & NV34TCL_RT_ENABLE_COLOR2) {