From 66681b4c8cb1ef16f42c1591298cb30c83bca09b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 23 Oct 2011 10:44:47 -0600 Subject: mesa: remove _mesa_alloc_texmemory(), _mesa_free_texmemory() Core Mesa no longer does any texture memory allocation. --- src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 4 ++-- src/mesa/drivers/dri/intel/intel_tex.c | 2 +- src/mesa/drivers/dri/intel/intel_tex_image.c | 1 + src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c | 2 +- src/mesa/drivers/dri/radeon/radeon_texture.c | 7 ++++--- 5 files changed, 9 insertions(+), 7 deletions(-) (limited to 'src/mesa/drivers/dri') diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c index c5ef38b7596..9eb81deb78a 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c @@ -436,8 +436,8 @@ intel_miptree_copy_teximage(struct intel_context *intel, } } - if (!src_mt) { - _mesa_free_texmemory(intelImage->base.Data); + if (!src_mt && intelImage->base.Data) { + _mesa_align_free(intelImage->base.Data); intelImage->base.Data = NULL; } diff --git a/src/mesa/drivers/dri/intel/intel_tex.c b/src/mesa/drivers/dri/intel/intel_tex.c index c11753b3deb..0e82e136e5a 100644 --- a/src/mesa/drivers/dri/intel/intel_tex.c +++ b/src/mesa/drivers/dri/intel/intel_tex.c @@ -135,7 +135,7 @@ intel_free_texture_image_buffer(struct gl_context * ctx, intel_miptree_release(&intelImage->mt); if (intelImage->base.Data) { - _mesa_free_texmemory(intelImage->base.Data); + _mesa_align_free(intelImage->base.Data); intelImage->base.Data = NULL; } diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index cf54a1391c1..2625e17a656 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -14,6 +14,7 @@ #include "main/texgetimage.h" #include "main/texobj.h" #include "main/teximage.h" +#include "main/texstore.h" #include "intel_context.h" #include "intel_mipmap_tree.h" diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c index 8daeb5e8dd2..d251670794a 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c @@ -499,7 +499,7 @@ static void migrate_image_to_miptree(radeon_mipmap_tree *mt, copy_rows(dest, dstlvl->rowstride, image->base.Data, srcrowstride, rows, srcrowstride); - _mesa_free_texmemory(image->base.Data); + _mesa_align_free(image->base.Data); image->base.Data = 0; } diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 2d17d30bb50..abe751053e6 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -106,14 +106,14 @@ void radeonFreeTextureImageBuffer(struct gl_context *ctx, struct gl_texture_imag radeon_miptree_unreference(&image->mt); assert(!image->base.Data); } else { - _mesa_free_texture_image_data(ctx, timage); + _swrast_free_texture_image_buffer(ctx, timage); } if (image->bo) { radeon_bo_unref(image->bo); image->bo = NULL; } if (image->base.Data) { - _mesa_free_texmemory(image->base.Data); + _mesa_align_free(image->base.Data); image->base.Data = NULL; } @@ -828,7 +828,8 @@ static void radeon_teximage( texImage->Width, texImage->Height, texImage->Depth); - image->base.Data = _mesa_alloc_texmemory(size); + image->base.Data = _mesa_align_malloc(size, 512); + radeon_print(RADEON_TEXTURE, RADEON_VERBOSE, "%s %dd: texObj %p, texImage %p, " " no miptree assigned, using local memory %p\n", -- cgit v1.2.3