summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/nouveau
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2010-02-22 01:50:04 +0100
committerFrancisco Jerez <[email protected]>2010-02-25 18:37:35 +0100
commite59e5e3388c9561d58aa02bab20baca99ba86d15 (patch)
tree3639699dad20e4362c850ef141749a6bb76f2c05 /src/mesa/drivers/dri/nouveau
parent1e4c0618a8e5f251b68e98af498a2a8ff787cc61 (diff)
dri/nouveau: Clean up the nv04 surface code a bit.
Diffstat (limited to 'src/mesa/drivers/dri/nouveau')
-rw-r--r--src/mesa/drivers/dri/nouveau/nv04_surface.c36
1 files changed, 10 insertions, 26 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nv04_surface.c b/src/mesa/drivers/dri/nouveau/nv04_surface.c
index a219779b865..e8a5409fbde 100644
--- a/src/mesa/drivers/dri/nouveau/nv04_surface.c
+++ b/src/mesa/drivers/dri/nouveau/nv04_surface.c
@@ -216,8 +216,8 @@ nv04_surface_copy_swizzle(GLcontext *ctx,
/* If area is too large to copy in one shot we must copy it in
* POT chunks to meet alignment requirements */
- assert(sub_w == w || _mesa_is_pow_two(sub_w));
- assert(sub_h == h || _mesa_is_pow_two(sub_h));
+ assert(sub_w == w || _mesa_is_pow_two(w));
+ assert(sub_h == h || _mesa_is_pow_two(h));
nouveau_bo_marko(bctx, sifm, NV03_SCALED_IMAGE_FROM_MEMORY_DMA_IMAGE,
src->bo, bo_flags | NOUVEAU_BO_RD);
@@ -239,8 +239,6 @@ nv04_surface_copy_swizzle(GLcontext *ctx,
for (x = 0; x < w; x += sub_w) {
sub_w = MIN2(sub_w, w - x);
- /* Must be 64-byte aligned */
- assert(!(dst->offset & 63));
MARK_RING(chan, 15, 1);
@@ -277,10 +275,10 @@ nv04_surface_copy_swizzle(GLcontext *ctx,
static void
nv04_surface_copy_m2mf(GLcontext *ctx,
- struct nouveau_surface *dst,
- struct nouveau_surface *src,
- int dx, int dy, int sx, int sy,
- int w, int h)
+ struct nouveau_surface *dst,
+ struct nouveau_surface *src,
+ int dx, int dy, int sx, int sy,
+ int w, int h)
{
struct nouveau_channel *chan = context_chan(ctx);
struct nouveau_hw_state *hw = &to_nouveau_context(ctx)->hw;
@@ -484,34 +482,20 @@ nv04_surface_init(GLcontext *ctx)
OUT_RING (chan, NV04_GDI_RECTANGLE_TEXT_MONOCHROME_FORMAT_LE);
/* Swizzled surface. */
- switch (context_chipset(ctx) & 0xf0) {
- case 0x00:
- case 0x10:
+ if (context_chipset(ctx) < 0x20)
class = NV04_SWIZZLED_SURFACE;
- break;
- case 0x20:
+ else
class = NV20_SWIZZLED_SURFACE;
- break;
- default:
- /* Famous last words: this really can't happen.. */
- assert(0);
- break;
- }
ret = nouveau_grobj_alloc(chan, handle++, class, &hw->swzsurf);
if (ret)
goto fail;
/* Scaled image from memory. */
- switch (context_chipset(ctx) & 0xf0) {
- case 0x00:
+ if (context_chipset(ctx) < 0x10)
class = NV04_SCALED_IMAGE_FROM_MEMORY;
- break;
- case 0x10:
- case 0x20:
+ else
class = NV10_SCALED_IMAGE_FROM_MEMORY;
- break;
- }
ret = nouveau_grobj_alloc(chan, handle++, class, &hw->sifm);
if (ret)