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 v3 3/6] drm/i915: Clean up fbc vs. plane checks
Date: Thu, 22 Feb 2018 18:15:23 +0200 [thread overview]
Message-ID: <20180222161523.GZ5453@intel.com> (raw)
In-Reply-To: <20180222140753.GW5453@intel.com>
On Thu, Feb 22, 2018 at 04:07:53PM +0200, Ville Syrjälä wrote:
> On Wed, Feb 21, 2018 at 09:59:27PM +0000, Chris Wilson wrote:
> > Quoting Ville Syrjala (2018-02-21 17:31:01)
> > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > >
> > > Let's record the information whether a plane can do fbc or not under
> > > struct inte_plane.
> > >
> > > v2: Rebase due to i9xx_plane_id
> > > Handle BDW/HSW correctly
> > > v3: Move inte_fbc_init() back since we depend on it happening
> > > even with i915.disable_display, and populate
> > > fbc->possible_framebuffer_bits directly from the
> > > plane init code instead
> > >
> > > 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 | 41 ++++++++++++++++++++++++++++++++++++
> > > drivers/gpu/drm/i915/intel_drv.h | 1 +
> > > drivers/gpu/drm/i915/intel_fbc.c | 26 ++---------------------
> > > 3 files changed, 44 insertions(+), 24 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > > index d2a66704e6f5..c60d2215b377 100644
> > > --- a/drivers/gpu/drm/i915/intel_display.c
> > > +++ b/drivers/gpu/drm/i915/intel_display.c
> > > @@ -13238,6 +13238,32 @@ static const struct drm_plane_funcs intel_cursor_plane_funcs = {
> > > .format_mod_supported = intel_cursor_plane_format_mod_supported,
> > > };
> > >
> > > +static bool i9xx_plane_has_fbc(struct drm_i915_private *dev_priv,
> > > + enum i9xx_plane_id i9xx_plane)
> > > +{
> > > + if (!HAS_FBC(dev_priv))
> > > + return false;
> >
> > > -static inline bool fbc_on_pipe_a_only(struct drm_i915_private *dev_priv)
> > > -{
> > > - return IS_HASWELL(dev_priv) || INTEL_GEN(dev_priv) >= 8;
> > > -}
> > > -
> > > -static inline bool fbc_on_plane_a_only(struct drm_i915_private *dev_priv)
> > > -{
> > > - return INTEL_GEN(dev_priv) < 4;
> > > -}
> >
> > > +
> > > + if (IS_BROADWELL(dev_priv) || IS_HASWELL(dev_priv))
> > > + return i9xx_plane == PLANE_A;
> >
> > Where PLANE_A is tied to PIPE_A by construction. Is that worth a quick
> > comment?
>
> Wouldn't hurt to spell it out I suppose.
Note added and series pushed to dinq. Thanks for the review.
I'll think a bit more about the need_fence thing and try to come up
a followup patch/series.
>
> >
> > > + else if (IS_IVYBRIDGE(dev_priv))
> > > + return i9xx_plane == PLANE_A || i9xx_plane == PLANE_B ||
> > > + i9xx_plane == PLANE_C;
> > > + else if (INTEL_GEN(dev_priv) >= 4)
> > > + return i9xx_plane == PLANE_A || i9xx_plane == PLANE_B;
> > > + else
> > > + return i9xx_plane == PLANE_A;
> >
> > Ok, looks a bit more complete than before.
> >
> > > +}
> > > +
> > > +static bool skl_plane_has_fbc(struct drm_i915_private *dev_priv,
> > > + enum pipe pipe, enum plane_id plane_id)
> > > +{
> > > + if (!HAS_FBC(dev_priv))
> > > + return false;
> > > +
> > > + return pipe == PIPE_A && plane_id == PLANE_PRIMARY;
> > > +}
> > > +
> > > static struct intel_plane *
> > > intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
> > > {
> > > @@ -13280,6 +13306,21 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
> > > primary->i9xx_plane = (enum i9xx_plane_id) pipe;
> > > primary->id = PLANE_PRIMARY;
> > > primary->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, primary->id);
> > > +
> > > + if (INTEL_GEN(dev_priv) >= 9)
> > > + primary->has_fbc = skl_plane_has_fbc(dev_priv,
> > > + primary->pipe,
> > > + primary->id);
> > > + else
> > > + primary->has_fbc = i9xx_plane_has_fbc(dev_priv,
> > > + primary->i9xx_plane);
> > > +
> > > + if (primary->has_fbc) {
> > > + struct intel_fbc *fbc = &dev_priv->fbc;
> > > +
> > > + fbc->possible_framebuffer_bits |= primary->frontbuffer_bit;
> > > + }
> >
> > So an equivalent init loop to
> >
> > > - for_each_pipe(dev_priv, pipe) {
> > > - fbc->possible_framebuffer_bits |=
> > > - INTEL_FRONTBUFFER(pipe, PLANE_PRIMARY);
> > > -
> > > - if (fbc_on_pipe_a_only(dev_priv))
> > > - break;
> > > - }
> >
> > Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
> > -Chris
>
> --
> Ville Syrjälä
> Intel OTC
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-02-22 16:15 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ä
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ä [this message]
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=20180222161523.GZ5453@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox