All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 03/24] drm/i915: Introduce and use intel_atomic_crtc_state_for_each_plane_state.
Date: Fri, 4 Oct 2019 16:18:56 +0300	[thread overview]
Message-ID: <20191004131856.GZ1208@intel.com> (raw)
In-Reply-To: <20191004113514.17064-4-maarten.lankhorst@linux.intel.com>

On Fri, Oct 04, 2019 at 01:34:53PM +0200, Maarten Lankhorst wrote:
> Instead of looking at drm_plane_state, look at intel_plane_state directly.
> 
> This will allow us to make the watermarks bigjoiner aware, when we make it
> work for bigjoiner slave pipes as well.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_display.h |  8 +++
>  drivers/gpu/drm/i915/intel_pm.c              | 60 ++++++++------------
>  2 files changed, 33 insertions(+), 35 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display.h b/drivers/gpu/drm/i915/display/intel_display.h
> index 4ded64fcbc6c..bc2cf4bec0e8 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.h
> +++ b/drivers/gpu/drm/i915/display/intel_display.h
> @@ -440,6 +440,14 @@ enum phy_fia {
>  	     (__i)--) \
>  		for_each_if(crtc)
>  
> +#define intel_atomic_crtc_state_for_each_plane_state( \
> +		  plane, plane_state, \
> +		  crtc_state) \
> +	for_each_intel_plane_mask(((crtc_state)->base.state->dev), (plane), \
> +				((crtc_state)->base.plane_mask)) \
> +		for_each_if ((plane_state = \
> +			      to_intel_plane_state(__drm_atomic_get_current_plane_state((crtc_state)->base.state, &plane->base))))
> +
>  void intel_link_compute_m_n(u16 bpp, int nlanes,
>  			    int pixel_clock, int link_clock,
>  			    struct intel_link_m_n *m_n,
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index bfcf03ab5245..6aeaad587a20 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -3089,8 +3089,8 @@ static int ilk_compute_pipe_wm(struct intel_crtc_state *crtc_state)
>  	struct intel_pipe_wm *pipe_wm;
>  	struct drm_device *dev = state->dev;
>  	const struct drm_i915_private *dev_priv = to_i915(dev);
> -	struct drm_plane *plane;
> -	const struct drm_plane_state *plane_state;
> +	struct intel_plane *plane;
> +	const struct intel_plane_state *plane_state;
>  	const struct intel_plane_state *pristate = NULL;
>  	const struct intel_plane_state *sprstate = NULL;
>  	const struct intel_plane_state *curstate = NULL;
> @@ -3099,15 +3099,13 @@ static int ilk_compute_pipe_wm(struct intel_crtc_state *crtc_state)
>  
>  	pipe_wm = &crtc_state->wm.ilk.optimal;
>  
> -	drm_atomic_crtc_state_for_each_plane_state(plane, plane_state, &crtc_state->base) {
> -		const struct intel_plane_state *ps = to_intel_plane_state(plane_state);
> -
> -		if (plane->type == DRM_PLANE_TYPE_PRIMARY)
> -			pristate = ps;
> -		else if (plane->type == DRM_PLANE_TYPE_OVERLAY)
> -			sprstate = ps;
> -		else if (plane->type == DRM_PLANE_TYPE_CURSOR)
> -			curstate = ps;
> +	intel_atomic_crtc_state_for_each_plane_state(plane, plane_state, crtc_state) {
> +		if (plane->base.type == DRM_PLANE_TYPE_PRIMARY)
> +			pristate = plane_state;
> +		else if (plane->base.type == DRM_PLANE_TYPE_OVERLAY)
> +			sprstate = plane_state;
> +		else if (plane->base.type == DRM_PLANE_TYPE_CURSOR)
> +			curstate = plane_state;
>  	}
>  
>  	pipe_wm->pipe_enabled = crtc_state->base.active;
> @@ -4124,8 +4122,8 @@ int skl_check_pipe_max_pixel_rate(struct intel_crtc *intel_crtc,
>  {
>  	struct drm_i915_private *dev_priv = to_i915(intel_crtc->base.dev);
>  	struct drm_atomic_state *state = crtc_state->base.state;
> -	struct drm_plane *plane;
> -	const struct drm_plane_state *drm_plane_state;
> +	const struct intel_plane_state *plane_state;
> +	struct intel_plane *plane;
>  	int crtc_clock, dotclk;
>  	u32 pipe_max_pixel_rate;
>  	uint_fixed_16_16_t pipe_downscale;
> @@ -4134,12 +4132,10 @@ int skl_check_pipe_max_pixel_rate(struct intel_crtc *intel_crtc,
>  	if (!crtc_state->base.enable)
>  		return 0;
>  
> -	drm_atomic_crtc_state_for_each_plane_state(plane, drm_plane_state, &crtc_state->base) {
> +	intel_atomic_crtc_state_for_each_plane_state(plane, plane_state, crtc_state) {
>  		uint_fixed_16_16_t plane_downscale;
>  		uint_fixed_16_16_t fp_9_div_8 = div_fixed16(9, 8);
>  		int bpp;
> -		const struct intel_plane_state *plane_state =
> -			to_intel_plane_state(drm_plane_state);
>  
>  		if (!intel_wm_plane_visible(crtc_state, plane_state))
>  			continue;
> @@ -4227,18 +4223,16 @@ skl_get_total_relative_data_rate(struct intel_crtc_state *crtc_state,
>  				 u64 *uv_plane_data_rate)
>  {
>  	struct drm_atomic_state *state = crtc_state->base.state;
> -	struct drm_plane *plane;
> -	const struct drm_plane_state *drm_plane_state;
> +	struct intel_plane *plane;
> +	const struct intel_plane_state *plane_state;
>  	u64 total_data_rate = 0;
>  
>  	if (WARN_ON(!state))
>  		return 0;
>  
>  	/* Calculate and cache data rate for each plane */
> -	drm_atomic_crtc_state_for_each_plane_state(plane, drm_plane_state, &crtc_state->base) {
> -		enum plane_id plane_id = to_intel_plane(plane)->id;
> -		const struct intel_plane_state *plane_state =
> -			to_intel_plane_state(drm_plane_state);
> +	intel_atomic_crtc_state_for_each_plane_state(plane, plane_state, crtc_state) {
> +		enum plane_id plane_id = plane->id;
>  		u64 rate;
>  
>  		/* packed/y */
> @@ -4259,18 +4253,16 @@ static u64
>  icl_get_total_relative_data_rate(struct intel_crtc_state *crtc_state,
>  				 u64 *plane_data_rate)
>  {
> -	struct drm_plane *plane;
> -	const struct drm_plane_state *drm_plane_state;
> +	struct intel_plane *plane;
> +	const struct intel_plane_state *plane_state;
>  	u64 total_data_rate = 0;
>  
>  	if (WARN_ON(!crtc_state->base.state))
>  		return 0;
>  
>  	/* Calculate and cache data rate for each plane */
> -	drm_atomic_crtc_state_for_each_plane_state(plane, drm_plane_state, &crtc_state->base) {
> -		const struct intel_plane_state *plane_state =
> -			to_intel_plane_state(drm_plane_state);
> -		enum plane_id plane_id = to_intel_plane(plane)->id;
> +	intel_atomic_crtc_state_for_each_plane_state(plane, plane_state, crtc_state) {
> +		enum plane_id plane_id = plane->id;
>  		u64 rate;
>  
>  		if (!plane_state->planar_linked_plane) {
> @@ -4282,7 +4274,7 @@ icl_get_total_relative_data_rate(struct intel_crtc_state *crtc_state,
>  
>  			/*
>  			 * The slave plane might not iterate in
> -			 * drm_atomic_crtc_state_for_each_plane_state(),
> +			 * intel_atomic_crtc_state_for_each_plane_state(),
>  			 * and needs the master plane state which may be
>  			 * NULL if we try get_new_plane_state(), so we
>  			 * always calculate from the master.
> @@ -5065,8 +5057,8 @@ static int skl_build_pipe_wm(struct intel_crtc_state *crtc_state)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(crtc_state->base.crtc->dev);
>  	struct skl_pipe_wm *pipe_wm = &crtc_state->wm.skl.optimal;
> -	struct drm_plane *plane;
> -	const struct drm_plane_state *drm_plane_state;
> +	struct intel_plane *plane;
> +	const struct intel_plane_state *plane_state;
>  	int ret;
>  
>  	/*
> @@ -5075,10 +5067,8 @@ static int skl_build_pipe_wm(struct intel_crtc_state *crtc_state)
>  	 */
>  	memset(pipe_wm->planes, 0, sizeof(pipe_wm->planes));
>  
> -	drm_atomic_crtc_state_for_each_plane_state(plane, drm_plane_state,
> -						   &crtc_state->base) {
> -		const struct intel_plane_state *plane_state =
> -			to_intel_plane_state(drm_plane_state);
> +	intel_atomic_crtc_state_for_each_plane_state(plane, plane_state,
> +						     crtc_state) {
>  
>  		if (INTEL_GEN(dev_priv) >= 11)
>  			ret = icl_build_plane_wm(crtc_state, plane_state);
> -- 
> 2.23.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

  reply	other threads:[~2019-10-04 13:18 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-04 11:34 [PATCH 00/24] Enable bigjoiner support, second approach Maarten Lankhorst
2019-10-04 11:34 ` [PATCH 01/24] HAX to make DSC work on the icelake test system Maarten Lankhorst
2019-10-04 11:34 ` [PATCH 02/24] drm/i915: Fix for_each_intel_plane_mask definition Maarten Lankhorst
2019-10-04 13:14   ` Ville Syrjälä
2019-10-07 19:37   ` Matt Roper
2019-10-04 11:34 ` [PATCH 03/24] drm/i915: Introduce and use intel_atomic_crtc_state_for_each_plane_state Maarten Lankhorst
2019-10-04 13:18   ` Ville Syrjälä [this message]
2019-10-07 19:37   ` Matt Roper
2019-10-04 11:34 ` [PATCH 04/24] drm/i915: Remove cursor use of properties for coordinates Maarten Lankhorst
2019-10-04 13:22   ` Ville Syrjälä
2019-10-07 19:37   ` Matt Roper
2019-10-10 12:10     ` Maarten Lankhorst
2019-10-10 14:04     ` Maarten Lankhorst
2019-10-04 11:34 ` [PATCH 05/24] drm/i915: Use intel_plane_state in prepare and cleanup plane_fb Maarten Lankhorst
2019-10-04 13:23   ` Ville Syrjälä
2019-10-07 19:37   ` Matt Roper
2019-10-04 11:34 ` [PATCH 06/24] drm/i915: Remove begin/finish_crtc_commit, v4 Maarten Lankhorst
2019-10-07 19:43   ` Matt Roper
2019-10-04 11:34 ` [PATCH 07/24] drm/i915: Introduce intel_atomic_get_plane_state_after_check() Maarten Lankhorst
2019-10-08 17:03   ` Ville Syrjälä
2019-10-10 11:56     ` Maarten Lankhorst
2019-10-10 12:39       ` Ville Syrjälä
2019-10-10 13:01         ` Maarten Lankhorst
2019-10-04 11:34 ` [PATCH 08/24] drm/i915: Prepare to split crtc state in uapi and hw state Maarten Lankhorst
2019-10-08 17:06   ` Ville Syrjälä
2019-10-10 14:21     ` Maarten Lankhorst
2019-10-10 14:47       ` Ville Syrjälä
2019-10-14  8:20         ` Maarten Lankhorst
2019-10-04 11:34 ` [PATCH 09/24] drm/i915: Handle a few more cases for crtc hw/uapi split Maarten Lankhorst
2019-10-04 13:31   ` Ville Syrjälä
2019-10-04 15:51     ` Maarten Lankhorst
2019-10-04 15:56       ` Ville Syrjälä
2019-10-04 11:35 ` [PATCH 10/24] drm/i915: Complete crtc hw/uapi split, v2 Maarten Lankhorst
2019-10-04 11:35 ` [PATCH 11/24] drm/i915: Preparation for plane split Maarten Lankhorst
2019-10-04 11:35 ` [PATCH 12/24] drm/i915: Split plane hw and uapi state Maarten Lankhorst
2019-10-08 17:42   ` Ville Syrjälä
2019-10-09 12:13     ` Maarten Lankhorst
2019-10-09 12:23       ` Ville Syrjälä
2019-10-09 12:31         ` Maarten Lankhorst
2019-10-09 12:41           ` Ville Syrjälä
2019-10-09 12:58             ` Maarten Lankhorst
2019-10-04 11:35 ` [PATCH 13/24] drm/i915: Stop using drm_atomic_helper_check_planes() Maarten Lankhorst
2019-10-04 11:35 ` [PATCH 14/24] drm/i915/dp: Allow big joiner modes in intel_dp_mode_valid(), v2 Maarten Lankhorst
2019-10-08 17:50   ` Ville Syrjälä
2019-10-04 11:35 ` [PATCH 15/24] drm/i915: Try to make bigjoiner work in atomic check, v2 Maarten Lankhorst
2019-10-08 19:40   ` Ville Syrjälä
2019-10-10 12:42     ` Maarten Lankhorst
2019-10-04 11:35 ` [PATCH 16/24] drm/i915: Enable big joiner support in enable and disable sequences Maarten Lankhorst
2019-10-04 11:35 ` [PATCH 17/24] drm/i915: Make hardware readout work on i915 Maarten Lankhorst
2019-10-04 11:35 ` [PATCH 18/24] drm/i915: Remove special case slave handling during hw programming Maarten Lankhorst
2019-10-04 11:35 ` [PATCH 19/24] drm/i915: Link planes in a bigjoiner configuration, v2 Maarten Lankhorst
2019-10-04 11:35 ` [PATCH 20/24] drm/i915: Add bigjoiner aware plane clipping checks Maarten Lankhorst
2019-10-04 11:35 ` [PATCH 21/24] drm/i915: Ensure color blobs are copied to slave before planes are checked Maarten Lankhorst
2019-10-04 11:35 ` [PATCH 22/24] drm/i915: Add intel_update_bigjoiner handling Maarten Lankhorst
2019-10-04 11:35 ` [PATCH 23/24] drm/i915: Add debugfs dumping for bigjoiner, v2 Maarten Lankhorst
2019-10-04 11:35 ` [PATCH 24/24] semi-hax: drm/i915: Always verify ddb allocation Maarten Lankhorst
2019-10-04 14:23   ` [PATCH] " Maarten Lankhorst
2019-10-04 13:10 ` ✗ Fi.CI.BUILD: failure for Enable bigjoiner support, second approach Patchwork
2019-10-04 18:03 ` ✗ Fi.CI.BUILD: failure for Enable bigjoiner support, second approach. (rev2) Patchwork
2019-10-10 16:25 ` ✗ Fi.CI.BUILD: failure for Enable bigjoiner support, second approach. (rev3) 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=20191004131856.GZ1208@intel.com \
    --to=ville.syrjala@linux.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.