From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: "José Roberto de Souza" <jose.souza@intel.com>
Cc: intel-gfx@lists.freedesktop.org,
Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Subject: Re: [PATCH 02/11] drm/i915/psr: Move PSR exit specific code to hardware specific function
Date: Mon, 2 Apr 2018 11:09:17 -0700 [thread overview]
Message-ID: <20180402180917.GO2338@intel.com> (raw)
In-Reply-To: <20180330222336.5262-2-jose.souza@intel.com>
On Fri, Mar 30, 2018 at 03:23:27PM -0700, José Roberto de Souza wrote:
> To proper execute PSR exit it was using 'if (HAS_DDI(dev_priv))' to
> differentiate between VLV/CHV and HSW+ hardware, so here moving each
> hardware handling to his own function.
>
> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> drivers/gpu/drm/i915/i915_drv.h | 1 +
> drivers/gpu/drm/i915/intel_psr.c | 94 +++++++++++++++++++++++-----------------
> 2 files changed, 56 insertions(+), 39 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 5373b171bb96..a8d300280a2c 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -617,6 +617,7 @@ struct i915_psr {
> void (*enable_sink)(struct intel_dp *);
> void (*activate)(struct intel_dp *);
> void (*setup_vsc)(struct intel_dp *, const struct intel_crtc_state *);
> + void (*exit)(struct intel_dp *intel_dp);
> };
>
> enum intel_pch {
> diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c
> index fc7c36efd401..bcaac9e69f8c 100644
> --- a/drivers/gpu/drm/i915/intel_psr.c
> +++ b/drivers/gpu/drm/i915/intel_psr.c
> @@ -838,53 +838,67 @@ static void intel_psr_work(struct work_struct *work)
> mutex_unlock(&dev_priv->psr.lock);
> }
>
> -static void intel_psr_exit(struct drm_i915_private *dev_priv)
> +static void hsw_psr_exit(struct intel_dp *intel_dp)
> {
> - struct intel_dp *intel_dp = dev_priv->psr.enabled;
> - struct drm_crtc *crtc = dp_to_dig_port(intel_dp)->base.base.crtc;
> + struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
> + struct drm_device *dev = dig_port->base.base.dev;
> + struct drm_i915_private *dev_priv = to_i915(dev);
> + u32 val;
> +
> + if (dev_priv->psr.psr2_enabled) {
> + val = I915_READ(EDP_PSR2_CTL);
> + WARN_ON(!(val & EDP_PSR2_ENABLE));
> + I915_WRITE(EDP_PSR2_CTL, val & ~EDP_PSR2_ENABLE);
> + } else {
> + val = I915_READ(EDP_PSR_CTL);
> + WARN_ON(!(val & EDP_PSR_ENABLE));
> + I915_WRITE(EDP_PSR_CTL, val & ~EDP_PSR_ENABLE);
> + }
> +}
> +
> +static void vlv_psr_exit(struct intel_dp *intel_dp)
> +{
> + struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
> + struct drm_device *dev = dig_port->base.base.dev;
> + struct drm_i915_private *dev_priv = to_i915(dev);
> + struct drm_crtc *crtc = dig_port->base.base.crtc;
> enum pipe pipe = to_intel_crtc(crtc)->pipe;
> u32 val;
>
> - if (!dev_priv->psr.active)
> - return;
> + val = I915_READ(VLV_PSRCTL(pipe));
>
> - if (HAS_DDI(dev_priv)) {
> - if (dev_priv->psr.psr2_enabled) {
> - val = I915_READ(EDP_PSR2_CTL);
> - WARN_ON(!(val & EDP_PSR2_ENABLE));
> - I915_WRITE(EDP_PSR2_CTL, val & ~EDP_PSR2_ENABLE);
> - } else {
> - val = I915_READ(EDP_PSR_CTL);
> - WARN_ON(!(val & EDP_PSR_ENABLE));
> - I915_WRITE(EDP_PSR_CTL, val & ~EDP_PSR_ENABLE);
> - }
> - } else {
> - val = I915_READ(VLV_PSRCTL(pipe));
> + /*
> + * Here we do the transition drirectly from
> + * PSR_state 3 (active - no Remote Frame Buffer (RFB) update) to
> + * PSR_state 5 (exit).
> + * PSR State 4 (active with single frame update) can be skipped.
> + * On PSR_state 5 (exit) Hardware is responsible to transition
> + * back to PSR_state 1 (inactive).
> + * Now we are at Same state after vlv_psr_enable_source.
> + */
> + val &= ~VLV_EDP_PSR_ACTIVE_ENTRY;
> + I915_WRITE(VLV_PSRCTL(pipe), val);
>
> - /*
> - * Here we do the transition drirectly from
> - * PSR_state 3 (active - no Remote Frame Buffer (RFB) update) to
> - * PSR_state 5 (exit).
> - * PSR State 4 (active with single frame update) can be skipped.
> - * On PSR_state 5 (exit) Hardware is responsible to transition
> - * back to PSR_state 1 (inactive).
> - * Now we are at Same state after vlv_psr_enable_source.
> - */
> - val &= ~VLV_EDP_PSR_ACTIVE_ENTRY;
> - I915_WRITE(VLV_PSRCTL(pipe), val);
> + /*
> + * Send AUX wake up - Spec says after transitioning to PSR
> + * active we have to send AUX wake up by writing 01h in DPCD
> + * 600h of sink device.
> + * XXX: This might slow down the transition, but without this
> + * HW doesn't complete the transition to PSR_state 1 and we
> + * never get the screen updated.
> + */
> + drm_dp_dpcd_writeb(&intel_dp->aux, DP_SET_POWER,
> + DP_SET_POWER_D0);
> +}
>
> - /*
> - * Send AUX wake up - Spec says after transitioning to PSR
> - * active we have to send AUX wake up by writing 01h in DPCD
> - * 600h of sink device.
> - * XXX: This might slow down the transition, but without this
> - * HW doesn't complete the transition to PSR_state 1 and we
> - * never get the screen updated.
> - */
> - drm_dp_dpcd_writeb(&intel_dp->aux, DP_SET_POWER,
> - DP_SET_POWER_D0);
> - }
> +static void intel_psr_exit(struct drm_i915_private *dev_priv)
> +{
> + struct intel_dp *intel_dp = dev_priv->psr.enabled;
> +
> + if (!dev_priv->psr.active)
> + return;
>
> + dev_priv->psr.exit(intel_dp);
> dev_priv->psr.active = false;
> }
>
> @@ -1094,6 +1108,7 @@ void intel_psr_init(struct drm_i915_private *dev_priv)
> dev_priv->psr.enable_sink = vlv_psr_enable_sink;
> dev_priv->psr.activate = vlv_psr_activate;
> dev_priv->psr.setup_vsc = vlv_psr_setup_vsc;
> + dev_priv->psr.exit = vlv_psr_exit;
> } else {
> dev_priv->psr.has_hw_tracking = true;
> dev_priv->psr.enable_source = hsw_psr_enable_source;
> @@ -1101,5 +1116,6 @@ void intel_psr_init(struct drm_i915_private *dev_priv)
> dev_priv->psr.enable_sink = hsw_psr_enable_sink;
> dev_priv->psr.activate = hsw_psr_activate;
> dev_priv->psr.setup_vsc = hsw_psr_setup_vsc;
> + dev_priv->psr.exit = hsw_psr_exit;
> }
> }
> --
> 2.16.3
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-04-02 18:09 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-30 22:23 [PATCH 01/11] drm/i915/psr: Move specific HSW+ WARN_ON to HSW+ function José Roberto de Souza
2018-03-30 22:23 ` [PATCH 02/11] drm/i915/psr: Move PSR exit specific code to hardware specific function José Roberto de Souza
2018-04-02 18:09 ` Rodrigo Vivi [this message]
2018-03-30 22:23 ` [PATCH 03/11] drm/i915/psr: Share code between disable and exit José Roberto de Souza
2018-04-02 18:11 ` Rodrigo Vivi
2018-04-02 21:15 ` Souza, Jose
2018-03-30 22:23 ` [PATCH 04/11] drm/i915/psr: Remove intel_crtc_state parameter from disable() José Roberto de Souza
2018-04-02 18:13 ` Rodrigo Vivi
2018-04-03 17:52 ` Ville Syrjälä
2018-03-30 22:23 ` [PATCH 05/11] drm/i915/psr: Export intel_psr_activate/exit() José Roberto de Souza
2018-04-02 18:18 ` Rodrigo Vivi
2018-03-30 22:23 ` [PATCH 06/11] drm/i915/psr: Add intel_psr_activate_block_get()/put() José Roberto de Souza
2018-04-02 18:20 ` Rodrigo Vivi
2018-04-02 22:11 ` Souza, Jose
2018-04-03 17:32 ` Rodrigo Vivi
2018-03-30 22:23 ` [PATCH 07/11] drm/i915/dp: Exit PSR before do a aux channel transaction José Roberto de Souza
2018-04-02 18:23 ` Rodrigo Vivi
2018-04-02 18:42 ` Pandiyan, Dhinakaran
2018-04-02 22:16 ` Souza, Jose
2018-04-02 23:21 ` Souza, Jose
2018-04-02 19:00 ` Pandiyan, Dhinakaran
2018-04-02 22:15 ` Souza, Jose
2018-03-30 22:23 ` [PATCH 08/11] drm/i915: Keep IGT PSR and frontbuffer tests functional José Roberto de Souza
2018-04-02 18:26 ` Rodrigo Vivi
2018-03-30 22:23 ` [PATCH 09/11] drm/i915/psr: Begin to handle PSR/PSR2 errors set by sink José Roberto de Souza
2018-04-02 18:28 ` Rodrigo Vivi
2018-03-30 22:23 ` [PATCH 10/11] drm/i915/psr: Handle PSR RFB storage error José Roberto de Souza
2018-03-30 22:23 ` [PATCH 11/11] drm/i915/psr/bdw+: Enable CRC check in the static frame on the sink side José Roberto de Souza
2018-03-30 22:38 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/11] drm/i915/psr: Move specific HSW+ WARN_ON to HSW+ function Patchwork
2018-03-30 22:53 ` ✗ Fi.CI.BAT: " Patchwork
2018-04-02 18:06 ` [PATCH 01/11] " Rodrigo Vivi
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=20180402180917.GO2338@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=dhinakaran.pandiyan@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jose.souza@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).