From: Jani Nikula <jani.nikula@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>,
Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [PATCH 07/12] drm/i915/psr: Re-create a hsw_psr_enable_source.
Date: Fri, 14 Jul 2017 13:06:27 +0300 [thread overview]
Message-ID: <87zic7jpss.fsf@nikula.org> (raw)
In-Reply-To: <20170712192042.19782-8-rodrigo.vivi@intel.com>
On Wed, 12 Jul 2017, Rodrigo Vivi <rodrigo.vivi@intel.com> wrote:
> This sequence is part of enable source anyways, but they
> only need to be executed once and not on every activation,
> So let's re-create hsw_enable_source.
>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> Cc: Jim Bride <jim.bride@linux.intel.com>
> Cc: Vathsala NAgaraju <vathsala.nagaraju@intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> drivers/gpu/drm/i915/intel_psr.c | 77 ++++++++++++++++++++++------------------
> 1 file changed, 43 insertions(+), 34 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c
> index 2fbf803f0667..422033a6f9f6 100644
> --- a/drivers/gpu/drm/i915/intel_psr.c
> +++ b/drivers/gpu/drm/i915/intel_psr.c
> @@ -219,6 +219,47 @@ static void hsw_psr_enable_sink(struct intel_dp *intel_dp)
> I915_WRITE(aux_ctl_reg, aux_ctl);
> }
>
> +static void hsw_psr_enable_source(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 intel_crtc *crtc = to_intel_crtc(dig_port->base.base.crtc);
> + enum transcoder cpu_transcoder = crtc->config->cpu_transcoder;
> +
> + u32 chicken;
> +
> + if (dev_priv->psr.psr2_support) {
> + chicken = PSR2_VSC_ENABLE_PROG_HEADER;
> + if (dev_priv->psr.y_cord_support)
> + chicken |= PSR2_ADD_VERTICAL_LINE_COUNT;
> + I915_WRITE(CHICKEN_TRANS(cpu_transcoder), chicken);
> + I915_WRITE(EDP_PSR_DEBUG_CTL,
> + EDP_PSR_DEBUG_MASK_MEMUP |
> + EDP_PSR_DEBUG_MASK_HPD |
> + EDP_PSR_DEBUG_MASK_LPSP |
> + EDP_PSR_DEBUG_MASK_MAX_SLEEP |
> + EDP_PSR_DEBUG_MASK_DISP_REG_WRITE);
> + } else {
> + /*
> + * Per Spec: Avoid continuous PSR exit by masking MEMUP
> + * and HPD. also mask LPSP to avoid dependency on other
> + * drivers that might block runtime_pm besides
> + * preventing other hw tracking issues now we can rely
> + * on frontbuffer tracking.
> + */
> + I915_WRITE(EDP_PSR_DEBUG_CTL,
> + EDP_PSR_DEBUG_MASK_MEMUP |
> + EDP_PSR_DEBUG_MASK_HPD |
> + EDP_PSR_DEBUG_MASK_LPSP);
> + }
> +
> + /*
> + * The rest of enable source sequence that should be here is actually
> + * executed during activation time. So check hsw_psr_activate().
> + */
> +}
> +
> static void vlv_psr_enable_source(struct intel_dp *intel_dp)
> {
> struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
> @@ -474,9 +515,6 @@ void intel_psr_enable(struct intel_dp *intel_dp)
> struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
> struct drm_device *dev = intel_dig_port->base.base.dev;
> struct drm_i915_private *dev_priv = to_i915(dev);
> - struct intel_crtc *crtc = to_intel_crtc(intel_dig_port->base.base.crtc);
> - enum transcoder cpu_transcoder = crtc->config->cpu_transcoder;
> - u32 chicken;
>
> if (!HAS_PSR(dev_priv))
> return;
> @@ -501,34 +539,11 @@ void intel_psr_enable(struct intel_dp *intel_dp)
>
> hsw_psr_setup_vsc(intel_dp);
>
> - if (dev_priv->psr.psr2_support) {
> - chicken = PSR2_VSC_ENABLE_PROG_HEADER;
> - if (dev_priv->psr.y_cord_support)
> - chicken |= PSR2_ADD_VERTICAL_LINE_COUNT;
> - I915_WRITE(CHICKEN_TRANS(cpu_transcoder), chicken);
> - I915_WRITE(EDP_PSR_DEBUG_CTL,
> - EDP_PSR_DEBUG_MASK_MEMUP |
> - EDP_PSR_DEBUG_MASK_HPD |
> - EDP_PSR_DEBUG_MASK_LPSP |
> - EDP_PSR_DEBUG_MASK_MAX_SLEEP |
> - EDP_PSR_DEBUG_MASK_DISP_REG_WRITE);
> - } else {
> - /*
> - * Per Spec: Avoid continuous PSR exit by masking MEMUP
> - * and HPD. also mask LPSP to avoid dependency on other
> - * drivers that might block runtime_pm besides
> - * preventing other hw tracking issues now we can rely
> - * on frontbuffer tracking.
> - */
> - I915_WRITE(EDP_PSR_DEBUG_CTL,
> - EDP_PSR_DEBUG_MASK_MEMUP |
> - EDP_PSR_DEBUG_MASK_HPD |
> - EDP_PSR_DEBUG_MASK_LPSP);
> - }
> -
> /* Enable PSR on the panel */
> hsw_psr_enable_sink(intel_dp);
>
> + hsw_psr_enable_source(intel_dp);
> +
Wouldn't it be better to keep the order? Or have the order changed in a
separate patch if you need the order changed?
BR,
Jani.
> if (INTEL_GEN(dev_priv) >= 9)
> intel_psr_activate(intel_dp);
> } else {
> @@ -537,12 +552,6 @@ void intel_psr_enable(struct intel_dp *intel_dp)
> /* Enable PSR on the panel */
> vlv_psr_enable_sink(intel_dp);
>
> - /* On HSW+ enable_source also means go to PSR entry/active
> - * state as soon as idle_frame achieved and here would be
> - * to soon. However on VLV enable_source just enable PSR
> - * but let it on inactive state. So we might do this prior
> - * to active transition, i.e. here.
> - */
> vlv_psr_enable_source(intel_dp);
> }
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-07-14 10:01 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-12 19:20 [PATCH 00/12] PSR clean-up, new vfuncs and more use of HW tracking Rodrigo Vivi
2017-07-12 19:20 ` [PATCH 01/12] drm/i915/psr: Remove vlv_is_active function Rodrigo Vivi
2017-07-12 19:56 ` Chris Wilson
2017-07-12 21:07 ` Rodrigo Vivi
2017-07-12 19:20 ` [PATCH 02/12] drm/i915/psr: Avoid any PSR stuff on platforms without support Rodrigo Vivi
2017-07-12 19:20 ` [PATCH 03/12] drm/i915/psr: vfunc for disabling source Rodrigo Vivi
2017-07-12 19:20 ` [PATCH 04/12] drm/i915/psr: hsw_psr_activate Rodrigo Vivi
2017-09-07 20:07 ` Pandiyan, Dhinakaran
2017-07-12 19:20 ` [PATCH 05/12] drm/i915/psr: Add activate vfunc Rodrigo Vivi
2017-07-12 19:20 ` [PATCH 06/12] drm/i915/psr: Unify VSC setup functions Rodrigo Vivi
2017-07-12 19:20 ` [PATCH 07/12] drm/i915/psr: Re-create a hsw_psr_enable_source Rodrigo Vivi
2017-07-14 10:06 ` Jani Nikula [this message]
2017-07-14 16:35 ` [PATCH 1/2] " Rodrigo Vivi
2017-07-14 16:35 ` [PATCH 2/2] drm/i915/psr: Move hsw_enable_source after enabling sink Rodrigo Vivi
2017-07-12 19:20 ` [PATCH 08/12] drm/i915/psr: Re-org Activate after enable Rodrigo Vivi
2017-07-14 10:07 ` Jani Nikula
2017-07-14 16:40 ` [PATCH] " Rodrigo Vivi
2017-07-12 19:20 ` [PATCH 09/12] drm/i915/psr: Add setup VSC vfunc Rodrigo Vivi
2017-07-12 19:20 ` [PATCH 10/12] drm/i915/psr: Add enable_sink vfunc Rodrigo Vivi
2017-09-07 20:29 ` Pandiyan, Dhinakaran
2017-07-12 19:20 ` [PATCH 11/12] drm/i915/psr: Add enable_source vfunc Rodrigo Vivi
2017-09-07 20:30 ` Pandiyan, Dhinakaran
2017-07-12 19:20 ` [PATCH 12/12] drm/i915/psr: Use more PSR HW tracking Rodrigo Vivi
2017-07-12 19:37 ` ✗ Fi.CI.BAT: warning for PSR clean-up, new vfuncs and more use of " Patchwork
2017-07-14 16:38 ` ✗ Fi.CI.BAT: failure for PSR clean-up, new vfuncs and more use of HW tracking. (rev3) Patchwork
2017-07-14 16:58 ` ✓ Fi.CI.BAT: success for PSR clean-up, new vfuncs and more use of HW tracking. (rev4) Patchwork
2017-09-07 20:18 ` [PATCH 00/12] PSR clean-up, new vfuncs and more use of HW tracking Pandiyan, Dhinakaran
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=87zic7jpss.fsf@nikula.org \
--to=jani.nikula@linux.intel.com \
--cc=daniel.vetter@ffwll.ch \
--cc=dhinakaran.pandiyan@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=rodrigo.vivi@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