Mesa (gallium-0.2): cell: minor reformatting, var renaming
Brian Paul
brianp at kemper.freedesktop.org
Thu Nov 6 00:21:14 UTC 2008
Module: Mesa
Branch: gallium-0.2
Commit: 88360913a730795d031b2ff20fe50d438ef1c151
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=88360913a730795d031b2ff20fe50d438ef1c151
Author: Brian Paul <brian.paul at tungstengraphics.com>
Date: Wed Nov 5 17:20:35 2008 -0700
cell: minor reformatting, var renaming
---
src/gallium/drivers/cell/ppu/cell_texture.c | 18 +++++++++++-------
1 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/src/gallium/drivers/cell/ppu/cell_texture.c b/src/gallium/drivers/cell/ppu/cell_texture.c
index 28161d1..ae88d06 100644
--- a/src/gallium/drivers/cell/ppu/cell_texture.c
+++ b/src/gallium/drivers/cell/ppu/cell_texture.c
@@ -28,6 +28,7 @@
* Authors:
* Keith Whitwell <keith at tungstengraphics.com>
* Michel Dänzer <michel at tungstengraphics.com>
+ * Brian Paul
*/
#include "pipe/p_context.h"
@@ -41,10 +42,10 @@
#include "cell_state.h"
#include "cell_texture.h"
-/* Simple, maximally packed layout.
- */
-static unsigned minify( unsigned d )
+
+static unsigned
+minify(unsigned d)
{
return MAX2(1, d>>1);
}
@@ -209,6 +210,7 @@ twiddle_image_uint(uint w, uint h, uint tile_size, uint *dst,
}
}
+
/**
* For Cell. Basically, rearrange the pixels/quads from this layout:
* +--+--+--+--+
@@ -238,22 +240,22 @@ twiddle_tile(const uint *tileIn, uint *tileOut)
}
}
+
/**
* Convert image from tiled layout to linear layout. 4-byte pixels.
*/
static void
untwiddle_image_uint(uint w, uint h, uint tile_size, uint *dst,
- uint src_stride, const uint *src)
+ uint dst_stride, const uint *src)
{
const uint tile_size2 = tile_size * tile_size;
const uint h_t = (h + tile_size - 1) / tile_size;
const uint w_t = (w + tile_size - 1) / tile_size;
uint *tile_buf;
-
uint it, jt; /* tile counters */
uint i, j; /* intra-tile counters */
- src_stride /= 4; /* convert from bytes to pixels */
+ dst_stride /= 4; /* convert from bytes to pixels */
tile_buf = align_malloc(tile_size * tile_size * 4, 16);
@@ -282,7 +284,7 @@ untwiddle_image_uint(uint w, uint h, uint tile_size, uint *dst,
uint dstj = jt * tile_size + j;
ASSERT(dsti < h);
ASSERT(dstj < w);
- dst[dsti * src_stride + dstj] = tsrc[i * tile_size + j];
+ dst[dsti * dst_stride + dstj] = tsrc[i * tile_size + j];
}
}
}
@@ -291,6 +293,7 @@ untwiddle_image_uint(uint w, uint h, uint tile_size, uint *dst,
align_free(tile_buf);
}
+
/**
* Convert linear texture image data to tiled format for SPU usage.
*/
@@ -341,6 +344,7 @@ cell_twiddle_texture(struct pipe_screen *screen,
pipe_buffer_unmap(screen, surface->buffer);
}
+
/**
* Convert SPU tiled texture image data to linear format for app usage.
*/
More information about the mesa-commit
mailing list