summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/intel/intel_regions.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2009-02-18 11:34:47 -0800
committerEric Anholt <eric@anholt.net>2009-02-21 10:53:41 -0800
commit40dd024be618d805b3744e15d25e115018641324 (patch)
treebf17825f46f02776a7da98c8ede89031113cf6b2 /src/mesa/drivers/dri/intel/intel_regions.c
parent078e8a61b2aa547c6794f586a5c8bfaa575bb066 (diff)
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.
Diffstat (limited to 'src/mesa/drivers/dri/intel/intel_regions.c')
-rw-r--r--src/mesa/drivers/dri/intel/intel_regions.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_regions.c b/src/mesa/drivers/dri/intel/intel_regions.c
index ec85c4131a..749920502a 100644
--- a/src/mesa/drivers/dri/intel/intel_regions.c
+++ b/src/mesa/drivers/dri/intel/intel_regions.c
@@ -109,12 +109,18 @@ intel_region_alloc_internal(struct intel_context *intel,
struct intel_region *
intel_region_alloc(struct intel_context *intel,
- GLuint cpp, GLuint width, GLuint height, GLuint pitch)
+ GLuint cpp, GLuint width, GLuint height, GLuint pitch,
+ GLboolean expect_accelerated_upload)
{
dri_bo *buffer;
- buffer = dri_bo_alloc(intel->bufmgr, "region",
- pitch * cpp * height, 64);
+ if (expect_accelerated_upload) {
+ buffer = drm_intel_bo_alloc_for_render(intel->bufmgr, "region",
+ pitch * cpp * height, 64);
+ } else {
+ buffer = drm_intel_bo_alloc(intel->bufmgr, "region",
+ pitch * cpp * height, 64);
+ }
return intel_region_alloc_internal(intel, cpp, width, height, pitch, buffer);
}