[Intel-gfx] [PATCH 1/3] drm/i915: parse eDP panel color depth from VBT block

Eric Anholt eric at anholt.net
Wed Jan 13 00:03:03 CET 2010


On Tue, 12 Jan 2010 05:38:30 +0800, Zhenyu Wang <zhenyuw at linux.intel.com> wrote:
> Signed-off-by: Zhenyu Wang <zhenyuw at linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h   |    1 +
>  drivers/gpu/drm/i915/intel_bios.c |   26 ++++++++++++++++++++++++
>  drivers/gpu/drm/i915/intel_bios.h |   40 +++++++++++++++++++++++++++++++++++++
>  3 files changed, 67 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 29dd676..5f3ee0c 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -283,6 +283,7 @@ typedef struct drm_i915_private {
>  	unsigned int lvds_use_ssc:1;
>  	unsigned int edp_support:1;
>  	int lvds_ssc_freq;
> +	int edp_bpp;
>  
>  	struct notifier_block lid_notifier;
>  
> diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
> index f275677..d4252be 100644
> --- a/drivers/gpu/drm/i915/intel_bios.c
> +++ b/drivers/gpu/drm/i915/intel_bios.c
> @@ -33,6 +33,8 @@
>  #define	SLAVE_ADDR1	0x70
>  #define	SLAVE_ADDR2	0x72
>  
> +static int panel_type;
> +
>  static void *
>  find_section(struct bdb_header *bdb, int section_id)
>  {
> @@ -128,6 +130,7 @@ parse_lfp_panel_data(struct drm_i915_private *dev_priv,
>  	dev_priv->lvds_dither = lvds_options->pixel_dither;
>  	if (lvds_options->panel_type == 0xff)
>  		return;
> +	panel_type = lvds_options->panel_type;
>  
>  	lvds_lfp_data = find_section(bdb, BDB_LVDS_LFP_DATA);
>  	if (!lvds_lfp_data)
> @@ -405,6 +408,28 @@ parse_driver_features(struct drm_i915_private *dev_priv,
>  }
>  
>  static void
> +parse_edp(struct drm_i915_private *dev_priv, struct bdb_header *bdb)
> +{
> +	struct bdb_edp *edp;
> +
> +	edp = find_section(bdb, BDB_EDP);
> +	if (!edp)
> +		return;
> +
> +	switch ((edp->color_depth >> (panel_type * 2)) & 3) {
> +	case EDP_18BPP:
> +		dev_priv->edp_bpp = 18;
> +		break;
> +	case EDP_24BPP:
> +		dev_priv->edp_bpp = 24;
> +		break;
> +	case EDP_30BPP:
> +		dev_priv->edp_bpp = 30;
> +		break;
> +	}
> +}

So if we don't find this section in the BIOS, the later hardware setup
according to edp_bpp will not set the pipe BPP.  Are we sure this VBT
section will be there?  Seems like we should at least warn and try
something not surely broken if we don't find the BIOS table.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20100112/023fb4e7/attachment.sig>


More information about the Intel-gfx mailing list