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.
This commit is contained in:
Eric Anholt
2009-02-18 11:34:47 -08:00
parent 078e8a61b2
commit 40dd024be6
7 changed files with 27 additions and 13 deletions

View File

@@ -210,7 +210,8 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
DBG("Allocating %d x %d Intel RBO (pitch %d)\n", width,
height, pitch);
irb->region = intel_region_alloc(intel, cpp, width, height, pitch);
irb->region = intel_region_alloc(intel, cpp, width, height, pitch,
GL_TRUE);
if (!irb->region)
return GL_FALSE; /* out of memory? */