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.
* 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;