Revert "intel: use throttle ioctl for throttling"
This reverts commit 50ade6ea69
.
Fixes jerky rendering again on apps that don't block on the GPU per
frame and are GPU bound (e.g. 3DMMES on Ironlake). The whole point of
this complicated throttle scheme is to wait on frame n-1 to have
started rendering before starting frame n's rendering. Otherwise, the
GPU-bound app will race ahead and call the GL to draw many
nearly-identical frames, then >0ms later get stuck waiting for them
(all dispatched at about the same time) to retire, then render a new
batch of nearly-identical frames.
This commit is contained in:
parent
66d95919d5
commit
aa3e1c25d3
|
@ -128,6 +128,11 @@ _intel_batchbuffer_flush(struct intel_context *intel,
|
||||||
if (intel->batch.used == 0)
|
if (intel->batch.used == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (intel->first_post_swapbuffers_batch == NULL) {
|
||||||
|
intel->first_post_swapbuffers_batch = intel->batch.bo;
|
||||||
|
drm_intel_bo_reference(intel->first_post_swapbuffers_batch);
|
||||||
|
}
|
||||||
|
|
||||||
if (unlikely(INTEL_DEBUG & DEBUG_BATCH))
|
if (unlikely(INTEL_DEBUG & DEBUG_BATCH))
|
||||||
fprintf(stderr, "%s:%d: Batchbuffer flush with %db used\n", file, line,
|
fprintf(stderr, "%s:%d: Batchbuffer flush with %db used\n", file, line,
|
||||||
4*intel->batch.used);
|
4*intel->batch.used);
|
||||||
|
|
|
@ -466,9 +466,11 @@ intel_prepare_render(struct intel_context *intel)
|
||||||
* the swap, and getting our hands on that doesn't seem worth it,
|
* the swap, and getting our hands on that doesn't seem worth it,
|
||||||
* so we just us the first batch we emitted after the last swap.
|
* so we just us the first batch we emitted after the last swap.
|
||||||
*/
|
*/
|
||||||
if (intel->need_throttle) {
|
if (intel->need_throttle && intel->first_post_swapbuffers_batch) {
|
||||||
drmCommandNone(intel->driFd, DRM_I915_GEM_THROTTLE);
|
drm_intel_bo_wait_rendering(intel->first_post_swapbuffers_batch);
|
||||||
intel->need_throttle = GL_FALSE;
|
drm_intel_bo_unreference(intel->first_post_swapbuffers_batch);
|
||||||
|
intel->first_post_swapbuffers_batch = NULL;
|
||||||
|
intel->need_throttle = GL_FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -938,6 +940,8 @@ intelDestroyContext(__DRIcontext * driContextPriv)
|
||||||
intel->prim.vb = NULL;
|
intel->prim.vb = NULL;
|
||||||
drm_intel_bo_unreference(intel->prim.vb_bo);
|
drm_intel_bo_unreference(intel->prim.vb_bo);
|
||||||
intel->prim.vb_bo = NULL;
|
intel->prim.vb_bo = NULL;
|
||||||
|
drm_intel_bo_unreference(intel->first_post_swapbuffers_batch);
|
||||||
|
intel->first_post_swapbuffers_batch = NULL;
|
||||||
|
|
||||||
driDestroyOptionCache(&intel->optionCache);
|
driDestroyOptionCache(&intel->optionCache);
|
||||||
|
|
||||||
|
|
|
@ -182,6 +182,7 @@ struct intel_context
|
||||||
bool is_blit;
|
bool is_blit;
|
||||||
} batch;
|
} batch;
|
||||||
|
|
||||||
|
drm_intel_bo *first_post_swapbuffers_batch;
|
||||||
GLboolean need_throttle;
|
GLboolean need_throttle;
|
||||||
GLboolean no_batch_wrap;
|
GLboolean no_batch_wrap;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue