summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2006-09-07 19:05:40 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2006-09-07 19:05:40 +0000
commit493b2ddecb47fdacc4b73d9c9a3ba2e46489105f (patch)
tree011c2f4570d336020c0db6562d294d638a981531 /src/mesa/drivers/dri/i965/intel_mipmap_tree.c
parentc26f36c830cc6df1093a145eb43645f535004eb7 (diff)
Cope with memory pool fragmentation by allowing a second attempt at
rendering operations to take place after evicting all resident buffers. Cope better with memory allocation failures throughout the driver and improve tracking of failures.
Diffstat (limited to 'src/mesa/drivers/dri/i965/intel_mipmap_tree.c')
-rw-r--r--src/mesa/drivers/dri/i965/intel_mipmap_tree.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index ed19f70f43..8486086b27 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -214,13 +214,13 @@ GLuint intel_miptree_image_offset(struct intel_mipmap_tree *mt,
/* Upload data for a particular image.
*/
-void intel_miptree_image_data(struct intel_context *intel,
- struct intel_mipmap_tree *dst,
- GLuint face,
- GLuint level,
- const void *src,
- GLuint src_row_pitch,
- GLuint src_image_pitch)
+GLboolean intel_miptree_image_data(struct intel_context *intel,
+ struct intel_mipmap_tree *dst,
+ GLuint face,
+ GLuint level,
+ const void *src,
+ GLuint src_row_pitch,
+ GLuint src_image_pitch)
{
GLuint depth = dst->level[level].depth;
GLuint dst_offset = intel_miptree_image_offset(dst, face, level);
@@ -229,17 +229,19 @@ void intel_miptree_image_data(struct intel_context *intel,
DBG("%s\n", __FUNCTION__);
for (i = 0; i < depth; i++) {
- intel_region_data(intel,
- dst->region,
- dst_offset + dst_depth_offset[i],
- 0,
- 0,
- src,
- src_row_pitch,
- 0, 0, /* source x,y */
- dst->level[level].width,
- dst->level[level].height);
+ if (!intel_region_data(intel,
+ dst->region,
+ dst_offset + dst_depth_offset[i],
+ 0,
+ 0,
+ src,
+ src_row_pitch,
+ 0, 0, /* source x,y */
+ dst->level[level].width,
+ dst->level[level].height))
+ return GL_FALSE;
src += src_image_pitch;
}
+ return GL_TRUE;
}