summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/i915simple
diff options
context:
space:
mode:
authorJosé Fonseca <jrfonseca@tungstengraphics.com>2008-01-17 13:39:14 +0900
committerJosé Fonseca <jrfonseca@tungstengraphics.com>2008-01-17 13:39:14 +0900
commit271f9dac79a9247de9a57f4d248e404bf1652a13 (patch)
tree70e049d11449f2d41a7e27076995d86827e46be7 /src/mesa/pipe/i915simple
parentb016f0adba8278f3744d3aaa207a1b586d51756d (diff)
Back-port miscellaneous fixes from internal branch (mostly portability fixes).
These are changes that are in our internal branch, but somehow were skipped so far. It was done using visual comparison of the branches -- it is likely that changes are being carried on the wrong way
Diffstat (limited to 'src/mesa/pipe/i915simple')
-rw-r--r--src/mesa/pipe/i915simple/i915_prim_vbuf.c2
-rw-r--r--src/mesa/pipe/i915simple/i915_surface.c1
-rw-r--r--src/mesa/pipe/i915simple/i915_texture.c12
3 files changed, 8 insertions, 7 deletions
diff --git a/src/mesa/pipe/i915simple/i915_prim_vbuf.c b/src/mesa/pipe/i915simple/i915_prim_vbuf.c
index d85a6d3c0f..edc62e25e5 100644
--- a/src/mesa/pipe/i915simple/i915_prim_vbuf.c
+++ b/src/mesa/pipe/i915simple/i915_prim_vbuf.c
@@ -202,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..72a65e0fb4 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;
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;
}