Re: [PATCH v2 12/15] drm/i915: Band Gap WA

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 16, 2013 at 03:36:00PM +0300, Jani Nikula wrote:
> From: Shobhit Kumar <shobhit.kumar@xxxxxxxxx>
> 
> Signed-off-by: Shobhit Kumar <shobhit.kumar@xxxxxxxxx>
> Signed-off-by: ymohanma <yogesh.mohan.marimuthu@xxxxxxxxx>
> Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/intel_dsi.c |   48 ++++++++++++++++++++++++++++++++++++++
>  1 file changed, 48 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
> index 352ff46..676b310 100644
> --- a/drivers/gpu/drm/i915/intel_dsi.c
> +++ b/drivers/gpu/drm/i915/intel_dsi.c
> @@ -37,6 +37,51 @@
>  static const struct intel_dsi_device intel_dsi_devices[] = {
>  };
>  
> +
> +static void vlv_cck_modify(struct drm_i915_private *dev_priv, u32 reg, u32 val,
> +			   u32 mask)
> +{
> +	u32 tmp = vlv_cck_read(dev_priv, reg);
> +	tmp &= ~mask;
> +	tmp |= val;
> +	vlv_cck_write(dev_priv, reg, tmp);
> +}
> +
> +static void band_gap_wa(struct drm_i915_private *dev_priv)
> +{
> +	mutex_lock(&dev_priv->dpio_lock);
> +
> +	/* Enable bandgap fix in GOP driver */
> +	vlv_cck_modify(dev_priv, 0x6D, 0x00010000, 0x00030000);
> +	msleep(20);
> +	vlv_cck_modify(dev_priv, 0x6E, 0x00010000, 0x00030000);
> +	msleep(20);
> +	vlv_cck_modify(dev_priv, 0x6F, 0x00010000, 0x00030000);
> +	msleep(20);
> +	vlv_cck_modify(dev_priv, 0x00, 0x00008000, 0x00008000);
> +	msleep(20);
> +	vlv_cck_modify(dev_priv, 0x00, 0x00000000, 0x00008000);
> +	msleep(20);
> +
> +	/* Turn Display Trunk on */

This single comment here looks a bit inconsistent. Why have it for this
one case and not the others. Maybe we should just give the bits proper
names so we don't need such silly comments.

> +	vlv_cck_modify(dev_priv, 0x6B, 0x00020000, 0x00030000);
> +	msleep(20);
> +
> +	vlv_cck_modify(dev_priv, 0x6C, 0x00020000, 0x00030000);
> +	msleep(20);
> +
> +	vlv_cck_modify(dev_priv, 0x6D, 0x00020000, 0x00030000);
> +	msleep(20);
> +	vlv_cck_modify(dev_priv, 0x6E, 0x00020000, 0x00030000);
> +	msleep(20);
> +	vlv_cck_modify(dev_priv, 0x6F, 0x00020000, 0x00030000);

I wonder if we really need to force all the trunks on, or would it be
enough to clear the force off bits and rely on the signals from Punit
to do the rest. I suppose we should at least clear the DSI trunk force
on bits when disabling DSI output.

Can't say anything intelligent about the workaround in general as I've
not seen it mentioned anywhere. Based on the spec this appears to just
force the DSI trunk clocks off, then toggle some DSI releated reset,
and then force the clocks back on (also the dp and dpref trunks, even
though it didn't actually force them off in the first place, which seems
a bit weird).

Also wondering about all these sleeps. Do we really need them at every
step, or could we just disable all the trunk clocks -> sleep -> reset on ->
sleep -> reset off -> sleep -> turn the trunks back on -> sleep some
more. That's almost 300ms were sleeping here, and that's not even including
the sideband overhead.

> +
> +	mutex_unlock(&dev_priv->dpio_lock);
> +
> +	/* Need huge delay, otherwise clock is not stable */
> +	msleep(100);
> +}
> +
>  static struct intel_dsi *intel_attached_dsi(struct drm_connector *connector)
>  {
>  	return container_of(intel_attached_encoder(connector),
> @@ -291,6 +336,9 @@ static void intel_dsi_mode_set(struct intel_encoder *intel_encoder)
>  	/* Update the DSI PLL */
>  	vlv_enable_dsi_pll(intel_encoder);
>  
> +	/* XXX: Location of the call */
> +	band_gap_wa(dev_priv);
> +
>  	/* escape clock divider, 20MHz, shared for A and C. device ready must be
>  	 * off when doing this! txclkesc? */
>  	tmp = I915_READ(MIPI_CTRL(0));
> -- 
> 1.7.9.5
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux