summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/i915
diff options
context:
space:
mode:
authorDaniel Vetter <[email protected]>2011-02-21 19:14:02 +0100
committerJakob Bornecrantz <[email protected]>2011-02-21 23:42:54 +0000
commit55a3c352432d1c7b22e445d041f9cb1990ca28d5 (patch)
tree8a0762bee8a4cb46f126a274ab7dfae7fe733e39 /src/gallium/winsys/i915
parent1e966636d06e92f562a7dbcd69aa88c4c9283c41 (diff)
i915g: add some throttling
Intel classic drivers switched to this, too, so it must be good. Signed-off-by: Daniel Vetter <[email protected]>
Diffstat (limited to 'src/gallium/winsys/i915')
-rw-r--r--src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c9
1 files changed, 9 insertions, 0 deletions
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 <xf86drm.h>
#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);