From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 7/9] drm/i915: Switch fbc over to for_each_new_intel_plane_in_state()
Date: Fri, 13 Oct 2017 13:38:32 +0300 [thread overview]
Message-ID: <20171013103832.GW10981@intel.com> (raw)
In-Reply-To: <20171012192107.zxihvpl3elbkouxk@phenom.ffwll.local>
On Thu, Oct 12, 2017 at 09:21:07PM +0200, Daniel Vetter wrote:
> On Wed, Oct 11, 2017 at 07:04:53PM +0300, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Stop using the old for_each_intel_plane_in_state() type iteration
> > macro and replace it with for_each_new_intel_plane_in_state().
> > And similarly replace drm_atomic_get_existing_crtc_state() with
> > intel_atomic_get_new_crtc_state(). Switch over to intel_ types
> > as well to make the code less cluttered.
> >
> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> > drivers/gpu/drm/i915/i915_drv.h | 7 +++----
> > drivers/gpu/drm/i915/intel_display.c | 2 +-
> > drivers/gpu/drm/i915/intel_drv.h | 2 +-
> > drivers/gpu/drm/i915/intel_fbc.c | 23 ++++++++++-------------
> > 4 files changed, 15 insertions(+), 19 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> > index df120a38ae42..9c4735da2169 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.h
> > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > @@ -561,13 +561,13 @@ struct i915_hotplug {
> > for_each_power_well_rev(__dev_priv, __power_well) \
> > for_each_if ((__power_well)->domains & (__domain_mask))
> >
> > -#define for_each_intel_plane_in_state(__state, plane, plane_state, __i) \
> > +#define for_each_new_intel_plane_in_state(__state, plane, new_plane_state, __i) \
> > for ((__i) = 0; \
> > (__i) < (__state)->base.dev->mode_config.num_total_plane && \
> > ((plane) = to_intel_plane((__state)->base.planes[__i].ptr), \
> > - (plane_state) = to_intel_plane_state((__state)->base.planes[__i].state), 1); \
> > + (new_plane_state) = to_intel_plane_state((__state)->base.planes[__i].new_state), 1); \
> > (__i)++) \
> > - for_each_if (plane_state)
> > + for_each_if (plane)
> >
> > #define for_each_new_intel_crtc_in_state(__state, crtc, new_crtc_state, __i) \
> > for ((__i) = 0; \
> > @@ -577,7 +577,6 @@ struct i915_hotplug {
> > (__i)++) \
> > for_each_if (crtc)
>
> Would be nice to co-evolve our versions of these along the lines of
>
> commit 331494eb51002d0ee99414e3918e06d5e9a3962d
> Author: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Date: Wed Sep 27 10:35:32 2017 +0200
>
> drm/atomic: Make atomic iterators less surprising
Indeed. The same idea popped into my head when I saw Maarten's patch,
but apparently I forgot to reply to the patch to propose it.
>
> On the patch itself:
>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>
> >
> > -
> > #define for_each_oldnew_intel_plane_in_state(__state, plane, old_plane_state, new_plane_state, __i) \
> > for ((__i) = 0; \
> > (__i) < (__state)->base.dev->mode_config.num_total_plane && \
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index 82be2342d1c6..ccdfd922fe5b 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -12025,7 +12025,7 @@ static int intel_atomic_check(struct drm_device *dev,
> > if (ret)
> > return ret;
> >
> > - intel_fbc_choose_crtc(dev_priv, state);
> > + intel_fbc_choose_crtc(dev_priv, intel_state);
> > return calc_watermark_data(state);
> > }
> >
> > diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> > index 08318260453b..0852b33712b1 100644
> > --- a/drivers/gpu/drm/i915/intel_drv.h
> > +++ b/drivers/gpu/drm/i915/intel_drv.h
> > @@ -1645,7 +1645,7 @@ static inline void intel_fbdev_restore_mode(struct drm_device *dev)
> >
> > /* intel_fbc.c */
> > void intel_fbc_choose_crtc(struct drm_i915_private *dev_priv,
> > - struct drm_atomic_state *state);
> > + struct intel_atomic_state *state);
> > bool intel_fbc_is_active(struct drm_i915_private *dev_priv);
> > void intel_fbc_pre_update(struct intel_crtc *crtc,
> > struct intel_crtc_state *crtc_state,
> > diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c
> > index 8e3a05505f49..0b40b89f8e2b 100644
> > --- a/drivers/gpu/drm/i915/intel_fbc.c
> > +++ b/drivers/gpu/drm/i915/intel_fbc.c
> > @@ -1051,11 +1051,11 @@ void intel_fbc_flush(struct drm_i915_private *dev_priv,
> > * enable FBC for the chosen CRTC. If it does, it will set dev_priv->fbc.crtc.
> > */
> > void intel_fbc_choose_crtc(struct drm_i915_private *dev_priv,
> > - struct drm_atomic_state *state)
> > + struct intel_atomic_state *state)
> > {
> > struct intel_fbc *fbc = &dev_priv->fbc;
> > - struct drm_plane *plane;
> > - struct drm_plane_state *plane_state;
> > + struct intel_plane *plane;
> > + struct intel_plane_state *plane_state;
> > bool crtc_chosen = false;
> > int i;
> >
> > @@ -1063,7 +1063,7 @@ void intel_fbc_choose_crtc(struct drm_i915_private *dev_priv,
> >
> > /* Does this atomic commit involve the CRTC currently tied to FBC? */
> > if (fbc->crtc &&
> > - !drm_atomic_get_existing_crtc_state(state, &fbc->crtc->base))
> > + !intel_atomic_get_new_crtc_state(state, fbc->crtc))
> > goto out;
> >
> > if (!intel_fbc_can_enable(dev_priv))
> > @@ -1073,13 +1073,11 @@ void intel_fbc_choose_crtc(struct drm_i915_private *dev_priv,
> > * plane. We could go for fancier schemes such as checking the plane
> > * size, but this would just affect the few platforms that don't tie FBC
> > * to pipe or plane A. */
> > - for_each_new_plane_in_state(state, plane, plane_state, i) {
> > - struct intel_plane_state *intel_plane_state =
> > - to_intel_plane_state(plane_state);
> > - struct intel_crtc_state *intel_crtc_state;
> > - struct intel_crtc *crtc = to_intel_crtc(plane_state->crtc);
> > + for_each_new_intel_plane_in_state(state, plane, plane_state, i) {
> > + struct intel_crtc_state *crtc_state;
> > + struct intel_crtc *crtc = to_intel_crtc(plane_state->base.crtc);
> >
> > - if (!intel_plane_state->base.visible)
> > + if (!plane_state->base.visible)
> > continue;
> >
> > if (fbc_on_pipe_a_only(dev_priv) && crtc->pipe != PIPE_A)
> > @@ -1088,10 +1086,9 @@ void intel_fbc_choose_crtc(struct drm_i915_private *dev_priv,
> > if (fbc_on_plane_a_only(dev_priv) && crtc->plane != PLANE_A)
> > continue;
> >
> > - intel_crtc_state = to_intel_crtc_state(
> > - drm_atomic_get_existing_crtc_state(state, &crtc->base));
> > + crtc_state = intel_atomic_get_new_crtc_state(state, crtc);
> >
> > - intel_crtc_state->enable_fbc = true;
> > + crtc_state->enable_fbc = true;
> > crtc_chosen = true;
> > break;
> > }
> > --
> > 2.13.6
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
--
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:[~2017-10-13 10:38 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-11 16:04 [PATCH 0/9] drm/i915: Plane assert/readout cleanups etc Ville Syrjala
2017-10-11 16:04 ` [PATCH 1/9] drm/i915: Add .get_hw_state() method for planes Ville Syrjala
2017-10-12 18:59 ` Daniel Vetter
2017-10-13 10:31 ` Ville Syrjälä
2017-10-11 16:04 ` [PATCH 2/9] drm/i915: Redo plane sanitation during readout Ville Syrjala
2017-10-12 19:03 ` Daniel Vetter
2017-10-11 16:04 ` [PATCH 3/9] drm/i915: s/enum plane/enum old_plane_id/ Ville Syrjala
2017-10-12 19:06 ` Daniel Vetter
2017-10-13 10:35 ` Ville Syrjälä
2017-10-16 15:57 ` Daniel Vetter
2017-10-11 16:04 ` [PATCH 4/9] drm/i915: Use enum old_plane_id for the .get_fifo_size() hooks Ville Syrjala
2017-10-12 19:08 ` Daniel Vetter
2017-10-11 16:04 ` [PATCH 5/9] drm/i915: Cleanup enum pipe/enum plane_id/enum old_plane_id in initial fb readout Ville Syrjala
2017-10-12 19:11 ` Daniel Vetter
2017-10-11 16:04 ` [PATCH 6/9] drm/i915: Nuke ironlake_get_initial_plane_config() Ville Syrjala
2017-10-12 19:17 ` Daniel Vetter
2017-10-13 10:36 ` Ville Syrjälä
2017-10-11 16:04 ` [PATCH 7/9] drm/i915: Switch fbc over to for_each_new_intel_plane_in_state() Ville Syrjala
2017-10-12 19:21 ` Daniel Vetter
2017-10-13 10:38 ` Ville Syrjälä [this message]
2017-10-11 16:04 ` [PATCH 8/9] drm/i915: Nuke crtc->plane Ville Syrjala
2017-10-12 19:38 ` Daniel Vetter
2017-10-13 10:41 ` Ville Syrjälä
2017-10-11 16:04 ` [PATCH 9/9] drm/i915: Add windowing for primary planes on gen2/3 and chv Ville Syrjala
2017-10-12 19:42 ` Daniel Vetter
2017-10-11 16:21 ` [PATCH 0/9] drm/i915: Plane assert/readout cleanups etc Alex Villacis Lasso
2017-10-11 16:38 ` Ville Syrjälä
2017-10-13 16:28 ` Alex Villacis Lasso
[not found] ` <c5c1b3e5-4640-9df7-45a7-4228802142f9@hotmail.com>
2017-10-14 6:45 ` Alex Villacis Lasso
2017-10-16 14:55 ` Jani Nikula
2017-10-16 15:13 ` Alex Villacís Lasso
2017-10-11 17:20 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-10-11 23:43 ` ✓ Fi.CI.IGT: " Patchwork
2017-10-12 11:35 ` [PATCH 0/9] " Thierry Reding
2017-10-12 12:19 ` Ville Syrjälä
2017-10-12 13:29 ` Thierry Reding
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=20171013103832.GW10981@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=daniel@ffwll.ch \
--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.