All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 06/11] drm/i915: refactor skl_write_plane_wm()
Date: Thu, 18 Oct 2018 16:36:00 +0300	[thread overview]
Message-ID: <20181018133600.GA9144@intel.com> (raw)
In-Reply-To: <20181016220133.26991-7-paulo.r.zanoni@intel.com>

On Tue, Oct 16, 2018 at 03:01:28PM -0700, Paulo Zanoni wrote:
> Its control flow is not as easy to follow as it could be. We recently
> even had a double register write that went unnoticed until commit
> 9e44b180f81b ("drm/i915: don't write PLANE_BUF_CFG twice every time")
> fixed it. The return statement in the middle along with the fact that
> it's on a void function really doesn't help readability IMHO.
> 
> Refactor the function so that the first level of checks is per
> platform and the second level is for planar planes. IMHO that makes
> the code much more readable.
> 
> Requested-by: Matt Roper <matthew.d.roper@intel.com>
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>

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

> ---
>  drivers/gpu/drm/i915/intel_pm.c | 33 ++++++++++++++++++++-------------
>  1 file changed, 20 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 7fd344b81d66..f388bfa99a97 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -5033,21 +5033,28 @@ static void skl_write_plane_wm(struct intel_crtc *intel_crtc,
>  	skl_write_wm_level(dev_priv, PLANE_WM_TRANS(pipe, plane_id),
>  			   &wm->trans_wm);
>  
> -	/* FIXME: add proper NV12 support for ICL. */
> -	if (INTEL_GEN(dev_priv) >= 11)
> -		return skl_ddb_entry_write(dev_priv,
> -					   PLANE_BUF_CFG(pipe, plane_id),
> -					   &ddb->plane[pipe][plane_id]);
> -	if (wm->is_planar) {
> -		skl_ddb_entry_write(dev_priv, PLANE_BUF_CFG(pipe, plane_id),
> -				    &ddb->uv_plane[pipe][plane_id]);
> +	if (INTEL_GEN(dev_priv) >= 11) {
> +		/* FIXME: add proper NV12 support for ICL. */
> +		if (wm->is_planar)
> +			DRM_ERROR("No DDB support for planar formats yet\n");
> +
>  		skl_ddb_entry_write(dev_priv,
> -				    PLANE_NV12_BUF_CFG(pipe, plane_id),
> -				    &ddb->plane[pipe][plane_id]);
> +				   PLANE_BUF_CFG(pipe, plane_id),
> +				   &ddb->plane[pipe][plane_id]);
>  	} else {
> -		skl_ddb_entry_write(dev_priv, PLANE_BUF_CFG(pipe, plane_id),
> -				    &ddb->plane[pipe][plane_id]);
> -		I915_WRITE(PLANE_NV12_BUF_CFG(pipe, plane_id), 0x0);
> +		if (wm->is_planar) {
> +			skl_ddb_entry_write(dev_priv,
> +					    PLANE_BUF_CFG(pipe, plane_id),
> +					    &ddb->uv_plane[pipe][plane_id]);
> +			skl_ddb_entry_write(dev_priv,
> +					    PLANE_NV12_BUF_CFG(pipe, plane_id),
> +					    &ddb->plane[pipe][plane_id]);
> +		} else {
> +			skl_ddb_entry_write(dev_priv,
> +					    PLANE_BUF_CFG(pipe, plane_id),
> +					    &ddb->plane[pipe][plane_id]);
> +			I915_WRITE(PLANE_NV12_BUF_CFG(pipe, plane_id), 0x0);
> +		}
>  	}
>  }
>  
> -- 
> 2.14.4
> 
> _______________________________________________
> 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:[~2018-10-18 13:36 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-16 22:01 [PATCH 00/11] More watermarks improvements Paulo Zanoni
2018-10-16 22:01 ` [PATCH 01/11] drm/i915: don't apply Display WAs 1125 and 1126 to GLK/CNL+ Paulo Zanoni
2018-10-18 13:14   ` Ville Syrjälä
2018-10-22 23:32     ` Paulo Zanoni
2018-10-22 23:55       ` Rodrigo Vivi
2018-10-23  0:12         ` Paulo Zanoni
2018-10-23  0:18           ` Rodrigo Vivi
2018-10-23  7:30             ` Jani Nikula
2018-10-26  0:43               ` Rodrigo Vivi
2018-11-09  0:50       ` [PATCH] " Paulo Zanoni
2018-10-16 22:01 ` [PATCH 02/11] drm/i915: remove padding from struct skl_wm_level Paulo Zanoni
2018-10-16 23:00   ` Lucas De Marchi
2018-10-16 22:01 ` [PATCH 03/11] drm/i915: fix handling of invisible planes in watermarks code Paulo Zanoni
2018-10-18 13:28   ` Ville Syrjälä
2018-10-16 22:01 ` [PATCH 04/11] drm/i915: remove useless memset() for watermarks parameters Paulo Zanoni
2018-10-18 13:31   ` Ville Syrjälä
2018-10-16 22:01 ` [PATCH 05/11] drm/i915: simplify wm->is_planar assignment Paulo Zanoni
2018-10-18 13:34   ` Ville Syrjälä
2018-10-16 22:01 ` [PATCH 06/11] drm/i915: refactor skl_write_plane_wm() Paulo Zanoni
2018-10-18 13:36   ` Ville Syrjälä [this message]
2018-10-16 22:01 ` [PATCH 07/11] drm/i915: move ddb_blocks to be a watermark parameter Paulo Zanoni
2018-10-18 13:41   ` Ville Syrjälä
2018-10-22 22:29     ` Paulo Zanoni
2018-10-23 12:07       ` Ville Syrjälä
2018-10-16 22:01 ` [PATCH 08/11] drm/i915: reorganize the error message for invalid watermarks Paulo Zanoni
2018-10-18 13:55   ` Ville Syrjälä
2018-10-18 16:18     ` Ville Syrjälä
2018-10-22 22:22     ` Paulo Zanoni
2018-10-23 12:02       ` Ville Syrjälä
2018-10-16 22:01 ` [PATCH 09/11] drm/i915: make skl_needs_memory_bw_wa() take dev_priv instead of state Paulo Zanoni
2018-10-18 14:02   ` Ville Syrjälä
2018-10-16 22:01 ` [PATCH 10/11] drm/i915: add pipe_htotal to struct skl_wm_params Paulo Zanoni
2018-10-18 14:14   ` Ville Syrjälä
2018-10-16 22:01 ` [PATCH 11/11] drm/i915: pass dev_priv instead of cstate to skl_compute_transition_wm() Paulo Zanoni
2018-10-18 14:20   ` Ville Syrjälä
2018-10-16 22:21 ` ✗ Fi.CI.CHECKPATCH: warning for More watermarks improvements Patchwork
2018-10-16 22:31   ` Paulo Zanoni
2018-10-16 22:25 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-10-16 22:39 ` ✗ Fi.CI.BAT: failure " Patchwork
2018-10-16 22:52   ` Paulo Zanoni
2018-10-18 14:34     ` Saarinen, Jani
2018-10-23  0:09 ` ✓ Fi.CI.BAT: success " Patchwork
2018-10-23  1:41 ` ✓ Fi.CI.IGT: " Patchwork
2018-11-09  1:28 ` ✗ Fi.CI.BAT: failure for More watermarks improvements (rev2) 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=20181018133600.GA9144@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=paulo.r.zanoni@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.