From 17701ed1a000e4aa7d0512f9b6418aff25b45a90 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 13 Apr 2015 09:25:16 +0100 Subject: [PATCH 1/2] intel: Use WAIT for wait-rendering Using WAIT is preferrable to SET_DOMAIN as it doesn't have any domain management side-effects - but has the same flushing semantics. Signed-off-by: Chris Wilson Cc: Daniel Vetter --- intel/intel_bufmgr_gem.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c index ecbf8ee..a938441 100644 --- a/intel/intel_bufmgr_gem.c +++ b/intel/intel_bufmgr_gem.c @@ -1740,6 +1740,24 @@ drm_intel_gem_bo_get_subdata(drm_intel_bo *bo, unsigned long offset, static void drm_intel_gem_bo_wait_rendering(drm_intel_bo *bo) { + drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr; + + /* Using WAIT is preferrable to SET_DOMAIN as it doesn't have + * any domain management side-effects - but has the same flushing + * semantics. + */ + if (bufmgr_gem->has_wait_timeout) { + struct drm_i915_gem_wait wait; + + memclear(wait); + wait.bo_handle = bo->handle; + wait.timeout_ns = -1; + if (drmIoctl(bufmgr_gem->fd, + DRM_IOCTL_I915_GEM_WAIT, + &wait) == 0) + return; + } + drm_intel_gem_bo_start_gtt_access(bo, 1); } -- 2.1.4