From: Matt Roper <matthew.d.roper@intel.com>
To: Chi Ding <chix.ding@intel.com>
Cc: yetundex.adebisi@intel.com, isg-gms@eclists.intel.com,
intel-gfx@lists.freedesktop.org
Subject: Re: [isg-gms] [RFC 5/6] drm/i915/vlv: Add optimal field in intel_crtc_wm_state
Date: Tue, 14 Jun 2016 14:55:39 -0700 [thread overview]
Message-ID: <20160614215539.GC31785@intel.com> (raw)
In-Reply-To: <1465399364-28512-6-git-send-email-chix.ding@intel.com>
On Wed, Jun 08, 2016 at 05:22:43PM +0200, Chi Ding wrote:
> From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>
This patch needs a commit message. Those of us actively working on
watermarks right now understand the end goal for two-stage watermarks,
but I don't think most other developers looking at this code (or
bisecting something to this patch) will immediately understand what
'optimal' means in the context of watermarks (or why we'd ever have
non-optimal watermarks).
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Signed-off-by: Chi Ding <chix.ding@intel.com>
> ---
> drivers/gpu/drm/i915/intel_drv.h | 23 ++++++++++++++---------
> drivers/gpu/drm/i915/intel_pm.c | 11 +++++++++--
> 2 files changed, 23 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index 31118e1..6d2e628 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -420,6 +420,16 @@ struct skl_pipe_wm {
> uint32_t linetime;
> };
>
> +struct vlv_wm_state {
> + struct vlv_pipe_wm wm[3];
> + struct vlv_sr_wm sr[3];
> + uint16_t fifo_size[I915_MAX_PLANES];
> + uint8_t num_active_planes;
> + uint8_t num_levels;
> + uint8_t level;
> + bool cxsr;
> +};
> +
> struct intel_crtc_wm_state {
> union {
> struct {
> @@ -440,6 +450,10 @@ struct intel_crtc_wm_state {
> } ilk;
>
> struct {
> + struct vlv_wm_state optimal;
> + } vlv;
> +
> + struct {
> /* gen9+ only needs 1-step wm programming */
> struct skl_pipe_wm optimal;
>
> @@ -621,15 +635,6 @@ struct intel_crtc_state {
> uint32_t gamma_mode;
> };
>
> -struct vlv_wm_state {
> - struct vlv_pipe_wm wm[3];
> - struct vlv_sr_wm sr[3];
> - uint16_t fifo_size[I915_MAX_PLANES];
> - uint8_t num_active_planes;
> - uint8_t num_levels;
> - uint8_t level;
> - bool cxsr;
> -};
>
> struct intel_crtc {
> struct drm_crtc base;
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 3fc80f9..502af9f 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -1093,7 +1093,7 @@ static int vlv_compute_wm(struct intel_crtc_state *cstate)
> {
> struct intel_crtc *crtc = to_intel_crtc(cstate->base.crtc);
> struct drm_device *dev = crtc->base.dev;
> - struct vlv_wm_state *wm_state = &crtc->wm_state;
> + struct vlv_wm_state *wm_state = &cstate->wm.vlv.optimal;
> struct intel_plane *plane;
> int sr_fifo_size = INTEL_INFO(dev)->num_pipes * 512 - 1;
> int level;
> @@ -1335,6 +1335,7 @@ static void vlv_update_wm(struct drm_crtc *crtc)
> struct vlv_wm_values wm = {};
>
> vlv_compute_wm(intel_crtc->config);
> + intel_crtc->wm_state = intel_crtc->config->wm.vlv.optimal;
Is this now the 'active' set of watermarks? If so, we might want to
move it into crtc->wm.active.vlv to match the handling we have on other
platforms.
Also, it looks like VLV-style watermarks can still race here. I think
we need to grab wm_mutex before setting wm_state/active like we do on
the other platforms so that the state doesn't get changed by one thread
while another one is in the middle of merging WM's into final results.
> vlv_merge_wm(dev, &wm);
>
> if (memcmp(&dev_priv->wm.vlv, &wm, sizeof(wm)) == 0) {
> @@ -1377,6 +1378,7 @@ static void vlv_update_wm(struct drm_crtc *crtc)
> chv_set_memory_dvfs(dev_priv, true);
>
> dev_priv->wm.vlv = wm;
> +
Stray whitespace?
Matt
> }
>
> #define single_plane_enabled(mask) is_power_of_2(mask)
> @@ -4286,10 +4288,15 @@ void vlv_wm_get_hw_state(struct drm_device *dev)
> mutex_unlock(&dev_priv->rps.hw_lock);
> }
>
> - for_each_pipe(dev_priv, pipe)
> + for_each_intel_crtc(dev, crtc) {
> + pipe = crtc->pipe;
> + to_intel_crtc_state(crtc->base.state)->wm.vlv.optimal
> + = crtc->wm_state;
> +
> DRM_DEBUG_KMS("Initial watermarks: pipe %c, plane=%d, cursor=%d, sprite0=%d, sprite1=%d\n",
> pipe_name(pipe), wm->pipe[pipe].primary, wm->pipe[pipe].cursor,
> wm->pipe[pipe].sprite[0], wm->pipe[pipe].sprite[1]);
> + }
>
> DRM_DEBUG_KMS("Initial watermarks: SR plane=%d, SR cursor=%d level=%d cxsr=%d\n",
> wm->sr.plane, wm->sr.cursor, wm->level, wm->cxsr);
> --
> 1.8.0.1
>
> -------------------------------------
> isg-gms@eclists.intel.com
> https://eclists.intel.com/sympa/info/isg-gms
> Unsubscribe by sending email to sympa@eclists.intel.com with subject "Unsubscribe isg-gms"
--
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-06-14 21:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1465399364-28512-1-git-send-email-chix.ding@intel.com>
[not found] ` <1465399364-28512-4-git-send-email-chix.ding@intel.com>
2016-06-14 21:52 ` [isg-gms] [RFC 3/6] drm/i915/vlv: Move fifo_size from intel_plane_wm_parameters to vlv_wm_state Matt Roper
2016-06-15 5:51 ` Maarten Lankhorst
[not found] ` <1465399364-28512-5-git-send-email-chix.ding@intel.com>
2016-06-14 21:54 ` [RFC 4/6] drm/i915/vlv: Change to use intel_crtc_state instead of base CRTC object Matt Roper
[not found] ` <1465399364-28512-6-git-send-email-chix.ding@intel.com>
2016-06-14 21:55 ` Matt Roper [this message]
[not found] ` <1465399364-28512-7-git-send-email-chix.ding@intel.com>
[not found] ` <188f04b1-8972-d387-cf85-dfb526fa86d3@linux.intel.com>
[not found] ` <FBBD98403E9C0B4AA00BFB8657163F851A476D2F@IRSMSX108.ger.corp.intel.com>
[not found] ` <a2330aee-89e4-8f92-5a6b-c9cda52bd494@linux.intel.com>
[not found] ` <FBBD98403E9C0B4AA00BFB8657163F851A476F0D@IRSMSX108.ger.corp.intel.com>
2016-06-14 22:57 ` [RFC 6/6] drm/i915/vlv: Add intermediate field in intel_crtc_wm_state and handlers for two-level watermark Matt Roper
2016-06-15 9:49 ` Ville Syrjälä
2016-06-16 11:01 ` Ding, ChiX
2016-07-06 14:05 ` Ville Syrjälä
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=20160614215539.GC31785@intel.com \
--to=matthew.d.roper@intel.com \
--cc=chix.ding@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=isg-gms@eclists.intel.com \
--cc=yetundex.adebisi@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