[Intel-gfx] [PATCH 1/4] drm/i915: use a substruct in vbt data for edp

Daniel Vetter daniel at ffwll.ch
Tue Mar 29 11:43:02 UTC 2016


On Thu, Mar 24, 2016 at 05:50:20PM +0200, Jani Nikula wrote:
> Housekeeping, similar to psr, backlight, and dsi. No functional changes.
> 
> Signed-off-by: Jani Nikula <jani.nikula at intel.com>

Assuming gcc is still happy: Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>

> ---
>  drivers/gpu/drm/i915/i915_drv.h   | 19 ++++++++++---------
>  drivers/gpu/drm/i915/intel_bios.c | 38 +++++++++++++++++++-------------------
>  drivers/gpu/drm/i915/intel_ddi.c  |  8 ++++----
>  drivers/gpu/drm/i915/intel_dp.c   | 16 ++++++++--------
>  drivers/gpu/drm/i915/intel_lvds.c |  2 +-
>  5 files changed, 42 insertions(+), 41 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index b93ef7017c93..fe8021ecb254 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1446,15 +1446,16 @@ struct intel_vbt_data {
>  
>  	enum drrs_support_type drrs_type;
>  
> -	/* eDP */
> -	int edp_rate;
> -	int edp_lanes;
> -	int edp_preemphasis;
> -	int edp_vswing;
> -	bool edp_initialized;
> -	bool edp_support;
> -	int edp_bpp;
> -	struct edp_power_seq edp_pps;
> +	struct {
> +		int rate;
> +		int lanes;
> +		int preemphasis;
> +		int vswing;
> +		bool initialized;
> +		bool support;
> +		int bpp;
> +		struct edp_power_seq pps;
> +	} edp;
>  
>  	struct {
>  		bool full_link;
> diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
> index 083003b015f5..61eb7a6bb8f0 100644
> --- a/drivers/gpu/drm/i915/intel_bios.c
> +++ b/drivers/gpu/drm/i915/intel_bios.c
> @@ -527,7 +527,7 @@ parse_driver_features(struct drm_i915_private *dev_priv,
>  		return;
>  
>  	if (driver->lvds_config == BDB_DRIVER_FEATURE_EDP)
> -		dev_priv->vbt.edp_support = 1;
> +		dev_priv->vbt.edp.support = 1;
>  
>  	if (driver->dual_frequency)
>  		dev_priv->render_reclock_avail = true;
> @@ -552,20 +552,20 @@ parse_edp(struct drm_i915_private *dev_priv, const struct bdb_header *bdb)
>  
>  	edp = find_section(bdb, BDB_EDP);
>  	if (!edp) {
> -		if (dev_priv->vbt.edp_support)
> +		if (dev_priv->vbt.edp.support)
>  			DRM_DEBUG_KMS("No eDP BDB found but eDP panel supported.\n");
>  		return;
>  	}
>  
>  	switch ((edp->color_depth >> (panel_type * 2)) & 3) {
>  	case EDP_18BPP:
> -		dev_priv->vbt.edp_bpp = 18;
> +		dev_priv->vbt.edp.bpp = 18;
>  		break;
>  	case EDP_24BPP:
> -		dev_priv->vbt.edp_bpp = 24;
> +		dev_priv->vbt.edp.bpp = 24;
>  		break;
>  	case EDP_30BPP:
> -		dev_priv->vbt.edp_bpp = 30;
> +		dev_priv->vbt.edp.bpp = 30;
>  		break;
>  	}
>  
> @@ -573,14 +573,14 @@ parse_edp(struct drm_i915_private *dev_priv, const struct bdb_header *bdb)
>  	edp_pps = &edp->power_seqs[panel_type];
>  	edp_link_params = &edp->link_params[panel_type];
>  
> -	dev_priv->vbt.edp_pps = *edp_pps;
> +	dev_priv->vbt.edp.pps = *edp_pps;
>  
>  	switch (edp_link_params->rate) {
>  	case EDP_RATE_1_62:
> -		dev_priv->vbt.edp_rate = DP_LINK_BW_1_62;
> +		dev_priv->vbt.edp.rate = DP_LINK_BW_1_62;
>  		break;
>  	case EDP_RATE_2_7:
> -		dev_priv->vbt.edp_rate = DP_LINK_BW_2_7;
> +		dev_priv->vbt.edp.rate = DP_LINK_BW_2_7;
>  		break;
>  	default:
>  		DRM_DEBUG_KMS("VBT has unknown eDP link rate value %u\n",
> @@ -590,13 +590,13 @@ parse_edp(struct drm_i915_private *dev_priv, const struct bdb_header *bdb)
>  
>  	switch (edp_link_params->lanes) {
>  	case EDP_LANE_1:
> -		dev_priv->vbt.edp_lanes = 1;
> +		dev_priv->vbt.edp.lanes = 1;
>  		break;
>  	case EDP_LANE_2:
> -		dev_priv->vbt.edp_lanes = 2;
> +		dev_priv->vbt.edp.lanes = 2;
>  		break;
>  	case EDP_LANE_4:
> -		dev_priv->vbt.edp_lanes = 4;
> +		dev_priv->vbt.edp.lanes = 4;
>  		break;
>  	default:
>  		DRM_DEBUG_KMS("VBT has unknown eDP lane count value %u\n",
> @@ -606,16 +606,16 @@ parse_edp(struct drm_i915_private *dev_priv, const struct bdb_header *bdb)
>  
>  	switch (edp_link_params->preemphasis) {
>  	case EDP_PREEMPHASIS_NONE:
> -		dev_priv->vbt.edp_preemphasis = DP_TRAIN_PRE_EMPH_LEVEL_0;
> +		dev_priv->vbt.edp.preemphasis = DP_TRAIN_PRE_EMPH_LEVEL_0;
>  		break;
>  	case EDP_PREEMPHASIS_3_5dB:
> -		dev_priv->vbt.edp_preemphasis = DP_TRAIN_PRE_EMPH_LEVEL_1;
> +		dev_priv->vbt.edp.preemphasis = DP_TRAIN_PRE_EMPH_LEVEL_1;
>  		break;
>  	case EDP_PREEMPHASIS_6dB:
> -		dev_priv->vbt.edp_preemphasis = DP_TRAIN_PRE_EMPH_LEVEL_2;
> +		dev_priv->vbt.edp.preemphasis = DP_TRAIN_PRE_EMPH_LEVEL_2;
>  		break;
>  	case EDP_PREEMPHASIS_9_5dB:
> -		dev_priv->vbt.edp_preemphasis = DP_TRAIN_PRE_EMPH_LEVEL_3;
> +		dev_priv->vbt.edp.preemphasis = DP_TRAIN_PRE_EMPH_LEVEL_3;
>  		break;
>  	default:
>  		DRM_DEBUG_KMS("VBT has unknown eDP pre-emphasis value %u\n",
> @@ -625,16 +625,16 @@ parse_edp(struct drm_i915_private *dev_priv, const struct bdb_header *bdb)
>  
>  	switch (edp_link_params->vswing) {
>  	case EDP_VSWING_0_4V:
> -		dev_priv->vbt.edp_vswing = DP_TRAIN_VOLTAGE_SWING_LEVEL_0;
> +		dev_priv->vbt.edp.vswing = DP_TRAIN_VOLTAGE_SWING_LEVEL_0;
>  		break;
>  	case EDP_VSWING_0_6V:
> -		dev_priv->vbt.edp_vswing = DP_TRAIN_VOLTAGE_SWING_LEVEL_1;
> +		dev_priv->vbt.edp.vswing = DP_TRAIN_VOLTAGE_SWING_LEVEL_1;
>  		break;
>  	case EDP_VSWING_0_8V:
> -		dev_priv->vbt.edp_vswing = DP_TRAIN_VOLTAGE_SWING_LEVEL_2;
> +		dev_priv->vbt.edp.vswing = DP_TRAIN_VOLTAGE_SWING_LEVEL_2;
>  		break;
>  	case EDP_VSWING_1_2V:
> -		dev_priv->vbt.edp_vswing = DP_TRAIN_VOLTAGE_SWING_LEVEL_3;
> +		dev_priv->vbt.edp.vswing = DP_TRAIN_VOLTAGE_SWING_LEVEL_3;
>  		break;
>  	default:
>  		DRM_DEBUG_KMS("VBT has unknown eDP voltage swing value %u\n",
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> index e6c3a80e1360..50e4978359a4 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -2002,8 +2002,8 @@ void intel_ddi_get_config(struct intel_encoder *encoder,
>  	pipe_config->has_audio =
>  		intel_ddi_is_audio_enabled(dev_priv, intel_crtc);
>  
> -	if (encoder->type == INTEL_OUTPUT_EDP && dev_priv->vbt.edp_bpp &&
> -	    pipe_config->pipe_bpp > dev_priv->vbt.edp_bpp) {
> +	if (encoder->type == INTEL_OUTPUT_EDP && dev_priv->vbt.edp.bpp &&
> +	    pipe_config->pipe_bpp > dev_priv->vbt.edp.bpp) {
>  		/*
>  		 * This is a big fat ugly hack.
>  		 *
> @@ -2018,8 +2018,8 @@ void intel_ddi_get_config(struct intel_encoder *encoder,
>  		 * load.
>  		 */
>  		DRM_DEBUG_KMS("pipe has %d bpp for eDP panel, overriding BIOS-provided max %d bpp\n",
> -			      pipe_config->pipe_bpp, dev_priv->vbt.edp_bpp);
> -		dev_priv->vbt.edp_bpp = pipe_config->pipe_bpp;
> +			      pipe_config->pipe_bpp, dev_priv->vbt.edp.bpp);
> +		dev_priv->vbt.edp.bpp = pipe_config->pipe_bpp;
>  	}
>  
>  	intel_ddi_clock_get(encoder, pipe_config);
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 3ff8f1d67594..55faad13174d 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -1500,10 +1500,10 @@ intel_dp_compute_config(struct intel_encoder *encoder,
>  
>  		/* Get bpp from vbt only for panels that dont have bpp in edid */
>  		if (intel_connector->base.display_info.bpc == 0 &&
> -			(dev_priv->vbt.edp_bpp && dev_priv->vbt.edp_bpp < bpp)) {
> +			(dev_priv->vbt.edp.bpp && dev_priv->vbt.edp.bpp < bpp)) {
>  			DRM_DEBUG_KMS("clamping bpp for eDP panel to BIOS-provided %i\n",
> -				      dev_priv->vbt.edp_bpp);
> -			bpp = dev_priv->vbt.edp_bpp;
> +				      dev_priv->vbt.edp.bpp);
> +			bpp = dev_priv->vbt.edp.bpp;
>  		}
>  
>  		/*
> @@ -2386,8 +2386,8 @@ static void intel_dp_get_config(struct intel_encoder *encoder,
>  		intel_dotclock_calculate(pipe_config->port_clock,
>  					 &pipe_config->dp_m_n);
>  
> -	if (is_edp(intel_dp) && dev_priv->vbt.edp_bpp &&
> -	    pipe_config->pipe_bpp > dev_priv->vbt.edp_bpp) {
> +	if (is_edp(intel_dp) && dev_priv->vbt.edp.bpp &&
> +	    pipe_config->pipe_bpp > dev_priv->vbt.edp.bpp) {
>  		/*
>  		 * This is a big fat ugly hack.
>  		 *
> @@ -2402,8 +2402,8 @@ static void intel_dp_get_config(struct intel_encoder *encoder,
>  		 * load.
>  		 */
>  		DRM_DEBUG_KMS("pipe has %d bpp for eDP panel, overriding BIOS-provided max %d bpp\n",
> -			      pipe_config->pipe_bpp, dev_priv->vbt.edp_bpp);
> -		dev_priv->vbt.edp_bpp = pipe_config->pipe_bpp;
> +			      pipe_config->pipe_bpp, dev_priv->vbt.edp.bpp);
> +		dev_priv->vbt.edp.bpp = pipe_config->pipe_bpp;
>  	}
>  }
>  
> @@ -5111,7 +5111,7 @@ intel_dp_init_panel_power_sequencer(struct drm_device *dev,
>  	DRM_DEBUG_KMS("cur t1_t3 %d t8 %d t9 %d t10 %d t11_t12 %d\n",
>  		      cur.t1_t3, cur.t8, cur.t9, cur.t10, cur.t11_t12);
>  
> -	vbt = dev_priv->vbt.edp_pps;
> +	vbt = dev_priv->vbt.edp.pps;
>  
>  	/* Upper limits from eDP 1.3 spec. Note that we use the clunky units of
>  	 * our hw here, which are all in 100usec. */
> diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
> index 766ba566fef1..5d2b2575de33 100644
> --- a/drivers/gpu/drm/i915/intel_lvds.c
> +++ b/drivers/gpu/drm/i915/intel_lvds.c
> @@ -924,7 +924,7 @@ void intel_lvds_init(struct drm_device *dev)
>  	if (HAS_PCH_SPLIT(dev)) {
>  		if ((lvds & LVDS_DETECTED) == 0)
>  			return;
> -		if (dev_priv->vbt.edp_support) {
> +		if (dev_priv->vbt.edp.support) {
>  			DRM_DEBUG_KMS("disable LVDS for eDP support\n");
>  			return;
>  		}
> -- 
> 2.1.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the Intel-gfx mailing list