From 55a3c352432d1c7b22e445d041f9cb1990ca28d5 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Mon, 21 Feb 2011 19:14:02 +0100 Subject: [PATCH] i915g: add some throttling Intel classic drivers switched to this, too, so it must be good. Signed-off-by: Daniel Vetter --- src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c b/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c index dec19d42698..afeab5eef42 100644 --- a/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c +++ b/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c @@ -4,6 +4,7 @@ #include "i915_drm.h" #include "i915/i915_debug.h" +#include #define BATCH_RESERVED 16 @@ -132,6 +133,12 @@ i915_drm_batchbuffer_reloc(struct i915_winsys_batchbuffer *ibatch, return ret; } +static void +i915_drm_throttle(struct i915_drm_winsys *idws) +{ + drmIoctl(idws->fd, DRM_IOCTL_I915_GEM_THROTTLE, NULL); +} + static void i915_drm_batchbuffer_flush(struct i915_winsys_batchbuffer *ibatch, struct pipe_fence_handle **fence) @@ -155,6 +162,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 (ret != 0 || i915_drm_winsys(ibatch->iws)->dump_cmd) { i915_dump_batchbuffer(ibatch); assert(ret == 0); -- 2.30.2