From 847fcb645c1d0c69617f0cafe8e6410e13f08fa6 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Fri, 7 Aug 2009 20:16:39 -0700 Subject: gallium: Move minify() to u_math. minify() is usually used in mipmap size calculation. Strangely enough, we all defined it as MAX2(1, d >> 1); imagine that. :3 --- src/gallium/drivers/cell/ppu/cell_texture.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'src/gallium/drivers/cell/ppu/cell_texture.c') diff --git a/src/gallium/drivers/cell/ppu/cell_texture.c b/src/gallium/drivers/cell/ppu/cell_texture.c index e26594448f..80418f5aa2 100644 --- a/src/gallium/drivers/cell/ppu/cell_texture.c +++ b/src/gallium/drivers/cell/ppu/cell_texture.c @@ -44,13 +44,6 @@ -static unsigned -minify(unsigned d) -{ - return MAX2(1, d>>1); -} - - static void cell_texture_layout(struct cell_texture *ct) { -- cgit v1.2.3 From 7c4223876b4f8a78335687c7fcd7448b5a83ad10 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 17 Aug 2009 08:27:52 -0600 Subject: cell: fix incorrect pipe_transfer tests The value is an enum, not a bitmask. --- src/gallium/drivers/cell/ppu/cell_texture.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/gallium/drivers/cell/ppu/cell_texture.c') diff --git a/src/gallium/drivers/cell/ppu/cell_texture.c b/src/gallium/drivers/cell/ppu/cell_texture.c index 80418f5aa2..6a63a0e6ce 100644 --- a/src/gallium/drivers/cell/ppu/cell_texture.c +++ b/src/gallium/drivers/cell/ppu/cell_texture.c @@ -417,7 +417,8 @@ cell_transfer_map(struct pipe_screen *screen, struct pipe_transfer *transfer) if (!ctrans->map) return NULL; /* out of memory */ - if (transfer->usage & PIPE_TRANSFER_READ) { + if (transfer->usage == PIPE_TRANSFER_READ || + transfer->usage == PIPE_TRANSFER_READ_WRITE) { /* need to untwiddle the texture to make a linear version */ const uint bpp = pf_get_size(ct->base.format); if (bpp == 4) { @@ -458,7 +459,8 @@ cell_transfer_unmap(struct pipe_screen *screen, PIPE_BUFFER_USAGE_CPU_READ); } - if (transfer->usage & PIPE_TRANSFER_WRITE) { + if (transfer->usage == PIPE_TRANSFER_WRITE || + transfer->usage == PIPE_TRANSFER_READ_WRITE) { /* The user wrote new texture data into the mapped buffer. * We need to convert the new linear data into the twiddled/tiled format. */ -- cgit v1.2.3