summaryrefslogtreecommitdiff
path: root/src/gallium/winsys/i915/drm
diff options
context:
space:
mode:
authorSt├ęphane Marchesin <marcheu@chromium.org>2013-03-08 13:32:55 -0800
committerSt├ęphane Marchesin <marcheu@chromium.org>2013-03-08 19:34:50 -0800
commit1662178863d7b715530274148aa57e6494f935a8 (patch)
tree810394ad935a02c5605ec549da922cdd45f5097b /src/gallium/winsys/i915/drm
parentd815e8af3944bca5eac7a0638da5529596735aef (diff)
i915g: Use PIPE_FLUSH_END_OF_FRAME to trigger throttling
This helps with jittering, instead of throttling at every command buffer we only throttle once a frame.
Diffstat (limited to 'src/gallium/winsys/i915/drm')
-rw-r--r--src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c b/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c
index 03aa1b1537a..9fedb121565 100644
--- a/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c
+++ b/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c
@@ -151,7 +151,7 @@ i915_drm_batchbuffer_reloc(struct i915_winsys_batchbuffer *ibatch,
return ret;
}
-static void
+static void
i915_drm_throttle(struct i915_drm_winsys *idws)
{
drmIoctl(idws->fd, DRM_IOCTL_I915_GEM_THROTTLE, NULL);
@@ -159,7 +159,8 @@ i915_drm_throttle(struct i915_drm_winsys *idws)
static void
i915_drm_batchbuffer_flush(struct i915_winsys_batchbuffer *ibatch,
- struct pipe_fence_handle **fence)
+ struct pipe_fence_handle **fence,
+ enum i915_winsys_flush_flags flags)
{
struct i915_drm_batchbuffer *batch = i915_drm_batchbuffer(ibatch);
unsigned used;
@@ -180,7 +181,8 @@ i915_drm_batchbuffer_flush(struct i915_winsys_batchbuffer *ibatch,
if (ret == 0 && i915_drm_winsys(ibatch->iws)->send_cmd)
ret = drm_intel_bo_exec(batch->bo, used, NULL, 0, 0);
- i915_drm_throttle(i915_drm_winsys(ibatch->iws));
+ if (flags & I915_FLUSH_END_OF_FRAME)
+ i915_drm_throttle(i915_drm_winsys(ibatch->iws));
if (ret != 0 || i915_drm_winsys(ibatch->iws)->dump_cmd) {
i915_dump_batchbuffer(ibatch);