From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: intel-gfx <intel-gfx@lists.freedesktop.org>,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Try to re-use GOP / previous M-N-P settings for vlv DSI PLL
Date: Thu, 7 Nov 2019 13:24:32 +0200 [thread overview]
Message-ID: <20191107112432.GB1208@intel.com> (raw)
In-Reply-To: <20191020182132.54945-1-hdegoede@redhat.com>
On Sun, Oct 20, 2019 at 08:21:32PM +0200, Hans de Goede wrote:
> Fastboot is not working on an Asus T100HA, it gives the following
> relevant messages / errors:
>
> dsi pll div 000201e6, ctrl 80080100
> fastset mismatch in dsi_pll.ctrl (expected 0x80100100, found 0x80080100)
> fastset mismatch in dsi_pll.div (expected 0x0002008e, found 0x000201e6)
>
> The problem seems to be that the GOP picks 5 for the P divisor, where as
> we end up picking 4.
>
> This commit fixes this by first checking of the currently configured
> DSI PLL settings match the desired pclk and if they do, stick with
> the currently configured PLL settings.
>
> Note that vlv_dsi_get_pclk() stores the read ctrl and div values inside
> config->dsi_pll, so they are set to the GOP / previous values after
> calling it.
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> drivers/gpu/drm/i915/display/vlv_dsi_pll.c | 26 +++++++++++++++-------
> 1 file changed, 18 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/vlv_dsi_pll.c b/drivers/gpu/drm/i915/display/vlv_dsi_pll.c
> index 95f39cd0ce02..4a09edecd597 100644
> --- a/drivers/gpu/drm/i915/display/vlv_dsi_pll.c
> +++ b/drivers/gpu/drm/i915/display/vlv_dsi_pll.c
> @@ -119,15 +119,25 @@ int vlv_dsi_pll_compute(struct intel_encoder *encoder,
> struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
> int ret;
> - u32 dsi_clk;
> -
> - dsi_clk = dsi_clk_from_pclk(intel_dsi->pclk, intel_dsi->pixel_format,
> - intel_dsi->lane_count);
> + u32 dsi_clk, current_pclk;
>
> - ret = dsi_calc_mnp(dev_priv, config, dsi_clk);
> - if (ret) {
> - DRM_DEBUG_KMS("dsi_calc_mnp failed\n");
> - return ret;
> + /*
> + * For exact matches, the GOP may pick another set of divisors
> + * then we do, if the GOP settings are an exact match keep them.
> + */
> + current_pclk = vlv_dsi_get_pclk(encoder, config);
One is not allowed to touch the hw in .compute_config().
The question is why does the GOP generate a different P divider?
Does it use a slightly different clock?
> + if (current_pclk == intel_dsi->pclk) {
> + config->dsi_pll.ctrl &= DSI_PLL_P1_POST_DIV_MASK;
> + } else {
> + dsi_clk = dsi_clk_from_pclk(intel_dsi->pclk,
> + intel_dsi->pixel_format,
> + intel_dsi->lane_count);
> +
> + ret = dsi_calc_mnp(dev_priv, config, dsi_clk);
> + if (ret) {
> + DRM_DEBUG_KMS("dsi_calc_mnp failed\n");
> + return ret;
> + }
> }
>
> if (intel_dsi->ports & (1 << PORT_A))
> --
> 2.23.0
--
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
WARNING: multiple messages have this Message-ID (diff)
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: intel-gfx <intel-gfx@lists.freedesktop.org>,
dri-devel@lists.freedesktop.org,
Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [PATCH] drm/i915: Try to re-use GOP / previous M-N-P settings for vlv DSI PLL
Date: Thu, 7 Nov 2019 13:24:32 +0200 [thread overview]
Message-ID: <20191107112432.GB1208@intel.com> (raw)
Message-ID: <20191107112432.OIh_6lr5z0t5uOAVf-z-sOS9xN41fM4zGtthcOsLoZA@z> (raw)
In-Reply-To: <20191020182132.54945-1-hdegoede@redhat.com>
On Sun, Oct 20, 2019 at 08:21:32PM +0200, Hans de Goede wrote:
> Fastboot is not working on an Asus T100HA, it gives the following
> relevant messages / errors:
>
> dsi pll div 000201e6, ctrl 80080100
> fastset mismatch in dsi_pll.ctrl (expected 0x80100100, found 0x80080100)
> fastset mismatch in dsi_pll.div (expected 0x0002008e, found 0x000201e6)
>
> The problem seems to be that the GOP picks 5 for the P divisor, where as
> we end up picking 4.
>
> This commit fixes this by first checking of the currently configured
> DSI PLL settings match the desired pclk and if they do, stick with
> the currently configured PLL settings.
>
> Note that vlv_dsi_get_pclk() stores the read ctrl and div values inside
> config->dsi_pll, so they are set to the GOP / previous values after
> calling it.
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> drivers/gpu/drm/i915/display/vlv_dsi_pll.c | 26 +++++++++++++++-------
> 1 file changed, 18 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/vlv_dsi_pll.c b/drivers/gpu/drm/i915/display/vlv_dsi_pll.c
> index 95f39cd0ce02..4a09edecd597 100644
> --- a/drivers/gpu/drm/i915/display/vlv_dsi_pll.c
> +++ b/drivers/gpu/drm/i915/display/vlv_dsi_pll.c
> @@ -119,15 +119,25 @@ int vlv_dsi_pll_compute(struct intel_encoder *encoder,
> struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
> int ret;
> - u32 dsi_clk;
> -
> - dsi_clk = dsi_clk_from_pclk(intel_dsi->pclk, intel_dsi->pixel_format,
> - intel_dsi->lane_count);
> + u32 dsi_clk, current_pclk;
>
> - ret = dsi_calc_mnp(dev_priv, config, dsi_clk);
> - if (ret) {
> - DRM_DEBUG_KMS("dsi_calc_mnp failed\n");
> - return ret;
> + /*
> + * For exact matches, the GOP may pick another set of divisors
> + * then we do, if the GOP settings are an exact match keep them.
> + */
> + current_pclk = vlv_dsi_get_pclk(encoder, config);
One is not allowed to touch the hw in .compute_config().
The question is why does the GOP generate a different P divider?
Does it use a slightly different clock?
> + if (current_pclk == intel_dsi->pclk) {
> + config->dsi_pll.ctrl &= DSI_PLL_P1_POST_DIV_MASK;
> + } else {
> + dsi_clk = dsi_clk_from_pclk(intel_dsi->pclk,
> + intel_dsi->pixel_format,
> + intel_dsi->lane_count);
> +
> + ret = dsi_calc_mnp(dev_priv, config, dsi_clk);
> + if (ret) {
> + DRM_DEBUG_KMS("dsi_calc_mnp failed\n");
> + return ret;
> + }
> }
>
> if (intel_dsi->ports & (1 << PORT_A))
> --
> 2.23.0
--
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
WARNING: multiple messages have this Message-ID (diff)
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: intel-gfx <intel-gfx@lists.freedesktop.org>,
dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Try to re-use GOP / previous M-N-P settings for vlv DSI PLL
Date: Thu, 7 Nov 2019 13:24:32 +0200 [thread overview]
Message-ID: <20191107112432.GB1208@intel.com> (raw)
Message-ID: <20191107112432._g5tqy0pYTXdso7ULju_NAJIUmya8YftYX5Zq3dRfSg@z> (raw)
In-Reply-To: <20191020182132.54945-1-hdegoede@redhat.com>
On Sun, Oct 20, 2019 at 08:21:32PM +0200, Hans de Goede wrote:
> Fastboot is not working on an Asus T100HA, it gives the following
> relevant messages / errors:
>
> dsi pll div 000201e6, ctrl 80080100
> fastset mismatch in dsi_pll.ctrl (expected 0x80100100, found 0x80080100)
> fastset mismatch in dsi_pll.div (expected 0x0002008e, found 0x000201e6)
>
> The problem seems to be that the GOP picks 5 for the P divisor, where as
> we end up picking 4.
>
> This commit fixes this by first checking of the currently configured
> DSI PLL settings match the desired pclk and if they do, stick with
> the currently configured PLL settings.
>
> Note that vlv_dsi_get_pclk() stores the read ctrl and div values inside
> config->dsi_pll, so they are set to the GOP / previous values after
> calling it.
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> drivers/gpu/drm/i915/display/vlv_dsi_pll.c | 26 +++++++++++++++-------
> 1 file changed, 18 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/vlv_dsi_pll.c b/drivers/gpu/drm/i915/display/vlv_dsi_pll.c
> index 95f39cd0ce02..4a09edecd597 100644
> --- a/drivers/gpu/drm/i915/display/vlv_dsi_pll.c
> +++ b/drivers/gpu/drm/i915/display/vlv_dsi_pll.c
> @@ -119,15 +119,25 @@ int vlv_dsi_pll_compute(struct intel_encoder *encoder,
> struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
> int ret;
> - u32 dsi_clk;
> -
> - dsi_clk = dsi_clk_from_pclk(intel_dsi->pclk, intel_dsi->pixel_format,
> - intel_dsi->lane_count);
> + u32 dsi_clk, current_pclk;
>
> - ret = dsi_calc_mnp(dev_priv, config, dsi_clk);
> - if (ret) {
> - DRM_DEBUG_KMS("dsi_calc_mnp failed\n");
> - return ret;
> + /*
> + * For exact matches, the GOP may pick another set of divisors
> + * then we do, if the GOP settings are an exact match keep them.
> + */
> + current_pclk = vlv_dsi_get_pclk(encoder, config);
One is not allowed to touch the hw in .compute_config().
The question is why does the GOP generate a different P divider?
Does it use a slightly different clock?
> + if (current_pclk == intel_dsi->pclk) {
> + config->dsi_pll.ctrl &= DSI_PLL_P1_POST_DIV_MASK;
> + } else {
> + dsi_clk = dsi_clk_from_pclk(intel_dsi->pclk,
> + intel_dsi->pixel_format,
> + intel_dsi->lane_count);
> +
> + ret = dsi_calc_mnp(dev_priv, config, dsi_clk);
> + if (ret) {
> + DRM_DEBUG_KMS("dsi_calc_mnp failed\n");
> + return ret;
> + }
> }
>
> if (intel_dsi->ports & (1 << PORT_A))
> --
> 2.23.0
--
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-11-07 11:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-20 18:21 [PATCH] drm/i915: Try to re-use GOP / previous M-N-P settings for vlv DSI PLL Hans de Goede
2019-10-20 19:10 ` ✓ Fi.CI.BAT: success for " Patchwork
2019-10-20 21:23 ` ✓ Fi.CI.IGT: " Patchwork
2019-11-07 11:24 ` Ville Syrjälä [this message]
2019-11-07 11:24 ` [Intel-gfx] [PATCH] " Ville Syrjälä
2019-11-07 11:24 ` Ville Syrjälä
2019-11-07 11:37 ` Daniel Vetter
2019-11-07 11:37 ` [Intel-gfx] " Daniel Vetter
2019-11-07 11:37 ` Daniel Vetter
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=20191107112432.GB1208@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=hdegoede@redhat.com \
--cc=intel-gfx@lists.freedesktop.org \
/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.