All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paulo Zanoni <paulo.r.zanoni@intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 6/8] drm/i915/gen9+: Use the watermarks from crtc_state for everything.
Date: Thu, 20 Oct 2016 15:59:13 -0200	[thread overview]
Message-ID: <1476986353.2597.48.camel@intel.com> (raw)
In-Reply-To: <1476278901-15750-7-git-send-email-maarten.lankhorst@linux.intel.com>

Em Qua, 2016-10-12 às 15:28 +0200, Maarten Lankhorst escreveu:
> There's no need to keep a duplicate skl_pipe_wm around any more,
> everything can be discovered from crtc_state, which we pass around
> correctly now even in case of plane disable.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c |  2 +-
>  drivers/gpu/drm/i915/intel_drv.h     |  1 -
>  drivers/gpu/drm/i915/intel_pm.c      | 11 +++++------
>  3 files changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c
> b/drivers/gpu/drm/i915/intel_display.c
> index 23d8c72dade3..340861826c46 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -13455,7 +13455,7 @@ static void verify_wm_state(struct drm_crtc
> *crtc,
>  		return;
>  
>  	skl_pipe_wm_get_hw_state(crtc, &hw_wm);
> -	sw_wm = &intel_crtc->wm.active.skl;
> +	sw_wm = &to_intel_crtc_state(new_state)->wm.skl.optimal;
>  
>  	skl_ddb_get_hw_state(dev_priv, &hw_ddb);
>  	sw_ddb = &dev_priv->wm.skl_hw.ddb;
> diff --git a/drivers/gpu/drm/i915/intel_drv.h
> b/drivers/gpu/drm/i915/intel_drv.h
> index a176e6cebab3..9f04e26c4365 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -723,7 +723,6 @@ struct intel_crtc {
>  		/* watermarks currently being used  */
>  		union {
>  			struct intel_pipe_wm ilk;
> -			struct skl_pipe_wm skl;
>  		} active;
>  
>  		/* allow CxSR on this pipe */
> diff --git a/drivers/gpu/drm/i915/intel_pm.c
> b/drivers/gpu/drm/i915/intel_pm.c
> index 05ccd253fd7a..be3dd8cdc7ae 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -3904,9 +3904,9 @@ bool skl_ddb_allocation_overlaps(struct
> drm_atomic_state *state,
>  static int skl_update_pipe_wm(struct drm_crtc_state *cstate,
>  			      struct skl_ddb_allocation *ddb, /* out
> */
>  			      struct skl_pipe_wm *pipe_wm, /* out */
> +			      const struct skl_pipe_wm *old_pipe_wm,
>  			      bool *changed /* out */)

Bikeshed: this patch adds an "in" parameter in the middle of the "out"
parameters. That's kinda ugly IMHO.

With that maybe fixed:
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>


>  {
> -	struct intel_crtc *intel_crtc = to_intel_crtc(cstate->crtc);
>  	struct intel_crtc_state *intel_cstate =
> to_intel_crtc_state(cstate);
>  	int ret;
>  
> @@ -3914,7 +3914,7 @@ static int skl_update_pipe_wm(struct
> drm_crtc_state *cstate,
>  	if (ret)
>  		return ret;
>  
> -	if (!memcmp(&intel_crtc->wm.active.skl, pipe_wm,
> sizeof(*pipe_wm)))
> +	if (!memcmp(old_pipe_wm, pipe_wm, sizeof(*pipe_wm)))
>  		*changed = false;
>  	else
>  		*changed = true;
> @@ -4155,10 +4155,12 @@ skl_compute_wm(struct drm_atomic_state
> *state)
>  	for_each_crtc_in_state(state, crtc, cstate, i) {
>  		struct intel_crtc_state *intel_cstate =
>  			to_intel_crtc_state(cstate);
> +		const struct skl_pipe_wm *old_pipe_wm =
> +			&to_intel_crtc_state(crtc->state)-
> >wm.skl.optimal;
>  
>  		pipe_wm = &intel_cstate->wm.skl.optimal;
>  		ret = skl_update_pipe_wm(cstate, &results->ddb,
> pipe_wm,
> -					 &changed);
> +					 old_pipe_wm, &changed);
>  		if (ret)
>  			return ret;
>  
> @@ -4203,8 +4205,6 @@ static void skl_update_wm(struct drm_crtc
> *crtc)
>  	if ((results->dirty_pipes & drm_crtc_mask(crtc)) == 0)
>  		return;
>  
> -	intel_crtc->wm.active.skl = *pipe_wm;
> -
>  	mutex_lock(&dev_priv->wm.wm_mutex);
>  
>  	/*
> @@ -4371,7 +4371,6 @@ void skl_wm_get_hw_state(struct drm_device
> *dev)
>  		cstate = to_intel_crtc_state(crtc->state);
>  
>  		skl_pipe_wm_get_hw_state(crtc, &cstate-
> >wm.skl.optimal);
> -		intel_crtc->wm.active.skl = cstate->wm.skl.optimal;
>  
>  		if (!intel_crtc->active)
>  			hw->dirty_pipes |= drm_crtc_mask(crtc);
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-10-20 17:59 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-12 13:28 [PATCH 0/8] drm/i915/gen9+: Atomic wm fixes Maarten Lankhorst
2016-10-12 13:28 ` [PATCH 1/8] drm/i915/skl+: Prepare for removing data rate from skl watermark state Maarten Lankhorst
2016-10-19 22:13   ` Matt Roper
2016-10-20  8:14     ` Maarten Lankhorst
2016-10-20 13:11   ` Paulo Zanoni
2016-10-24  7:00     ` Maarten Lankhorst
2016-10-12 13:28 ` [PATCH 2/8] drm/i915/skl+: Remove data_rate from watermark struct Maarten Lankhorst
2016-10-19 22:13   ` Matt Roper
2016-10-20 17:18     ` Paulo Zanoni
2016-10-20 17:20       ` Paulo Zanoni
2016-10-24  7:09       ` Maarten Lankhorst
2016-10-12 13:28 ` [PATCH 3/8] drm/i915/skl+: Remove minimum block allocation from crtc state Maarten Lankhorst
2016-10-19 22:13   ` Matt Roper
2016-10-20 17:24     ` Paulo Zanoni
2016-10-12 13:28 ` [PATCH 4/8] drm/i915/skl+: Clean up minimum allocations Maarten Lankhorst
2016-10-19 22:55   ` Matt Roper
2016-10-20 17:36   ` Paulo Zanoni
2016-10-12 13:28 ` [PATCH 5/8] drm/i915: Add a atomic evasion step to watermark programming Maarten Lankhorst
2016-10-19 23:15   ` Matt Roper
2016-10-19 23:26     ` Matt Roper
2016-10-20  6:05     ` Maarten Lankhorst
2016-10-20 17:51   ` Paulo Zanoni
2016-10-24  7:13     ` Maarten Lankhorst
2016-10-12 13:28 ` [PATCH 6/8] drm/i915/gen9+: Use the watermarks from crtc_state for everything Maarten Lankhorst
2016-10-20 17:55   ` Matt Roper
2016-10-20 17:59   ` Paulo Zanoni [this message]
2016-10-12 13:28 ` [PATCH 7/8] drm/i915/gen9+: Program watermarks as a separate step during evasion Maarten Lankhorst
2016-10-12 17:03   ` Lyude
2016-10-12 17:04   ` Lyude
2016-10-12 17:15     ` Lyude
2016-10-13  7:26       ` Maarten Lankhorst
2016-10-20 18:35   ` Matt Roper
2016-10-24  8:59     ` Maarten Lankhorst
2016-10-20 21:57   ` Matt Roper
2016-11-01  8:38     ` Maarten Lankhorst
2016-10-12 13:28 ` [PATCH 8/8] drm/i915/gen9+: Preserve old allocation from crtc_state Maarten Lankhorst
2016-10-20 22:09   ` Matt Roper
2016-10-24  8:49     ` Maarten Lankhorst

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=1476986353.2597.48.camel@intel.com \
    --to=paulo.r.zanoni@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.