[Intel-gfx] [PATCH 3a/3] drm/i915: Avoid i915_gem_execbuffer_wait_for_flips() on SNB+

ville.syrjala at linux.intel.com ville.syrjala at linux.intel.com
Thu Nov 1 19:06:02 CET 2012


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

i915_gem_execbuffer_wait_for_flips() only works on some old hardware,
and it's not required by sane user space code. So assume that any
insane user space is limited to <= gen5, and just skip
i915_gem_execbuffer_wait_for_flips() for anything more recent.

Also eliminate the extra pending flip wait in intel_finish_fb()
which is based on the pending_flip counter. This wait doesn't
actually do anything when used on the current crtc front buffer,
so the whole thing is pointless. There's a new mechanism for
waiting for pending flips, which actually does the right thing.

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 drivers/gpu/drm/i915/i915_gem_execbuffer.c |    4 ++++
 drivers/gpu/drm/i915/intel_display.c       |    4 ----
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 91d43d5..14761ac 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -616,6 +616,10 @@ i915_gem_execbuffer_wait_for_flips(struct intel_ring_buffer *ring, u32 flips)
 	u32 plane, flip_mask;
 	int ret;
 
+	/* This function exists only to please legacy userland. */
+	if (INTEL_INFO(ring->dev)->gen >= 6)
+		return 0;
+
 	/* Check for any pending flips. As we only maintain a flip queue depth
 	 * of 1, we can simply insert a WAIT for the next display flip prior
 	 * to executing the batch and avoid stalling the CPU.
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 7bf4749..b1e8150 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2182,10 +2182,6 @@ intel_finish_fb(struct drm_framebuffer *old_fb)
 	bool was_interruptible = dev_priv->mm.interruptible;
 	int ret;
 
-	wait_event(dev_priv->pending_flip_queue,
-		   atomic_read(&dev_priv->mm.wedged) ||
-		   atomic_read(&obj->pending_flip) == 0);
-
 	/* Big Hammer, we also need to ensure that any pending
 	 * MI_WAIT_FOR_EVENT inside a user batch buffer on the
 	 * current scanout is retired before unpinning the old
-- 
1.7.8.6




More information about the Intel-gfx mailing list