public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
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 v3.5 02.5/22] drm/i915: add intel_display_suspend
Date: Fri, 22 May 2015 16:03:12 -0700	[thread overview]
Message-ID: <20150522230312.GA27492@intel.com> (raw)
In-Reply-To: <555DD09B.7050407@linux.intel.com>

On Thu, May 21, 2015 at 02:33:31PM +0200, Maarten Lankhorst wrote:
> This is a function used to disable all crtc's. This makes it clearer
> to distinguish between when mode needs to be preserved and when
> it can be trashed.

To clarify, when you talk about mode being preserved or trashed here,
you're talking about the hardware's idea of the mode, not the driver's
software state, right?  I.e., because when we shut down a power well the
registers vanish and whatever was programmed in them is lost?

See my comments farther down.

> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
> Oops, I was trashing all state during suspend and on gpu reset.
> I will send an amended intel_crtc_control patch too with the
> suspend and prepare_reset parts taken out.
> 
>  drivers/gpu/drm/i915/i915_drv.c      |  4 +---
>  drivers/gpu/drm/i915/intel_display.c | 29 +++++++++++++++++++----------
>  drivers/gpu/drm/i915/intel_drv.h     |  1 +
>  3 files changed, 21 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 5cc57f2ec192..d1a090a9f653 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -600,7 +600,6 @@ static int skl_resume_prepare(struct drm_i915_private *dev_priv);
>  static int i915_drm_suspend(struct drm_device *dev)
>  {
>  	struct drm_i915_private *dev_priv = dev->dev_private;
> -	struct drm_crtc *crtc;
>  	pci_power_t opregion_target_state;
>  	int error;
>  
> @@ -631,8 +630,7 @@ static int i915_drm_suspend(struct drm_device *dev)
>  	 * for _thaw. Also, power gate the CRTC power wells.
>  	 */
>  	drm_modeset_lock_all(dev);
> -	for_each_crtc(dev, crtc)
> -		intel_crtc_control(crtc, false);
> +	intel_display_suspend(dev);

I'm not terribly familiar with the power well details, but it looks like
part of the motivation of commit

        commit b04c5bd6fda54703e56f29569e4bca489d6c5a5c
        Author: Borun Fu <borun.fu@intel.com>
        Date:   Sat Jul 12 10:02:27 2014 +0530

            drm/i915: Power gating display wells during i915_pm_suspend

which added intel_crtc_control() was to ensure the power wells were
gated at this point; by replacing the intel_crtc_control() with
intel_display_suspend() here, you're removing that power well
programming...is that intentional (and is it going to cause the display
to stay in D0 state)?

If it is intentional, the comment above this block is out of date now.
Since this patch (and the following one) seem to change the semantics of
when we're touching power wells at various points in the code, maybe you
can elaborate a little bit on that in the commit message of one or both
commits.


Matt

>  	drm_modeset_unlock_all(dev);
>  
>  	intel_dp_mst_suspend(dev);
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index cae36ec1c2ef..8d50c4ca561f 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -3204,9 +3204,6 @@ void intel_crtc_reset(struct intel_crtc *crtc)
>  
>  void intel_prepare_reset(struct drm_device *dev)
>  {
> -	struct drm_i915_private *dev_priv = to_i915(dev);
> -	struct intel_crtc *crtc;
> -
>  	/* no reset support for gen2 */
>  	if (IS_GEN2(dev))
>  		return;
> @@ -3221,13 +3218,7 @@ void intel_prepare_reset(struct drm_device *dev)
>  	 * Disabling the crtcs gracefully seems nicer. Also the
>  	 * g33 docs say we should at least disable all the planes.
>  	 */
> -	for_each_intel_crtc(dev, crtc) {
> -		if (!crtc->active)
> -			continue;
> -
> -		intel_crtc_disable_planes(&crtc->base);
> -		dev_priv->display.crtc_disable(&crtc->base);
> -	}
> +	intel_display_suspend(dev);
>  }
>  
>  void intel_finish_reset(struct drm_device *dev)
> @@ -6018,6 +6009,24 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc)
>  	mutex_unlock(&dev->struct_mutex);
>  }
>  
> +/*
> + * turn all crtc's off, but do not adjust state
> + * This has to be paired with a call to intel_modeset_setup_hw_state.
> + */
> +void intel_display_suspend(struct drm_device *dev)
> +{
> +	struct drm_i915_private *dev_priv = to_i915(dev);
> +	struct drm_crtc *crtc;
> +
> +	for_each_crtc(dev, crtc) {
> +		if (!to_intel_crtc(crtc)->active)
> +			continue;
> +
> +		intel_crtc_disable_planes(crtc);
> +		dev_priv->display.crtc_disable(crtc);
> +	}
> +}
> +
>  /* Master function to enable/disable CRTC and corresponding power wells */
>  void intel_crtc_control(struct drm_crtc *crtc, bool enable)
>  {
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index 70d0cc8fe70e..c24d670529e3 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -992,6 +992,7 @@ int intel_pch_rawclk(struct drm_device *dev);
>  void intel_mark_busy(struct drm_device *dev);
>  void intel_mark_idle(struct drm_device *dev);
>  void intel_crtc_restore_mode(struct drm_crtc *crtc);
> +void intel_display_suspend(struct drm_device *dev);
>  void intel_crtc_control(struct drm_crtc *crtc, bool enable);
>  void intel_crtc_reset(struct intel_crtc *crtc);
>  void intel_crtc_update_dpms(struct drm_crtc *crtc);
> -- 
> 2.1.0
> 
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Matt Roper
Graphics Software Engineer
IoTG Platform Enabling & Development
Intel Corporation
(916) 356-2795
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-05-22 23:03 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-20 13:38 [PATCH v3 00/22] drm/i915: Convert to atomic, part 2 Maarten Lankhorst
2015-05-20 13:38 ` [PATCH v3 01/22] drm/i915: get rid of put_shared_dpll Maarten Lankhorst
2015-05-20 13:38 ` [PATCH v3 02/22] drm/i915: get rid of intel_crtc_disable and related code, v2 Maarten Lankhorst
2015-05-20 13:38 ` [PATCH v3 03/22] drm/i915: use intel_crtc_control everywhere, v2 Maarten Lankhorst
2015-05-21 12:33   ` [PATCH v3.5 02.5/22] drm/i915: add intel_display_suspend Maarten Lankhorst
2015-05-22 23:03     ` Matt Roper [this message]
2015-05-25  6:47       ` Maarten Lankhorst
2015-05-26  8:31       ` [PATCH v3.6 02.5/22] drm/i915: add intel_display_suspend, v2 Maarten Lankhorst
2015-05-21 12:34   ` [PATCH v3.5 03/22] drm/i915: use intel_crtc_control everywhere, v3 Maarten Lankhorst
2015-05-20 13:38 ` [PATCH v3 04/22] drm/i915: Use drm_atomic_helper_update_legacy_modeset_state, v2 Maarten Lankhorst
2015-05-20 13:38 ` [PATCH v3 05/22] drm/i915: Make __intel_set_mode() take only atomic state as argument Maarten Lankhorst
2015-05-20 13:38 ` [PATCH v3 06/22] drm/i915: Set mode_changed for audio in intel_modeset_pipe_config() Maarten Lankhorst
2015-05-20 13:38 ` [PATCH v3 07/22] drm/i915: Use crtc_state->active instead of crtc_state->enable Maarten Lankhorst
2015-05-20 13:38 ` [PATCH v3 08/22] drm/i915: Zap call to drm_plane_helper_disable Maarten Lankhorst
2015-05-28  1:37   ` Matt Roper
2015-05-28  7:22     ` Maarten Lankhorst
2015-05-20 13:38 ` [PATCH v3 09/22] drm/i915: calculate primary visibility changes instead of calling from set_config Maarten Lankhorst
2015-05-20 16:04 ` [PATCH v3 10/22] drm/i915: Support modeset across multiple pipes maarten.lankhorst
2015-05-20 16:04   ` [PATCH v3 11/22] drm/i915: Use global atomic state for staged pll config, v2 maarten.lankhorst
2015-05-20 16:04   ` [PATCH v3 12/22] drm/i915: Use drm_atomic_helper_swap_state in intel_atomic_commit maarten.lankhorst
2015-05-20 16:04   ` [PATCH v3 13/22] drm/i915: Swap planes on each crtc separately maarten.lankhorst
2015-05-29  0:56     ` Matt Roper
2015-05-20 16:04   ` [PATCH v3 14/22] drm/i915: Move cdclk and pll setup to intel_modeset_compute_config() maarten.lankhorst
2015-05-29  0:55     ` Matt Roper
2015-06-01  6:31       ` Maarten Lankhorst
2015-05-20 16:04   ` [PATCH v3 15/22] drm/i915: Read hw state into an atomic state struct maarten.lankhorst
2015-05-27  5:30     ` Maarten Lankhorst
2015-05-27 11:26       ` Daniel Vetter
2015-05-29  0:55     ` Matt Roper
2015-06-01  6:35       ` Maarten Lankhorst
2015-05-20 16:04   ` [PATCH v3 16/22] drm/i915: Implement intel_crtc_control using atomic state, v3 maarten.lankhorst
2015-05-21 12:40     ` [PATCH v3.5 16.5/22] drm/i915: Make intel_display_suspend atomic Maarten Lankhorst
2015-05-26  8:33       ` [PATCH v3.6 16.5/22] drm/i915: Make intel_display_suspend atomic, v2 Maarten Lankhorst
2015-05-26  8:35     ` [PATCH v3.6 16/22] drm/i915: Implement intel_crtc_control using atomic state, v4 Maarten Lankhorst
2015-05-29  0:57       ` Matt Roper
2015-06-01  6:39         ` Maarten Lankhorst
2015-05-20 16:04   ` [PATCH v3 17/22] drm/i915: move swap state to the right place maarten.lankhorst
2015-05-20 16:04   ` [PATCH v3 18/22] drm/i915: Use crtc->hwmode for vblanks, v2 maarten.lankhorst
2015-05-20 16:04   ` [PATCH v3 19/22] drm/i915: Remove use of crtc->config from i915_debugfs.c maarten.lankhorst
2015-05-20 16:04   ` [PATCH v3 20/22] drm/i915: Calculate haswell plane workaround, v3 maarten.lankhorst
2015-05-26  8:36     ` [PATCH v3.6 20/22] drm/i915: Calculate haswell plane workaround, v4 Maarten Lankhorst
2015-05-29  0:58       ` Matt Roper
2015-05-20 16:04   ` [PATCH v3 21/22] drm/i915: Use atomic state for calculating DVO_2X_MODE on i830 maarten.lankhorst
2015-05-20 16:04   ` [PATCH v3 22/22] drm/i915: use calculated state for vblank evasion maarten.lankhorst
2015-05-29  1:23 ` [PATCH v3 00/22] drm/i915: Convert to atomic, part 2 Matt Roper
2015-06-01  8:11 ` Ander Conselvan De Oliveira

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=20150522230312.GA27492@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