summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/i915simple
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2008-01-20 10:38:35 +1100
committerBen Skeggs <skeggsb@gmail.com>2008-01-20 10:38:35 +1100
commitdf09ed9d1ecf11be14ee7f189273c14375fbaa57 (patch)
tree7322a2670877dff003f57a5485c9e92226b57167 /src/mesa/pipe/i915simple
parent0feec292ddc279998a1e25c10ea70d211f7b4b62 (diff)
parenta1f4a5e802ad62c88fca6834b9de1c83672230a6 (diff)
Merge branch 'upstream-gallium-0.1' into darktama-gallium-0.1
Diffstat (limited to 'src/mesa/pipe/i915simple')
-rw-r--r--src/mesa/pipe/i915simple/i915_debug.h6
-rw-r--r--src/mesa/pipe/i915simple/i915_prim_vbuf.c8
-rw-r--r--src/mesa/pipe/i915simple/i915_surface.c58
-rw-r--r--src/mesa/pipe/i915simple/i915_texture.c12
4 files changed, 24 insertions, 60 deletions
diff --git a/src/mesa/pipe/i915simple/i915_debug.h b/src/mesa/pipe/i915simple/i915_debug.h
index 13197f3595..0bcd094233 100644
--- a/src/mesa/pipe/i915simple/i915_debug.h
+++ b/src/mesa/pipe/i915simple/i915_debug.h
@@ -69,11 +69,13 @@ void i915_print_ureg(const char *msg, unsigned ureg);
#define DEBUG_SURFACE 0x2000
#define DEBUG_WINSYS 0x4000
+#include "pipe/p_compiler.h"
+
#if defined(DEBUG) && defined(FILE_DEBUG_FLAG)
#include "pipe/p_winsys.h"
-static void
+static INLINE void
I915_DBG(
struct i915_context *i915,
const char *fmt,
@@ -92,7 +94,7 @@ I915_DBG(
#else
-static void
+static INLINE void
I915_DBG(
struct i915_context *i915,
const char *fmt,
diff --git a/src/mesa/pipe/i915simple/i915_prim_vbuf.c b/src/mesa/pipe/i915simple/i915_prim_vbuf.c
index bdcc027ed7..edc62e25e5 100644
--- a/src/mesa/pipe/i915simple/i915_prim_vbuf.c
+++ b/src/mesa/pipe/i915simple/i915_prim_vbuf.c
@@ -136,12 +136,8 @@ i915_vbuf_render_set_primitive( struct vbuf_render *render,
static void
i915_vbuf_render_draw( struct vbuf_render *render,
- uint prim,
const ushort *indices,
- uint nr_indices,
- const void *vertices,
- uint nr_vertices,
- uint vertex_bytes)
+ uint nr_indices)
{
struct i915_vbuf_render *i915_render = i915_vbuf_render(render);
struct i915_context *i915 = i915_render->i915;
@@ -206,7 +202,7 @@ static void
i915_vbuf_render_destroy( struct vbuf_render *render )
{
struct i915_vbuf_render *i915_render = i915_vbuf_render(render);
- free(i915_render);
+ FREE(i915_render);
}
diff --git a/src/mesa/pipe/i915simple/i915_surface.c b/src/mesa/pipe/i915simple/i915_surface.c
index e3c3cdd2e4..e625f5a68c 100644
--- a/src/mesa/pipe/i915simple/i915_surface.c
+++ b/src/mesa/pipe/i915simple/i915_surface.c
@@ -64,6 +64,7 @@ i915_get_tex_surface(struct pipe_context *pipe,
ps = pipe->winsys->surface_alloc(pipe->winsys);
if (ps) {
assert(ps->refcount);
+ assert(ps->winsys);
pipe->winsys->buffer_reference(pipe->winsys, &ps->buffer, tex->buffer);
ps->format = pt->format;
ps->cpp = pt->cpp;
@@ -76,41 +77,6 @@ i915_get_tex_surface(struct pipe_context *pipe,
}
-static void
-copy_rect(ubyte * dst,
- unsigned cpp,
- unsigned dst_pitch,
- unsigned dst_x,
- unsigned dst_y,
- unsigned width,
- unsigned height,
- const ubyte *src,
- unsigned src_pitch,
- unsigned src_x,
- unsigned src_y)
-{
- unsigned i;
-
- dst_pitch *= cpp;
- src_pitch *= cpp;
- dst += dst_x * cpp;
- src += src_x * cpp;
- dst += dst_y * dst_pitch;
- src += src_y * dst_pitch;
- width *= cpp;
-
- if (width == dst_pitch && width == src_pitch)
- memcpy(dst, src, height * width);
- else {
- for (i = 0; i < height; i++) {
- memcpy(dst, src, width);
- dst += dst_pitch;
- src += src_pitch;
- }
- }
-}
-
-
/* Upload data to a rectangular sub-region. Lots of choices how to do this:
*
* - memcpy by span to current destination
@@ -125,9 +91,9 @@ i915_surface_data(struct pipe_context *pipe,
const void *src, unsigned src_pitch,
unsigned srcx, unsigned srcy, unsigned width, unsigned height)
{
- copy_rect(pipe_surface_map(dst),
- dst->cpp, dst->pitch,
- dstx, dsty, width, height, src, src_pitch, srcx, srcy);
+ pipe_copy_rect(pipe_surface_map(dst),
+ dst->cpp, dst->pitch,
+ dstx, dsty, width, height, src, src_pitch, srcx, srcy);
pipe_surface_unmap(dst);
}
@@ -147,14 +113,14 @@ i915_surface_copy(struct pipe_context *pipe,
assert( dst->cpp == src->cpp );
if (0) {
- copy_rect(pipe_surface_map(dst),
- dst->cpp,
- dst->pitch,
- dstx, dsty,
- width, height,
- pipe_surface_map(src),
- src->pitch,
- srcx, srcy);
+ pipe_copy_rect(pipe_surface_map(dst),
+ dst->cpp,
+ dst->pitch,
+ dstx, dsty,
+ width, height,
+ pipe_surface_map(src),
+ src->pitch,
+ srcx, srcy);
pipe_surface_unmap(src);
pipe_surface_unmap(dst);
diff --git a/src/mesa/pipe/i915simple/i915_texture.c b/src/mesa/pipe/i915simple/i915_texture.c
index 44f72e63cc..6b0a4a96f3 100644
--- a/src/mesa/pipe/i915simple/i915_texture.c
+++ b/src/mesa/pipe/i915simple/i915_texture.c
@@ -123,7 +123,7 @@ i945_miptree_layout_2d( struct i915_texture *tex )
* 2nd mipmap out past the width of its parent.
*/
if (pt->first_level != pt->last_level) {
- unsigned mip1_width = align(minify(pt->width[0]), align_w)
+ unsigned mip1_width = align_int(minify(pt->width[0]), align_w)
+ minify(minify(pt->width[0]));
if (mip1_width > pt->width[0])
@@ -133,7 +133,7 @@ i945_miptree_layout_2d( struct i915_texture *tex )
/* Pitch must be a whole number of dwords, even though we
* express it in texels.
*/
- tex->pitch = align(tex->pitch * pt->cpp, 4) / pt->cpp;
+ tex->pitch = align_int(tex->pitch * pt->cpp, 4) / pt->cpp;
tex->total_height = 0;
for ( level = pt->first_level ; level <= pt->last_level ; level++ ) {
@@ -144,7 +144,7 @@ i945_miptree_layout_2d( struct i915_texture *tex )
if (pt->compressed)
img_height = MAX2(1, height/4);
else
- img_height = align(height, align_h);
+ img_height = align_int(height, align_h);
/* Because the images are packed better, the final offset
@@ -155,7 +155,7 @@ i945_miptree_layout_2d( struct i915_texture *tex )
/* Layout_below: step right after second mipmap.
*/
if (level == pt->first_level + 1) {
- x += align(width, align_w);
+ x += align_int(width, align_w);
}
else {
y += img_height;
@@ -531,9 +531,9 @@ i915_texture_release(struct pipe_context *pipe, struct pipe_texture **pt)
for (i = 0; i < PIPE_MAX_TEXTURE_LEVELS; i++)
if (tex->image_offset[i])
- free(tex->image_offset[i]);
+ FREE(tex->image_offset[i]);
- free(tex);
+ FREE(tex);
}
*pt = NULL;
}