From 40dd024be618d805b3744e15d25e115018641324 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 18 Feb 2009 11:34:47 -0800 Subject: intel: tell libdrm whether we want a cpu-ready or gpu-ready BO for regions. This lets us avoid allocing new buffers for renderbuffers, finalized miptrees, and PBO-uploaded textures when there's an unreferenced but still active one cached, while also avoiding CPU waits for batchbuffers and CPU-uploaded textures. The size of BOs allocated for a desktop running current GL cairogears on i915 is cut in half with this. Note that this means we require libdrm 2.4.5. --- src/mesa/drivers/dri/intel/intel_tex_image.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/mesa/drivers/dri/intel/intel_tex_image.c') diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index 866022d0ce..c3bbcfc1b9 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -62,7 +62,8 @@ logbase2(int n) static void guess_and_alloc_mipmap_tree(struct intel_context *intel, struct intel_texture_object *intelObj, - struct intel_texture_image *intelImage) + struct intel_texture_image *intelImage, + GLboolean expect_accelerated_upload) { GLuint firstLevel; GLuint lastLevel; @@ -136,7 +137,8 @@ guess_and_alloc_mipmap_tree(struct intel_context *intel, height, depth, intelImage->base.TexFormat->TexelBytes, - comp_byte); + comp_byte, + expect_accelerated_upload); DBG("%s - success\n", __FUNCTION__); } @@ -385,7 +387,7 @@ intelTexImage(GLcontext * ctx, } if (!intelObj->mt) { - guess_and_alloc_mipmap_tree(intel, intelObj, intelImage); + guess_and_alloc_mipmap_tree(intel, intelObj, intelImage, pixels == NULL); if (!intelObj->mt) { DBG("guess_and_alloc_mipmap_tree: failed\n"); } @@ -415,7 +417,7 @@ intelTexImage(GLcontext * ctx, level, level, width, height, depth, intelImage->base.TexFormat->TexelBytes, - comp_byte); + comp_byte, pixels == NULL); } -- cgit v1.2.3