From: Karthik B S <karthik.b.s@intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v2 05/11] drm/i915: Add plane vfuncs to enable/disable flip_done interrupt
Date: Fri, 15 Jan 2021 17:08:07 +0530 [thread overview]
Message-ID: <dadc3969-2363-0b27-f15f-8a90773d1a77@intel.com> (raw)
In-Reply-To: <20210111163711.12913-6-ville.syrjala@linux.intel.com>
On 1/11/2021 10:07 PM, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Prepare for more platforms with async flip support by turning
> the flip_done interrupt enable/disable into plane vfuncs.
>
> Cc: Karthik B S <karthik.b.s@intel.com>
> Cc: Vandita Kulkarni <vandita.kulkarni@intel.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Looks good to me.
Reviewed-by: Karthik B S <karthik.b.s@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_display.c | 42 +++++++++++++++++--
> .../drm/i915/display/intel_display_types.h | 2 +
> drivers/gpu/drm/i915/display/intel_sprite.c | 27 +++++++++++-
> drivers/gpu/drm/i915/i915_irq.c | 26 ------------
> drivers/gpu/drm/i915/i915_irq.h | 3 --
> 5 files changed, 67 insertions(+), 33 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 1ad92fcaee7b..f12b74cfe974 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -6133,6 +6133,42 @@ static void intel_post_plane_update(struct intel_atomic_state *state,
> icl_wa_scalerclkgating(dev_priv, pipe, false);
> }
>
> +static void intel_crtc_enable_flip_done(struct intel_atomic_state *state,
> + struct intel_crtc *crtc)
> +{
> + const struct intel_crtc_state *crtc_state =
> + intel_atomic_get_new_crtc_state(state, crtc);
> + u8 update_planes = crtc_state->update_planes;
> + const struct intel_plane_state *plane_state;
> + struct intel_plane *plane;
> + int i;
> +
> + for_each_new_intel_plane_in_state(state, plane, plane_state, i) {
> + if (plane->enable_flip_done &&
> + plane->pipe == crtc->pipe &&
> + update_planes & BIT(plane->id))
> + plane->enable_flip_done(plane);
> + }
> +}
> +
> +static void intel_crtc_disable_flip_done(struct intel_atomic_state *state,
> + struct intel_crtc *crtc)
> +{
> + const struct intel_crtc_state *crtc_state =
> + intel_atomic_get_new_crtc_state(state, crtc);
> + u8 update_planes = crtc_state->update_planes;
> + const struct intel_plane_state *plane_state;
> + struct intel_plane *plane;
> + int i;
> +
> + for_each_new_intel_plane_in_state(state, plane, plane_state, i) {
> + if (plane->disable_flip_done &&
> + plane->pipe == crtc->pipe &&
> + update_planes & BIT(plane->id))
> + plane->disable_flip_done(plane);
> + }
> +}
> +
> static void skl_disable_async_flip_wa(struct intel_atomic_state *state,
> struct intel_crtc *crtc,
> const struct intel_crtc_state *new_crtc_state)
> @@ -14333,7 +14369,7 @@ static void kill_bigjoiner_slave(struct intel_atomic_state *state,
> * Async flip can only change the plane surface address, so anything else
> * changing is rejected from the intel_atomic_check_async() function.
> * Once this check is cleared, flip done interrupt is enabled using
> - * the skl_enable_flip_done() function.
> + * the intel_crtc_enable_flip_done() function.
> *
> * As soon as the surface address register is written, flip done interrupt is
> * generated and the requested events are sent to the usersapce in the interrupt
> @@ -15289,7 +15325,7 @@ static void intel_atomic_commit_tail(struct intel_atomic_state *state)
>
> for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i) {
> if (new_crtc_state->uapi.async_flip)
> - skl_enable_flip_done(crtc);
> + intel_crtc_enable_flip_done(state, crtc);
> }
>
> /* Now enable the clocks, plane, pipe, and connectors that we set up. */
> @@ -15314,7 +15350,7 @@ static void intel_atomic_commit_tail(struct intel_atomic_state *state)
>
> for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i) {
> if (new_crtc_state->uapi.async_flip)
> - skl_disable_flip_done(crtc);
> + intel_crtc_disable_flip_done(state, crtc);
>
> if (new_crtc_state->hw.active &&
> !intel_crtc_needs_modeset(new_crtc_state) &&
> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
> index 1067bd073c95..255648ab0fa7 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> @@ -1258,6 +1258,8 @@ struct intel_plane {
> void (*async_flip)(struct intel_plane *plane,
> const struct intel_crtc_state *crtc_state,
> const struct intel_plane_state *plane_state);
> + void (*enable_flip_done)(struct intel_plane *plane);
> + void (*disable_flip_done)(struct intel_plane *plane);
> };
>
> struct intel_watermark_params {
> diff --git a/drivers/gpu/drm/i915/display/intel_sprite.c b/drivers/gpu/drm/i915/display/intel_sprite.c
> index 0a5648d5dcf8..8e01cd4ebe36 100644
> --- a/drivers/gpu/drm/i915/display/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/display/intel_sprite.c
> @@ -958,6 +958,28 @@ skl_plane_get_hw_state(struct intel_plane *plane,
> return ret;
> }
>
> +static void
> +skl_plane_enable_flip_done(struct intel_plane *plane)
> +{
> + struct drm_i915_private *i915 = to_i915(plane->base.dev);
> + enum pipe pipe = plane->pipe;
> +
> + spin_lock_irq(&i915->irq_lock);
> + bdw_enable_pipe_irq(i915, pipe, GEN9_PIPE_PLANE_FLIP_DONE(plane->id));
> + spin_unlock_irq(&i915->irq_lock);
> +}
> +
> +static void
> +skl_plane_disable_flip_done(struct intel_plane *plane)
> +{
> + struct drm_i915_private *i915 = to_i915(plane->base.dev);
> + enum pipe pipe = plane->pipe;
> +
> + spin_lock_irq(&i915->irq_lock);
> + bdw_disable_pipe_irq(i915, pipe, GEN9_PIPE_PLANE_FLIP_DONE(plane->id));
> + spin_unlock_irq(&i915->irq_lock);
> +}
> +
> static void i9xx_plane_linear_gamma(u16 gamma[8])
> {
> /* The points are not evenly spaced. */
> @@ -3310,8 +3332,11 @@ skl_universal_plane_create(struct drm_i915_private *dev_priv,
> plane->check_plane = skl_plane_check;
> plane->min_cdclk = skl_plane_min_cdclk;
>
> - if (plane_id == PLANE_PRIMARY)
> + if (plane_id == PLANE_PRIMARY) {
> plane->async_flip = skl_plane_async_flip;
> + plane->enable_flip_done = skl_plane_enable_flip_done;
> + plane->disable_flip_done = skl_plane_disable_flip_done;
> + }
>
> if (INTEL_GEN(dev_priv) >= 11)
> formats = icl_get_plane_formats(dev_priv, pipe,
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index 4484609d870d..33019cf0e630 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -2822,19 +2822,6 @@ int bdw_enable_vblank(struct drm_crtc *crtc)
> return 0;
> }
>
> -void skl_enable_flip_done(struct intel_crtc *crtc)
> -{
> - struct drm_i915_private *i915 = to_i915(crtc->base.dev);
> - enum pipe pipe = crtc->pipe;
> - unsigned long irqflags;
> -
> - spin_lock_irqsave(&i915->irq_lock, irqflags);
> -
> - bdw_enable_pipe_irq(i915, pipe, GEN9_PIPE_PLANE1_FLIP_DONE);
> -
> - spin_unlock_irqrestore(&i915->irq_lock, irqflags);
> -}
> -
> /* Called from drm generic code, passed 'crtc' which
> * we use as a pipe index
> */
> @@ -2899,19 +2886,6 @@ void bdw_disable_vblank(struct drm_crtc *crtc)
> spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
> }
>
> -void skl_disable_flip_done(struct intel_crtc *crtc)
> -{
> - struct drm_i915_private *i915 = to_i915(crtc->base.dev);
> - enum pipe pipe = crtc->pipe;
> - unsigned long irqflags;
> -
> - spin_lock_irqsave(&i915->irq_lock, irqflags);
> -
> - bdw_disable_pipe_irq(i915, pipe, GEN9_PIPE_PLANE1_FLIP_DONE);
> -
> - spin_unlock_irqrestore(&i915->irq_lock, irqflags);
> -}
> -
> static void ibx_irq_reset(struct drm_i915_private *dev_priv)
> {
> struct intel_uncore *uncore = &dev_priv->uncore;
> diff --git a/drivers/gpu/drm/i915/i915_irq.h b/drivers/gpu/drm/i915/i915_irq.h
> index 2efe609519ca..25f25cd95818 100644
> --- a/drivers/gpu/drm/i915/i915_irq.h
> +++ b/drivers/gpu/drm/i915/i915_irq.h
> @@ -118,9 +118,6 @@ void i965_disable_vblank(struct drm_crtc *crtc);
> void ilk_disable_vblank(struct drm_crtc *crtc);
> void bdw_disable_vblank(struct drm_crtc *crtc);
>
> -void skl_enable_flip_done(struct intel_crtc *crtc);
> -void skl_disable_flip_done(struct intel_crtc *crtc);
> -
> void gen2_irq_reset(struct intel_uncore *uncore);
> void gen3_irq_reset(struct intel_uncore *uncore, i915_reg_t imr,
> i915_reg_t iir, i915_reg_t ier);
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2021-01-15 11:38 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-11 16:37 [Intel-gfx] [PATCH v2 00/11] drm/i915: Async flips for all ilk+ platforms Ville Syrjala
2021-01-11 16:37 ` [Intel-gfx] [PATCH v2 01/11] drm/i915: WARN if plane src coords are too big Ville Syrjala
2021-01-27 11:11 ` Karthik B S
2021-01-11 16:37 ` [Intel-gfx] [PATCH v2 02/11] drm/i915: Limit plane stride to below TILEOFF.x limit Ville Syrjala
2021-01-28 9:41 ` Karthik B S
2021-01-11 16:37 ` [Intel-gfx] [PATCH v2 03/11] drm/i915: Drop redundant parens Ville Syrjala
2021-01-15 10:19 ` Karthik B S
2021-01-11 16:37 ` [Intel-gfx] [PATCH v2 04/11] drm/i915: Generalize the async flip capability check Ville Syrjala
2021-01-15 10:23 ` Karthik B S
2021-01-11 16:37 ` [Intel-gfx] [PATCH v2 05/11] drm/i915: Add plane vfuncs to enable/disable flip_done interrupt Ville Syrjala
2021-01-15 11:38 ` Karthik B S [this message]
2021-01-11 16:37 ` [Intel-gfx] [PATCH v2 06/11] drm/i915: Move the async_flip bit setup into the .async_flip() hook Ville Syrjala
2021-01-15 11:40 ` Karthik B S
2021-01-11 16:37 ` [Intel-gfx] [PATCH v2 07/11] drm/i915: Reuse the async_flip() hook for the async flip disable w/a Ville Syrjala
2021-01-18 9:27 ` Karthik B S
2021-01-11 16:37 ` [Intel-gfx] [PATCH v2 08/11] drm/i915: Implement async flips for bdw Ville Syrjala
2021-01-18 9:44 ` Karthik B S
2021-01-11 16:37 ` [Intel-gfx] [PATCH v2 09/11] drm/i915: Implement async flip for ivb/hsw Ville Syrjala
2021-01-18 10:45 ` Karthik B S
2021-01-11 16:37 ` [Intel-gfx] [PATCH v2 10/11] drm/i915: Implement async flip for ilk/snb Ville Syrjala
2021-01-18 11:08 ` Karthik B S
2021-01-11 16:37 ` [Intel-gfx] [PATCH v2 11/11] drm/i915: Implement async flips for vlv/chv Ville Syrjala
2021-01-27 8:09 ` Karthik B S
2021-01-11 17:23 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Async flips for all ilk+ platforms (rev2) Patchwork
2021-01-11 18:58 ` [Intel-gfx] ✓ 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=dadc3969-2363-0b27-f15f-8a90773d1a77@intel.com \
--to=karthik.b.s@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=ville.syrjala@linux.intel.com \
/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