summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-11-09 13:30:27 -0800
committerEric Anholt <eric@anholt.net>2010-11-09 13:30:27 -0800
commit76360d6abc9e0195bc5c373101ae616e68b2e6e6 (patch)
tree86452e1d24b04624b59211cddcf0a58da57f947b
parent956ae44dcf63671bb5707c369d3ff2bee3476cd9 (diff)
intel: Fix the client-side swapbuffers throttling.
We were asking for a wait to GTT read (all GPU rendering to it complete), instead of asking for all GPU reading from it to be complete. Prevents swapbuffers-based apps from running away with rendering, and produces a better input experience.
-rw-r--r--src/mesa/drivers/dri/intel/intel_context.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c
index de4bcde20b..60c401b75b 100644
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -470,7 +470,11 @@ intel_prepare_render(struct intel_context *intel)
* so we just us the first batch we emitted after the last swap.
*/
if (intel->need_throttle && intel->first_post_swapbuffers_batch) {
- drm_intel_bo_wait_rendering(intel->first_post_swapbuffers_batch);
+ /* Can't use drm_intel_bo_wait_rendering, since that only waits
+ * for rendering *to* the buffer, not from it.
+ */
+ drm_intel_gem_bo_map_gtt(intel->first_post_swapbuffers_batch);
+ drm_intel_gem_bo_unmap_gtt(intel->first_post_swapbuffers_batch);
drm_intel_bo_unreference(intel->first_post_swapbuffers_batch);
intel->first_post_swapbuffers_batch = NULL;
intel->need_throttle = GL_FALSE;