All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Roper <matthew.d.roper@intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 04/15] drm/i915: Replace call to commit_planes_on_crtc with internal update, v2.
Date: Wed, 19 Sep 2018 17:13:13 -0700	[thread overview]
Message-ID: <20180920001313.GI31331@mdroper-desk.amr.corp.intel.com> (raw)
In-Reply-To: <20180919135644.14182-5-maarten.lankhorst@linux.intel.com>

On Wed, Sep 19, 2018 at 03:56:33PM +0200, Maarten Lankhorst wrote:
> drm_atomic_helper_commit_planes_on_crtc calls begin_commit,
> then plane_update hooks, then flush_commit. Because we keep our own
> visibility tracking through plane_state->visible there's no need to
> rely on the atomic hooks for this.
> 
> By explicitly writing our own helper, we can update visible planes
> as needed, which is useful to make NV12 support work as intended.
> 
> Changes since v1:
> - Reword commit message. (Matt Roper)
> - Rename to intel_update_planes_on_crtc(). (Matt)
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>

Reviewed-by: Matt Roper <matthew.d.roper@intel.com>

This patch does leave drm_atomic_helper_commit_planes_on_crtc() unused
by any driver.  Not sure if we need to follow up with a patch to remove
it as dead code, or whether we anticipate other drivers wanting to use
it soon.


Matt

> ---
>  drivers/gpu/drm/i915/intel_atomic_plane.c | 41 ++++++++++++-----------
>  drivers/gpu/drm/i915/intel_display.c      | 10 ++++--
>  drivers/gpu/drm/i915/intel_drv.h          |  4 +++
>  3 files changed, 33 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_atomic_plane.c b/drivers/gpu/drm/i915/intel_atomic_plane.c
> index aabebe0d2e9b..e067fb531a29 100644
> --- a/drivers/gpu/drm/i915/intel_atomic_plane.c
> +++ b/drivers/gpu/drm/i915/intel_atomic_plane.c
> @@ -164,29 +164,33 @@ static int intel_plane_atomic_check(struct drm_plane *plane,
>  						   to_intel_plane_state(new_plane_state));
>  }
>  
> -static void intel_plane_atomic_update(struct drm_plane *plane,
> -				      struct drm_plane_state *old_state)
> +void intel_update_planes_on_crtc(struct intel_atomic_state *old_state,
> +				 struct intel_crtc *crtc,
> +				 struct intel_crtc_state *old_crtc_state,
> +				 struct intel_crtc_state *new_crtc_state)
>  {
> -	struct intel_atomic_state *state = to_intel_atomic_state(old_state->state);
> -	struct intel_plane *intel_plane = to_intel_plane(plane);
> -	const struct intel_plane_state *new_plane_state =
> -		intel_atomic_get_new_plane_state(state, intel_plane);
> -	struct drm_crtc *crtc = new_plane_state->base.crtc ?: old_state->crtc;
> +	struct intel_plane_state *new_plane_state;
> +	struct intel_plane *plane;
> +	u32 update_mask;
> +	int i;
> +
> +	update_mask = old_crtc_state->active_planes;
> +	update_mask |= new_crtc_state->active_planes;
>  
> -	if (new_plane_state->base.visible) {
> -		const struct intel_crtc_state *new_crtc_state =
> -			intel_atomic_get_new_crtc_state(state, to_intel_crtc(crtc));
> +	for_each_new_intel_plane_in_state(old_state, plane, new_plane_state, i) {
> +		if (crtc->pipe != plane->pipe ||
> +		    !(update_mask & BIT(plane->id)))
> +			continue;
>  
> -		trace_intel_update_plane(plane,
> -					 to_intel_crtc(crtc));
> +		if (new_plane_state->base.visible) {
> +			trace_intel_update_plane(&plane->base, crtc);
>  
> -		intel_plane->update_plane(intel_plane,
> -					  new_crtc_state, new_plane_state);
> -	} else {
> -		trace_intel_disable_plane(plane,
> -					  to_intel_crtc(crtc));
> +			plane->update_plane(plane, new_crtc_state, new_plane_state);
> +		} else {
> +			trace_intel_disable_plane(&plane->base, crtc);
>  
> -		intel_plane->disable_plane(intel_plane, to_intel_crtc(crtc));
> +			plane->disable_plane(plane, crtc);
> +		}
>  	}
>  }
>  
> @@ -194,7 +198,6 @@ const struct drm_plane_helper_funcs intel_plane_helper_funcs = {
>  	.prepare_fb = intel_prepare_plane_fb,
>  	.cleanup_fb = intel_cleanup_plane_fb,
>  	.atomic_check = intel_plane_atomic_check,
> -	.atomic_update = intel_plane_atomic_update,
>  };
>  
>  /**
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index f7982f18b8fe..3975f3af4fb4 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -10813,8 +10813,6 @@ static int intel_crtc_atomic_check(struct drm_crtc *crtc,
>  }
>  
>  static const struct drm_crtc_helper_funcs intel_helper_funcs = {
> -	.atomic_begin = intel_begin_crtc_commit,
> -	.atomic_flush = intel_finish_crtc_commit,
>  	.atomic_check = intel_crtc_atomic_check,
>  };
>  
> @@ -12483,6 +12481,7 @@ static void intel_update_crtc(struct drm_crtc *crtc,
>  	struct drm_device *dev = crtc->dev;
>  	struct drm_i915_private *dev_priv = to_i915(dev);
>  	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> +	struct intel_crtc_state *old_intel_cstate = to_intel_crtc_state(old_crtc_state);
>  	struct intel_crtc_state *pipe_config = to_intel_crtc_state(new_crtc_state);
>  	bool modeset = needs_modeset(new_crtc_state);
>  	struct intel_plane_state *new_plane_state =
> @@ -12503,7 +12502,12 @@ static void intel_update_crtc(struct drm_crtc *crtc,
>  	if (new_plane_state)
>  		intel_fbc_enable(intel_crtc, pipe_config, new_plane_state);
>  
> -	drm_atomic_helper_commit_planes_on_crtc(old_crtc_state);
> +	intel_begin_crtc_commit(crtc, old_crtc_state);
> +
> +	intel_update_planes_on_crtc(to_intel_atomic_state(state), intel_crtc,
> +				    old_intel_cstate, pipe_config);
> +
> +	intel_finish_crtc_commit(crtc, old_crtc_state);
>  }
>  
>  static void intel_update_crtcs(struct drm_atomic_state *state)
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index bf1c38728a59..8073a85d7178 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -2188,6 +2188,10 @@ struct drm_plane_state *intel_plane_duplicate_state(struct drm_plane *plane);
>  void intel_plane_destroy_state(struct drm_plane *plane,
>  			       struct drm_plane_state *state);
>  extern const struct drm_plane_helper_funcs intel_plane_helper_funcs;
> +void intel_update_planes_on_crtc(struct intel_atomic_state *old_state,
> +				 struct intel_crtc *crtc,
> +				 struct intel_crtc_state *old_crtc_state,
> +				 struct intel_crtc_state *new_crtc_state);
>  int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_state,
>  					struct intel_crtc_state *crtc_state,
>  					const struct intel_plane_state *old_plane_state,
> -- 
> 2.18.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Matt Roper
Graphics Software Engineer
IoTG Platform Enabling & Development
Intel Corporation
(916) 356-2795
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-09-20  0:13 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-19 13:56 [PATCH 00/15] drm/i915/gen11: Implement planar format support Maarten Lankhorst
2018-09-19 13:56 ` [PATCH 01/15] drm/i915: Clean up casts to crtc_state in intel_atomic_commit_tail() Maarten Lankhorst
2018-09-20  0:11   ` Matt Roper
2018-09-19 13:56 ` [PATCH 02/15] drm/i915: Handle cursor updating active_planes correctly Maarten Lankhorst
2018-09-20  0:12   ` Matt Roper
2018-09-20  9:56     ` Maarten Lankhorst
2018-09-19 13:56 ` [PATCH 03/15] drm/i915: Make intel_crtc_disable_planes() use active planes mask Maarten Lankhorst
2018-09-20  0:13   ` Matt Roper
2018-09-19 13:56 ` [PATCH 04/15] drm/i915: Replace call to commit_planes_on_crtc with internal update, v2 Maarten Lankhorst
2018-09-20  0:13   ` Matt Roper [this message]
2018-09-19 13:56 ` [PATCH 05/15] drm/i915: Clean up scaler setup Maarten Lankhorst
2018-09-19 13:56 ` [PATCH 06/15] drm/i915: Force NV12 coordinates to be a multiple of 2 Maarten Lankhorst
2018-09-19 13:56 ` [PATCH 07/15] drm/i915: Unconditionally clear plane_state->visible flag Maarten Lankhorst
2018-09-19 13:56 ` [PATCH 08/15] drm/i915/gen11: Enable 6 sprites on gen11 Maarten Lankhorst
2018-09-19 13:56 ` [PATCH 09/15] drm/i915/gen11: Link nv12 Y and UV planes in the atomic state, v2 Maarten Lankhorst
2018-09-19 13:56 ` [PATCH 10/15] drm/i915/gen11: Handle watermarks correctly for separate Y/UV planes Maarten Lankhorst
2018-09-19 13:56 ` [PATCH 11/15] drm/i915: Move programming plane scaler to its own function Maarten Lankhorst
2018-09-19 13:56 ` [PATCH 12/15] drm/i915/gen11: Program the scalers correctly for planar formats Maarten Lankhorst
2018-09-19 13:56 ` [PATCH 13/15] drm/i915/gen11: Program the chroma upsampler for HDR planes Maarten Lankhorst
2018-09-19 13:56 ` [PATCH 14/15] drm/i915/gen11: Program the Y and UV plane for planar mode correctly Maarten Lankhorst
2018-09-19 13:56 ` [PATCH 15/15] drm/i915/gen11: Expose planar format support on gen11 Maarten Lankhorst
2018-09-19 14:15 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/gen11: Implement planar format support Patchwork
2018-09-19 14:21 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-09-19 14:36 ` ✗ Fi.CI.BAT: failure " 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=20180920001313.GI31331@mdroper-desk.amr.corp.intel.com \
    --to=matthew.d.roper@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=maarten.lankhorst@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 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.