[Intel-gfx] [RFC][PATCH] drm/i915: set lvds dual channel according to VBT

Florian Mickler florian at mickler.org
Tue Jul 7 15:02:46 CEST 2009


On Tue,  7 Jul 2009 13:18:24 +0800
ling.ma at intel.com wrote:

> We judge whether integrated lvds is dual channel or single channel
> from LVDS register set by vbios code, the patch try to fetch dual
> channel information from VBT, and set corresponding bits besides
> original approach.
> 
> Signed-off-by: Ma Ling <ling.ma at intel.com>
>
> diff --git a/drivers/gpu/drm/i915/intel_bios.c
> b/drivers/gpu/drm/i915/intel_bios.c index da22863..cb8639f 100644
> --- a/drivers/gpu/drm/i915/intel_bios.c
> +++ b/drivers/gpu/drm/i915/intel_bios.c
> @@ -32,6 +32,7 @@
>  
>  #define	SLAVE_ADDR1	0x70
>  #define	SLAVE_ADDR2	0x72
> +#define LVDS_DUAL_CHANNEL	0x2
>  
>  static void *
>  find_section(struct bdb_header *bdb, int section_id)
> @@ -104,19 +105,29 @@ parse_lfp_panel_data(struct drm_i915_private
> *dev_priv, struct lvds_dvo_timing *dvo_timing;
>  	struct drm_display_mode *panel_fixed_mode;
>  	int lfp_data_size;
> +	uint32_t channel_bits;
>  
>  	/* Defaults if we can't find VBT info */
>  	dev_priv->lvds_dither = 0;
>  	dev_priv->lvds_vbt = 0;
> +	dev_priv->lvds_dual_channel = 0;
>  
>  	lvds_options = find_section(bdb, BDB_LVDS_OPTIONS);
>  	if (!lvds_options)
>  		return;
>  
> +	/* Fetch lvds channel info */
> +	channel_bits = lvds_options->lvds_channel_bits &
> +		       (3 << lvds_options->panel_type);
> +	if (channel_bits) {
> +		channel_bits = channel_bits >>
> lvds_options->panel_type;
> +		if (channel_bits == LVDS_DUAL_CHANNEL)
> +			dev_priv->lvds_dual_channel = 1;
> +	}
> +

this does not work here. it sets my lvds to single channel which breaks
it. see http://bugs.freedesktop.org/22262 


and here:
@@ -645,7 +645,8 @@ intel_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc,
 	int err = target;
 
 	if (IS_I9XX(dev) && intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS) &&
-	    (I915_READ(LVDS) & LVDS_PORT_EN) != 0) {
+	    ((I915_READ(LVDS) & LVDS_PORT_EN) != 0 ||
+	     dev_priv->lvds_dual_channel)) {
 		/*
 		 * For LVDS, if the panel is on, just rely on its current
 		 * settings for dual-channel.  We haven't figured out how to


you patch the wrong 'if' ... 

Sincerely,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20090707/a1c34fd5/attachment.sig>


More information about the Intel-gfx mailing list