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 v2 08/11] drm/i915/gen9+: Use the watermarks from crtc_state for everything, v2.
Date: Wed, 26 Oct 2016 16:13:56 -0700 [thread overview]
Message-ID: <20161026231356.GC5924@intel.com> (raw)
In-Reply-To: <1477489299-25777-9-git-send-email-maarten.lankhorst@linux.intel.com>
On Wed, Oct 26, 2016 at 03:41:36PM +0200, Maarten Lankhorst wrote:
> 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.
>
> The copy in intel_crtc->wm.skl.active is equal to
> crtc_state->wm.skl.optimal after the atomic commit completes.
> It's useful for two-step watermark programming, but not required for
> gen9+ which does it in a single step. We can pull the old allocation
> from old_crtc_state.
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Matt Roper <matthew.d.roper@intel.com>
> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@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 | 18 ++++++++----------
> 3 files changed, 9 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 48eb0635ec0f..592a6ec354a7 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -13478,7 +13478,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 73be640fad36..77a0a73e37b0 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 5ff35833b258..fe4bc97ed56a 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -3930,11 +3930,11 @@ 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 */
> + const struct skl_pipe_wm *old_pipe_wm,
> struct skl_pipe_wm *pipe_wm, /* out */
> + struct skl_ddb_allocation *ddb, /* out */
> bool *changed /* out */)
> {
> - struct intel_crtc *intel_crtc = to_intel_crtc(cstate->crtc);
> struct intel_crtc_state *intel_cstate = to_intel_crtc_state(cstate);
> int ret;
>
> @@ -3942,7 +3942,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;
> @@ -4177,10 +4177,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);
> + ret = skl_update_pipe_wm(cstate, old_pipe_wm, pipe_wm,
> + &results->ddb, &changed);
> if (ret)
> return ret;
>
> @@ -4224,8 +4226,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);
>
> /*
> @@ -4395,10 +4395,8 @@ void skl_wm_get_hw_state(struct drm_device *dev)
>
> skl_pipe_wm_get_hw_state(crtc, &cstate->wm.skl.optimal);
>
> - if (intel_crtc->active) {
> + if (intel_crtc->active)
> hw->dirty_pipes |= drm_crtc_mask(crtc);
> - intel_crtc->wm.active.skl = cstate->wm.skl.optimal;
> - }
> }
>
> if (dev_priv->active_crtcs) {
> --
> 2.7.4
>
--
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
next prev parent reply other threads:[~2016-10-26 23:13 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-26 13:41 [PATCH v2 00/11] drm/i915/gen9+: Atomic watermark fixes Maarten Lankhorst
2016-10-26 13:41 ` [PATCH v2 01/11] drm/i915/skl+: Prepare for removing data rate from skl watermark state, v2 Maarten Lankhorst
2016-10-27 7:12 ` Daniel Vetter
2016-10-27 8:31 ` Maarten Lankhorst
2016-10-27 17:48 ` Paulo Zanoni
2016-10-27 17:55 ` Matt Roper
2016-10-26 13:41 ` [PATCH v2 02/11] drm/i915/gen9+: Use cstate plane mask instead of crtc->state Maarten Lankhorst
2016-10-27 14:50 ` Matt Roper
2016-10-26 13:41 ` [PATCH v2 03/11] drm/i915/gen9+: Use for_each_intel_plane_on_crtc in skl_print_wm_changes Maarten Lankhorst
2016-10-27 13:03 ` Ville Syrjälä
2016-10-27 17:47 ` Matt Roper
2016-10-27 17:57 ` Paulo Zanoni
2016-11-01 11:04 ` [PATCH v2.1 03/11] drm/i915/gen9+: Use for_each_intel_plane_on_crtc in skl_print_wm_changes, v2 Maarten Lankhorst
2016-11-01 12:33 ` Paulo Zanoni
2016-10-26 13:41 ` [PATCH v2 04/11] drm/i915/skl+: Remove data_rate from watermark struct, v2 Maarten Lankhorst
2016-10-27 18:14 ` Paulo Zanoni
2016-10-26 13:41 ` [PATCH v2 05/11] drm/i915/skl+: Remove minimum block allocation from crtc state Maarten Lankhorst
2016-10-26 13:41 ` [PATCH v2 06/11] drm/i915/skl+: Clean up minimum allocations, v2 Maarten Lankhorst
2016-10-27 19:25 ` Paulo Zanoni
2016-10-26 13:41 ` [PATCH v2 07/11] drm/i915: Add a atomic evasion step to watermark programming, v2 Maarten Lankhorst
2016-10-26 16:19 ` Ville Syrjälä
2016-10-27 7:10 ` Daniel Vetter
2016-10-27 10:37 ` [PATCH v2.1 07/11] drm/i915: Add a atomic evasion step to watermark programming, v3 Maarten Lankhorst
2016-10-26 23:10 ` [PATCH v2 07/11] drm/i915: Add a atomic evasion step to watermark programming, v2 Matt Roper
2016-10-26 13:41 ` [PATCH v2 08/11] drm/i915/gen9+: Use the watermarks from crtc_state for everything, v2 Maarten Lankhorst
2016-10-26 23:13 ` Matt Roper [this message]
2016-10-26 13:41 ` [PATCH v2 09/11] drm/i915/gen9+: Program watermarks as a separate step during evasion, v2 Maarten Lankhorst
2016-10-26 16:05 ` Lyude Paul
2016-10-26 23:24 ` Matt Roper
2016-10-27 8:29 ` Maarten Lankhorst
2016-10-27 11:45 ` [PATCH v2.1 09/11] drm/i915/gen9+: Program watermarks as a separate step during evasion, v3 Maarten Lankhorst
2016-10-26 13:41 ` [PATCH v2 10/11] drm/i915/gen9+: Preserve old allocation from crtc_state Maarten Lankhorst
2016-10-26 13:41 ` [PATCH v2 11/11] drm/i915/gen9+: Kill off hw_ddb from intel_crtc Maarten Lankhorst
2016-10-26 14:16 ` ✓ Fi.CI.BAT: success for drm/i915/gen9+: Atomic watermark fixes 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=20161026231356.GC5924@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).