All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/6] drm/i915: Fail if we can't get a fence for gen2/3 tiled scanout
Date: Thu, 22 Feb 2018 16:13:34 +0200	[thread overview]
Message-ID: <20180222141334.GX5453@intel.com> (raw)
In-Reply-To: <151924992474.11316.6628255171226396657@mail.alporthouse.com>

On Wed, Feb 21, 2018 at 09:52:04PM +0000, Chris Wilson wrote:
> Quoting Ville Syrjala (2018-02-21 16:02:30)
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > Gen2/3 display engine depends on the fence for tiled scanout. So if we
> > fail to get a fence fail the entire operation.
> > 
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_display.c | 10 +++++++++-
> >  1 file changed, 9 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index 5d46771d58f6..66b269bc24b9 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -2123,6 +2123,8 @@ intel_pin_and_fence_fb_obj(struct drm_framebuffer *fb,
> >                 goto err;
> >  
> >         if (i915_vma_is_map_and_fenceable(vma)) {
> > +               int ret;
> > +
> >                 /* Install a fence for tiled scan-out. Pre-i965 always needs a
> >                  * fence, whereas 965+ only requires a fence if using
> >                  * framebuffer compression.  For simplicity, we always, when
> > @@ -2139,7 +2141,13 @@ intel_pin_and_fence_fb_obj(struct drm_framebuffer *fb,
> >                  * something and try to run the system in a "less than optimal"
> >                  * mode that matches the user configuration.
> >                  */
> > -               if (i915_vma_pin_fence(vma) == 0 && vma->fence)
> > +               ret = i915_vma_pin_fence(vma);
> > +               if (ret != 0 && INTEL_GEN(dev_priv) < 4) {
> > +                       vma = ERR_PTR(ret);
> > +                       goto err;
> > +               }
> > +
> > +               if (ret == 0 && vma->fence)
> >                         *out_flags |= PLANE_HAS_FENCE;
> >         }
> 
> Ok, I'd like to see INTEL_GEN(dev_priv) < 4 be replaced with say
> needs_fence (and may be passed in from the caller like wants_fence?).

I had that earlier, but then I didn't have the uses_fence. Maybe I
cook up some kind of input flags thing here with PLANE_NEEDS_FENCE
and PLANE_WANTS_FENCE (maybe with a better naming scheme to
distinguish from the output flags, or should we just share the
same namespace?).

And should we then move the gmch check out and instead have something
like PLANE_NEEDS_MAPPABLE?

> Then I'm wondering if a 
> 	if (WARN_ON(needs_fence && !(*flags & PLANE_HAS_FENCE))
> makes sense.

Just to make sure i915_vma_pin_fence() did its job correctly?

> 
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
> -Chris

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-02-22 14:13 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-21 16:02 [PATCH 0/6] drm/i915: Scanout fence fixes/cleanups Ville Syrjala
2018-02-21 16:02 ` [PATCH 1/6] drm/i915: Fail if we can't get a fence for gen2/3 tiled scanout Ville Syrjala
2018-02-21 21:52   ` Chris Wilson
2018-02-22 14:13     ` Ville Syrjälä [this message]
2018-02-22 14:21       ` Chris Wilson
2018-02-21 16:02 ` [PATCH 2/6] drm/i915: Only pin the fence for primary planes (and gen2/3) Ville Syrjala
2018-02-21 18:48   ` [PATCH v2 " Ville Syrjala
2018-02-21 12:23     ` Guang (George) Bai
2018-02-21 21:53     ` Chris Wilson
2018-02-21 16:02 ` [PATCH 3/6] drm/i915: Clean up fbc vs. plane checks Ville Syrjala
2018-02-21 17:31   ` [PATCH v3 " Ville Syrjala
2018-02-21 21:59     ` Chris Wilson
2018-02-22 14:07       ` Ville Syrjälä
2018-02-22 16:15         ` Ville Syrjälä
2018-02-21 16:02 ` [PATCH 4/6] drm/i915: Require fence only for FBC capable planes Ville Syrjala
2018-02-21 22:00   ` Chris Wilson
2018-02-21 16:02 ` [PATCH 5/6] drm/i915: Extract intel_plane_{pin, unpin}_fb() Ville Syrjala
2018-02-21 22:02   ` Chris Wilson
2018-02-21 16:02 ` [PATCH 6/6] drm/i915: Add a FIXME about FBC vs. fence. 90/270 degree rotation Ville Syrjala
2018-02-21 22:04   ` Chris Wilson
2018-02-21 16:28 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Scanout fence fixes/cleanups Patchwork
2018-02-21 16:44 ` ✗ Fi.CI.BAT: failure " Patchwork
2018-02-21 18:00 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Scanout fence fixes/cleanups (rev2) Patchwork
2018-02-21 18:15 ` ✗ Fi.CI.BAT: failure " Patchwork
2018-02-21 19:35 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Scanout fence fixes/cleanups (rev3) Patchwork
2018-02-21 19:51 ` ✓ Fi.CI.BAT: success " Patchwork
2018-02-22  0:30 ` ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180222141334.GX5453@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.