Re: [PATCH] drm/i915: Simplify and fix object to display tracking

Chris Wilson
2015-03-31T12:09:22Z

On Tue, Mar 31, 2015 at 12:10:04PM +0100, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>
> Purpose of this tracking is to know when to flush the cache between the
> non-coherent display engine. Previously to:
>
> commit 121920faf2ccce9aa66a7e2588415c9647b66104
> Author: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Date: Mon Mar 23 11:10:37 2015 +0000
>
> drm/i915/skl: Query display address through a wrapper
>
> This worked by a mix of direct flag manipulation and checking for
> existence of a pinned GGTT VMA.
>
> With the introduction of rotated display mappings this approach is
> no longer correct.
>
> New simpler approach is to just keep this count over calls which pin and
> unpin objects to and from display.
>
> (Inspired and extracted code from a larger rework by Chris Wilson.)

Hmm, given a stuck pageflip worker we can easily end up with the same
object pinned into the display plane several times. (If that is not enough
to convince, think about async pageflips and a low priority worker.)
Multiply that over each CRTC doing its own pinning and it is quite easy
to run afoul of I915_MAX_PIN_DISPLAY. I was thinking that having the
counter on the vma was cleaner, but in retrospect I think we just want a
full counter on the object.
-Chris

--
Chris Wilson, Intel Open Source Technology Centre