All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhenyu Wang <zhenyuw@linux.intel.com>
To: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: intel-gfx@lists.freedesktop.org, "Liu, Yuanhan" <yuanhan.liu@intel.com>
Subject: Re: [PATCH] drm/i915: skip FDI & PCH enabling for DP_A
Date: Thu, 6 Jan 2011 09:43:16 +0800	[thread overview]
Message-ID: <20110106014316.GC22542@zhen-devel.sh.intel.com> (raw)
In-Reply-To: <1294252308-18736-1-git-send-email-jbarnes@virtuousgeek.org>


[-- Attachment #1.1: Type: text/plain, Size: 4620 bytes --]

On 2011.01.05 10:31:48 -0800, Jesse Barnes wrote:
> eDP on the CPU doesn't need the PCH set up at all, it can in fact cause
> problems.  So avoid FDI training and PCH PLL enabling in that case.
> 

Right, I think that's what I did during early eDP enabling.
Yuanhan, please test this on sandybridge eDP panel.

> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
> ---
>  drivers/gpu/drm/i915/intel_display.c |   97 +++++++++++++++++++++-------------
>  1 files changed, 60 insertions(+), 37 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 395acb8..2441a00 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -2616,49 +2616,21 @@ static bool intel_crtc_driving_pch(struct drm_crtc *crtc)
>  	return true;
>  }
>  
> -static void ironlake_crtc_enable(struct drm_crtc *crtc)
> +/*
> + * Enable PCH resources required for PCH ports:
> + *   - PCH PLLs
> + *   - FDI training & RX/TX
> + *   - update transcoder timings
> + *   - DP transcoding bits
> + *   - transcoder
> + */
> +static void ironlake_pch_enable(struct drm_crtc *crtc)
>  {
>  	struct drm_device *dev = crtc->dev;
>  	struct drm_i915_private *dev_priv = dev->dev_private;
>  	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
>  	int pipe = intel_crtc->pipe;
> -	int plane = intel_crtc->plane;
>  	u32 reg, temp;
> -	bool is_pch_port;
> -
> -	if (intel_crtc->active)
> -		return;
> -
> -	intel_crtc->active = true;
> -	intel_update_watermarks(dev);
> -
> -	if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) {
> -		temp = I915_READ(PCH_LVDS);
> -		if ((temp & LVDS_PORT_EN) == 0)
> -			I915_WRITE(PCH_LVDS, temp | LVDS_PORT_EN);
> -	}
> -
> -	ironlake_fdi_enable(crtc);
> -
> -	/* Enable panel fitting for LVDS */
> -	if (dev_priv->pch_pf_size &&
> -	    (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS) || HAS_eDP)) {
> -		/* Force use of hard-coded filter coefficients
> -		 * as some pre-programmed values are broken,
> -		 * e.g. x201.
> -		 */
> -		I915_WRITE(pipe ? PFB_CTL_1 : PFA_CTL_1,
> -			   PF_ENABLE | PF_FILTER_MED_3x3);
> -		I915_WRITE(pipe ? PFB_WIN_POS : PFA_WIN_POS,
> -			   dev_priv->pch_pf_pos);
> -		I915_WRITE(pipe ? PFB_WIN_SZ : PFA_WIN_SZ,
> -			   dev_priv->pch_pf_size);
> -	}
> -
> -	is_pch_port = intel_crtc_driving_pch(crtc);
> -
> -	intel_enable_pipe(dev_priv, pipe, is_pch_port);
> -	intel_enable_plane(dev_priv, plane, pipe);
>  
>  	/* For PCH output, training FDI link */
>  	if (IS_GEN6(dev))
> @@ -2727,6 +2699,57 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc)
>  	}
>  
>  	intel_enable_transcoder(dev_priv, pipe);
> +}
> +
> +static void ironlake_crtc_enable(struct drm_crtc *crtc)
> +{
> +	struct drm_device *dev = crtc->dev;
> +	struct drm_i915_private *dev_priv = dev->dev_private;
> +	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> +	int pipe = intel_crtc->pipe;
> +	int plane = intel_crtc->plane;
> +	u32 temp;
> +	bool is_pch_port;
> +
> +	if (intel_crtc->active)
> +		return;
> +
> +	intel_crtc->active = true;
> +	intel_update_watermarks(dev);
> +
> +	if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) {
> +		temp = I915_READ(PCH_LVDS);
> +		if ((temp & LVDS_PORT_EN) == 0)
> +			I915_WRITE(PCH_LVDS, temp | LVDS_PORT_EN);
> +	}
> +
> +	is_pch_port = intel_crtc_driving_pch(crtc);
> +
> +	if (is_pch_port)
> +		ironlake_fdi_enable(crtc);
> +	else
> +		ironlake_fdi_disable(crtc);
> +
> +	/* Enable panel fitting for LVDS */
> +	if (dev_priv->pch_pf_size &&
> +	    (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS) || HAS_eDP)) {
> +		/* Force use of hard-coded filter coefficients
> +		 * as some pre-programmed values are broken,
> +		 * e.g. x201.
> +		 */
> +		I915_WRITE(pipe ? PFB_CTL_1 : PFA_CTL_1,
> +			   PF_ENABLE | PF_FILTER_MED_3x3);
> +		I915_WRITE(pipe ? PFB_WIN_POS : PFA_WIN_POS,
> +			   dev_priv->pch_pf_pos);
> +		I915_WRITE(pipe ? PFB_WIN_SZ : PFA_WIN_SZ,
> +			   dev_priv->pch_pf_size);
> +	}
> +
> +	intel_enable_pipe(dev_priv, pipe, is_pch_port);
> +	intel_enable_plane(dev_priv, plane, pipe);
> +
> +	if (is_pch_port)
> +		ironlake_pch_enable(crtc);
>  
>  	intel_crtc_load_lut(crtc);
>  	intel_update_fbc(dev);
> -- 
> 1.7.0.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2011-01-06  1:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-05 18:31 [PATCH] drm/i915: skip FDI & PCH enabling for DP_A Jesse Barnes
2011-01-06  1:42 ` Yuanhan Liu
2011-01-06  9:19   ` Yuanhan Liu
2011-01-06  1:43 ` Zhenyu Wang [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-02-15 23:08 Jesse Barnes
2011-02-15 23:11 ` Jesse Barnes

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=20110106014316.GC22542@zhen-devel.sh.intel.com \
    --to=zhenyuw@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jbarnes@virtuousgeek.org \
    --cc=yuanhan.liu@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 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.