All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paulo Zanoni <przanoni@gmail.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH v2 13/16] drm/i915: Keep track of who disabled LP1+ watermarks
Date: Wed, 4 Jun 2014 15:30:21 -0300	[thread overview]
Message-ID: <CA+gsUGTmmhtSmAngnG_GSgMhVFnoVkZTSsHKFSe=tc3+DcEn8w@mail.gmail.com> (raw)
In-Reply-To: <1400770101-14277-14-git-send-email-ville.syrjala@linux.intel.com>

2014-05-22 11:48 GMT-03:00  <ville.syrjala@linux.intel.com>:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Currently ilk_disable_lp_wm() just disabled LP1+ watermarks directly.
> However there's nothing preventing someone else from re-enabling them
> immediately. To make sure sure LP1+ watermarks stay disabled for the
> intended period, keep track which pipes require the LP1+ watermarks
> to be disabled.
>
> v2: Rebase and s/intel_crtc/crtc/

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>

>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h      |  6 ++++++
>  drivers/gpu/drm/i915/intel_display.c |  2 +-
>  drivers/gpu/drm/i915/intel_drv.h     |  2 +-
>  drivers/gpu/drm/i915/intel_pm.c      | 22 ++++++++++++++++++----
>  4 files changed, 26 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 1fe0cac..02ffbfc 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1548,6 +1548,12 @@ struct drm_i915_private {
>                 struct ilk_wm_values hw;
>
>                 /*
> +                * bitmask of pipes that have requested
> +                * LP1+ watermarks to be disabled.
> +                */
> +               unsigned int lp_disabled;
> +
> +               /*
>                  * protects some dev_priv->wm and intel_crtc->wm
>                  * state as well as the actual hardware registers
>                  */
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 311c0f0..879c649 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -4002,7 +4002,7 @@ static void ilk_prepare_for_num_pipes_change(struct intel_crtc *crtc)
>
>         ilk_wm_synchronize(other_active_crtc);
>
> -       if (ilk_disable_lp_wm(dev))
> +       if (ilk_disable_lp_wm(crtc))
>                 intel_wait_for_vblank(dev, other_active_crtc->pipe);
>  }
>
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index 98f878f..2a3ad60 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -1023,7 +1023,7 @@ void intel_program_watermarks_post(struct intel_crtc *crtc,
>                                    const struct intel_crtc_wm_config *config);
>  void ilk_wm_synchronize(struct intel_crtc *crtc);
>  void ilk_wm_pipe_post_disable(struct intel_crtc *crtc);
> -bool ilk_disable_lp_wm(struct drm_device *dev);
> +bool ilk_disable_lp_wm(struct intel_crtc *crtc);
>
>
>  /* intel_sdvo.c */
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 18ea8b1..17f1769 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -2428,6 +2428,7 @@ static void ilk_compute_wm_results(struct drm_device *dev,
>                                    enum intel_ddb_partitioning partitioning,
>                                    struct ilk_wm_values *results)
>  {
> +       struct drm_i915_private *dev_priv = dev->dev_private;
>         struct intel_crtc *intel_crtc;
>         int level, wm_lp;
>
> @@ -2451,7 +2452,7 @@ static void ilk_compute_wm_results(struct drm_device *dev,
>                         (r->pri_val << WM1_LP_SR_SHIFT) |
>                         r->cur_val;
>
> -               if (r->enable)
> +               if (r->enable && !dev_priv->wm.lp_disabled)
>                         results->wm_lp[wm_lp - 1] |= WM1_LP_SR_EN;
>
>                 if (INTEL_INFO(dev)->gen >= 8)
> @@ -2765,13 +2766,18 @@ static void ilk_write_wm_values(struct drm_i915_private *dev_priv,
>         }
>  }
>
> -bool ilk_disable_lp_wm(struct drm_device *dev)
> +bool ilk_disable_lp_wm(struct intel_crtc *crtc)
>  {
> +       struct drm_device *dev = crtc->base.dev;
>         struct drm_i915_private *dev_priv = dev->dev_private;
>         bool changed;
>
>         mutex_lock(&dev_priv->wm.mutex);
> +
> +       dev_priv->wm.lp_disabled |= 1 << crtc->pipe;
> +
>         changed = _ilk_disable_lp_wm(dev_priv, WM_DIRTY_LP_ALL);
> +
>         mutex_unlock(&dev_priv->wm.mutex);
>
>         return changed;
> @@ -2889,15 +2895,20 @@ static void ilk_setup_pending_watermarks(struct intel_crtc *crtc,
>                                          u32 vbl_count)
>  {
>         struct drm_device *dev = crtc->base.dev;
> +       struct drm_i915_private *dev_priv = dev->dev_private;
>         enum pipe pipe = crtc->pipe;
>
>         WARN(!crtc->active, "pipe %c should be enabled\n",
>              pipe_name(pipe));
>
>         /* do the watermarks actually need changing? */
> -       if (!memcmp(&crtc->wm.pending, pipe_wm, sizeof(*pipe_wm)))
> +       if (!(dev_priv->wm.lp_disabled & (1 << pipe)) &&
> +           !memcmp(&crtc->wm.pending, pipe_wm, sizeof(*pipe_wm)))
>                 return;
>
> +       /* allow LP1+ watermarks again */
> +       dev_priv->wm.lp_disabled &= ~(1 << pipe);
> +
>         crtc->wm.pending = *pipe_wm;
>
>         spin_lock_irq(&crtc->wm.lock);
> @@ -3092,6 +3103,9 @@ void ilk_wm_pipe_post_disable(struct intel_crtc *crtc)
>         /* pending update (if any) got cancelled */
>         crtc->wm.pending = crtc->wm.active;
>
> +       /* allow LP1+ watermarks again */
> +       dev_priv->wm.lp_disabled &= ~(1 << crtc->pipe);
> +
>         ilk_update_watermarks(dev, true);
>
>         mutex_unlock(&dev_priv->wm.mutex);
> @@ -3145,7 +3159,7 @@ static int ilk_update_sprite_wm(struct intel_plane *plane,
>          *
>          * WaCxSRDisabledForSpriteScaling:ivb
>          */
> -       if (IS_IVYBRIDGE(dev) && config->spr.scaled && ilk_disable_lp_wm(dev))
> +       if (IS_IVYBRIDGE(dev) && config->spr.scaled && ilk_disable_lp_wm(crtc))
>                 intel_wait_for_vblank(dev, plane->pipe);
>
>         params.pri = config->pri;
> --
> 1.8.5.5
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx



-- 
Paulo Zanoni
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2014-06-04 18:30 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-22 14:48 [PATCH v2 00/16] drm/i915: Two part watermark update for ILK+, part 2 ville.syrjala
2014-05-22 14:48 ` [PATCH v2 01/16] drm/i915: Keep vblank interrupts enabled while enabling/disabling planes ville.syrjala
2014-05-26 13:56   ` Daniel Vetter
2014-06-04  6:00     ` Arun Murthy
2014-06-10 16:22       ` Ville Syrjälä
2014-05-22 14:48 ` [PATCH 02/16] drm/i915: Leave interrupts enabled while disabling crtcs during suspend ville.syrjala
2014-05-22 14:48 ` [PATCH 03/16] drm/i915: Check hw vs. sw watermark state after programming ville.syrjala
2014-05-22 14:48 ` [PATCH 04/16] drm/i915: Refactor ilk_validate_pipe_wm() ville.syrjala
2014-05-22 14:48 ` [PATCH v2 05/16] drm/i915: Refactor ilk_update_wm ville.syrjala
2014-05-22 14:48 ` [PATCH 06/16] drm/i915: Add dev_priv->wm.mutex ville.syrjala
2014-05-22 14:48 ` [PATCH v2 07/16] drm/i915: Add vblank based delayed watermark update mechanism ville.syrjala
2014-06-03 18:50   ` Paulo Zanoni
2014-06-03 19:32     ` Ville Syrjälä
2014-06-04 14:01       ` Paulo Zanoni
2014-06-04 16:10         ` Daniel Vetter
2014-06-09 15:01           ` Ville Syrjälä
2014-05-22 14:48 ` [PATCH v2 08/16] drm/i915: Split watermark programming into pre and post steps ville.syrjala
2014-06-03 20:51   ` Paulo Zanoni
2014-06-04 16:22     ` Daniel Vetter
2014-06-09 17:03       ` Ville Syrjälä
2014-06-10 11:46         ` Jani Nikula
2014-05-22 14:48 ` [PATCH v2 09/16] drm/i915: Actually perform the watermark update in two phases ville.syrjala
2014-06-03 22:47   ` Paulo Zanoni
2014-06-09 18:28     ` Ville Syrjälä
2014-05-22 14:48 ` [PATCH v2 10/16] drm/i915: Wait for watermark updates to finish before disabling a pipe ville.syrjala
2014-06-04 13:54   ` Paulo Zanoni
2014-05-22 14:48 ` [PATCH 11/16] drm/i915: Refactor get_other_active_crtc() ville.syrjala
2014-06-04 16:59   ` Paulo Zanoni
2014-05-22 14:48 ` [PATCH 12/16] drm/i915: Disable LP1+ watermarks while changing the number of active pipes ville.syrjala
2014-06-04 18:24   ` Paulo Zanoni
2014-06-09 16:51     ` Ville Syrjälä
2014-05-22 14:48 ` [PATCH v2 13/16] drm/i915: Keep track of who disabled LP1+ watermarks ville.syrjala
2014-06-04 18:30   ` Paulo Zanoni [this message]
2014-05-22 14:48 ` [PATCH 14/16] drm/i915: Prefer the 5/6 DDB split when primary is disabled ville.syrjala
2014-06-04 18:34   ` Paulo Zanoni
2014-05-22 14:48 ` [PATCH 15/16] drm/i915: Add a workaround for sprite only <-> primary only switching ville.syrjala
2014-06-04 18:44   ` Paulo Zanoni
2014-05-22 14:48 ` [PATCH 16/16] drm/i915: Don't disable LP1+ watermarks for every frame when scaled ville.syrjala
2014-06-04 18:49   ` Paulo Zanoni

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='CA+gsUGTmmhtSmAngnG_GSgMhVFnoVkZTSsHKFSe=tc3+DcEn8w@mail.gmail.com' \
    --to=przanoni@gmail.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@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.