This is a note to let you know that I've just added the patch titled
drm/i915: Wait for all pending operations to the fb before disabling the
pipe
to the 3.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
0008-drm-i915-Wait-for-all-pending-operations-to-the-fb-b.patch
and it can be found in the queue-3.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.
>From 6f04ea0e7402a7148f641d27a5d0702f2c475ec8 Mon Sep 17 00:00:00 2001
From: Chris Wilson <[email protected]>
Date: Tue, 17 Apr 2012 10:05:38 +0100
Subject: drm/i915: Wait for all pending operations to the fb before disabling
the pipe
From: Chris Wilson <[email protected]>
commit 0f91128d88bbb8b0a8e7bb93df2c40680871d45a upstream.
During modeset we have to disable the pipe to reconfigure its timings
and maybe its size. Userspace may have queued up command buffers that
depend upon the pipe running in a certain configuration and so the
commands may become confused across the modeset. At the moment, we use a
less than satisfactory kick-scanline-waits should the GPU hang during
the modeset. It should be more reliable to wait for the pending
operations to complete first, even though we still have a window for
userspace to submit a broken command buffer during the modeset.
Signed-off-by: Chris Wilson <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Signed-off-by: Julien Cristau <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
drivers/gpu/drm/i915/intel_display.c | 27 ++++-----------------------
1 file changed, 4 insertions(+), 23 deletions(-)
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2897,16 +2897,14 @@ static void intel_clear_scanline_wait(st
static void intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc)
{
- struct drm_i915_gem_object *obj;
- struct drm_i915_private *dev_priv;
+ struct drm_device *dev = crtc->dev;
if (crtc->fb == NULL)
return;
- obj = to_intel_framebuffer(crtc->fb)->obj;
- dev_priv = crtc->dev->dev_private;
- wait_event(dev_priv->pending_flip_queue,
- atomic_read(&obj->pending_flip) == 0);
+ mutex_lock(&dev->struct_mutex);
+ intel_finish_fb(crtc->fb);
+ mutex_unlock(&dev->struct_mutex);
}
static bool intel_crtc_driving_pch(struct drm_crtc *crtc)
@@ -3372,23 +3370,6 @@ static void intel_crtc_disable(struct dr
struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
struct drm_device *dev = crtc->dev;
- /* Flush any pending WAITs before we disable the pipe. Note that
- * we need to drop the struct_mutex in order to acquire it again
- * during the lowlevel dpms routines around a couple of the
- * operations. It does not look trivial nor desirable to move
- * that locking higher. So instead we leave a window for the
- * submission of further commands on the fb before we can actually
- * disable it. This race with userspace exists anyway, and we can
- * only rely on the pipe being disabled by userspace after it
- * receives the hotplug notification and has flushed any pending
- * batches.
- */
- if (crtc->fb) {
- mutex_lock(&dev->struct_mutex);
- intel_finish_fb(crtc->fb);
- mutex_unlock(&dev->struct_mutex);
- }
-
crtc_funcs->dpms(crtc, DRM_MODE_DPMS_OFF);
assert_plane_disabled(dev->dev_private, to_intel_crtc(crtc)->plane);
assert_pipe_disabled(dev->dev_private, to_intel_crtc(crtc)->pipe);
Patches currently in stable-queue which might be from [email protected]
are
queue-3.4/0011-drm-i915-add-some-barriers-when-changing-DIPs.patch
queue-3.4/0008-drm-i915-Wait-for-all-pending-operations-to-the-fb-b.patch
queue-3.4/0016-drm-i915-Reduce-a-pin-leak-BUG-into-a-WARN.patch
queue-3.4/0018-drm-i915-Fix-GT_MODE-default-value.patch
queue-3.4/0003-drm-i915-fix-up-ivb-plane-3-pageflips.patch
queue-3.4/0002-drm-i915-Unpin-the-flip-target-if-we-fail-to-queue-t.patch
queue-3.4/0017-drm-i915-prevent-possible-pin-leak-on-error-path.patch
queue-3.4/0009-drm-i915-don-t-pwrite-tiled-objects-through-the-gtt.patch
queue-3.4/0012-drm-i915-SDVO-hotplug-have-different-interrupt-statu.patch
queue-3.4/0020-drm-i915-Flush-the-pending-flips-on-the-CRTC-before-.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html