[PATCH] drm/i915: Flush outstanding unpin tasks before pageflipping

Herton Ronaldo Krzesinski herton.krzesinski at canonical.com
Thu Jan 10 02:41:51 UTC 2013


On Thu, Dec 27, 2012 at 09:30:47PM -0500, Daniel Gnoutcheff wrote:
> From: Chris Wilson <chris at chris-wilson.co.uk>
> 
> commit b4a98e57fc27854b5938fc8b08b68e5e68b91e1f upstream
> 
> If we accumulate unpin tasks because we are pageflipping faster than the
> system can schedule its workers, we can effectively create a
> pin-leak. The solution taken here is to limit the number of unpin tasks
> we have per-crtc and to flush those outstanding tasks if we accumulate
> too many. This should prevent any jitter in the normal case, and also
> prevent the hang if we should run too fast.
> 
> Note: It is important that we switch from the system workqueue to our
> own dev_priv->wq since all work items on that queue are guaranteed to
> only need the dev->struct_mutex and not any modeset resources. For
> otherwise if we have a work item ahead in the queue which needs the
> modeset lock (like the output detect work used by both polling or
> hpd), this work and so the unpin work will never execute since the
> pageflip code already holds that lock. Unfortunately there's no
> lockdep support for this scenario in the workqueue code.
> 
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=46991
> Reported-and-tested-by: Tvrtko Ursulin <tvrtko.ursulin at onelan.co.uk>
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> [danvet: Added note about workqueu deadlock.]
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56337
> Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=58732
> Tested-by: Daniel Gnoutcheff <daniel at gnoutcheff.name>
> [dg: Adjusted context, removed a whitespace change]
> Launchpad: https://bugs.launchpad.net/linux/+bug/1094173
> ---
> 
> This patch is intended for the 3.5.7.y extended longterm queue.  It has
> had its context adjusted so it will apply cleanly on 3.5.7.2.  The same
> patch (with different context) has been submitted upstream for the 3.7.y
> queue.
> 
> Thanks, HTH!
> 
>  drivers/gpu/drm/i915/intel_display.c |   21 ++++++++++++++++-----
>  drivers/gpu/drm/i915/intel_drv.h     |    4 +++-
>  2 files changed, 19 insertions(+), 6 deletions(-)

queued for 3.5, thanks.

-- 
[]'s
Herton




More information about the kernel-team mailing list