Commit 6aa23e65 authored by Jani Nikula's avatar Jani Nikula

drm/i915: use a substruct in vbt data for edp

Housekeeping, similar to psr, backlight, and dsi. No functional changes.
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1458834623-8734-2-git-send-email-jani.nikula@intel.com
parent b4ac5afc
...@@ -1446,15 +1446,16 @@ struct intel_vbt_data { ...@@ -1446,15 +1446,16 @@ struct intel_vbt_data {
enum drrs_support_type drrs_type; enum drrs_support_type drrs_type;
/* eDP */ struct {
int edp_rate; int rate;
int edp_lanes; int lanes;
int edp_preemphasis; int preemphasis;
int edp_vswing; int vswing;
bool edp_initialized; bool initialized;
bool edp_support; bool support;
int edp_bpp; int bpp;
struct edp_power_seq edp_pps; struct edp_power_seq pps;
} edp;
struct { struct {
bool full_link; bool full_link;
......
...@@ -527,7 +527,7 @@ parse_driver_features(struct drm_i915_private *dev_priv, ...@@ -527,7 +527,7 @@ parse_driver_features(struct drm_i915_private *dev_priv,
return; return;
if (driver->lvds_config == BDB_DRIVER_FEATURE_EDP) if (driver->lvds_config == BDB_DRIVER_FEATURE_EDP)
dev_priv->vbt.edp_support = 1; dev_priv->vbt.edp.support = 1;
if (driver->dual_frequency) if (driver->dual_frequency)
dev_priv->render_reclock_avail = true; dev_priv->render_reclock_avail = true;
...@@ -552,20 +552,20 @@ parse_edp(struct drm_i915_private *dev_priv, const struct bdb_header *bdb) ...@@ -552,20 +552,20 @@ parse_edp(struct drm_i915_private *dev_priv, const struct bdb_header *bdb)
edp = find_section(bdb, BDB_EDP); edp = find_section(bdb, BDB_EDP);
if (!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"); DRM_DEBUG_KMS("No eDP BDB found but eDP panel supported.\n");
return; return;
} }
switch ((edp->color_depth >> (panel_type * 2)) & 3) { switch ((edp->color_depth >> (panel_type * 2)) & 3) {
case EDP_18BPP: case EDP_18BPP:
dev_priv->vbt.edp_bpp = 18; dev_priv->vbt.edp.bpp = 18;
break; break;
case EDP_24BPP: case EDP_24BPP:
dev_priv->vbt.edp_bpp = 24; dev_priv->vbt.edp.bpp = 24;
break; break;
case EDP_30BPP: case EDP_30BPP:
dev_priv->vbt.edp_bpp = 30; dev_priv->vbt.edp.bpp = 30;
break; break;
} }
...@@ -573,14 +573,14 @@ parse_edp(struct drm_i915_private *dev_priv, const struct bdb_header *bdb) ...@@ -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_pps = &edp->power_seqs[panel_type];
edp_link_params = &edp->link_params[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) { switch (edp_link_params->rate) {
case EDP_RATE_1_62: 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; break;
case EDP_RATE_2_7: 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; break;
default: default:
DRM_DEBUG_KMS("VBT has unknown eDP link rate value %u\n", 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) ...@@ -590,13 +590,13 @@ parse_edp(struct drm_i915_private *dev_priv, const struct bdb_header *bdb)
switch (edp_link_params->lanes) { switch (edp_link_params->lanes) {
case EDP_LANE_1: case EDP_LANE_1:
dev_priv->vbt.edp_lanes = 1; dev_priv->vbt.edp.lanes = 1;
break; break;
case EDP_LANE_2: case EDP_LANE_2:
dev_priv->vbt.edp_lanes = 2; dev_priv->vbt.edp.lanes = 2;
break; break;
case EDP_LANE_4: case EDP_LANE_4:
dev_priv->vbt.edp_lanes = 4; dev_priv->vbt.edp.lanes = 4;
break; break;
default: default:
DRM_DEBUG_KMS("VBT has unknown eDP lane count value %u\n", 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) ...@@ -606,16 +606,16 @@ parse_edp(struct drm_i915_private *dev_priv, const struct bdb_header *bdb)
switch (edp_link_params->preemphasis) { switch (edp_link_params->preemphasis) {
case EDP_PREEMPHASIS_NONE: 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; break;
case EDP_PREEMPHASIS_3_5dB: 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; break;
case EDP_PREEMPHASIS_6dB: 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; break;
case EDP_PREEMPHASIS_9_5dB: 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; break;
default: default:
DRM_DEBUG_KMS("VBT has unknown eDP pre-emphasis value %u\n", 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) ...@@ -625,16 +625,16 @@ parse_edp(struct drm_i915_private *dev_priv, const struct bdb_header *bdb)
switch (edp_link_params->vswing) { switch (edp_link_params->vswing) {
case EDP_VSWING_0_4V: 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; break;
case EDP_VSWING_0_6V: 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; break;
case EDP_VSWING_0_8V: 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; break;
case EDP_VSWING_1_2V: 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; break;
default: default:
DRM_DEBUG_KMS("VBT has unknown eDP voltage swing value %u\n", DRM_DEBUG_KMS("VBT has unknown eDP voltage swing value %u\n",
......
...@@ -2002,8 +2002,8 @@ void intel_ddi_get_config(struct intel_encoder *encoder, ...@@ -2002,8 +2002,8 @@ void intel_ddi_get_config(struct intel_encoder *encoder,
pipe_config->has_audio = pipe_config->has_audio =
intel_ddi_is_audio_enabled(dev_priv, intel_crtc); intel_ddi_is_audio_enabled(dev_priv, intel_crtc);
if (encoder->type == INTEL_OUTPUT_EDP && 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) { pipe_config->pipe_bpp > dev_priv->vbt.edp.bpp) {
/* /*
* This is a big fat ugly hack. * This is a big fat ugly hack.
* *
...@@ -2018,8 +2018,8 @@ void intel_ddi_get_config(struct intel_encoder *encoder, ...@@ -2018,8 +2018,8 @@ void intel_ddi_get_config(struct intel_encoder *encoder,
* load. * load.
*/ */
DRM_DEBUG_KMS("pipe has %d bpp for eDP panel, overriding BIOS-provided max %d bpp\n", 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); pipe_config->pipe_bpp, dev_priv->vbt.edp.bpp);
dev_priv->vbt.edp_bpp = pipe_config->pipe_bpp; dev_priv->vbt.edp.bpp = pipe_config->pipe_bpp;
} }
intel_ddi_clock_get(encoder, pipe_config); intel_ddi_clock_get(encoder, pipe_config);
......
...@@ -1500,10 +1500,10 @@ intel_dp_compute_config(struct intel_encoder *encoder, ...@@ -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 */ /* Get bpp from vbt only for panels that dont have bpp in edid */
if (intel_connector->base.display_info.bpc == 0 && 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", DRM_DEBUG_KMS("clamping bpp for eDP panel to BIOS-provided %i\n",
dev_priv->vbt.edp_bpp); dev_priv->vbt.edp.bpp);
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, ...@@ -2386,8 +2386,8 @@ static void intel_dp_get_config(struct intel_encoder *encoder,
intel_dotclock_calculate(pipe_config->port_clock, intel_dotclock_calculate(pipe_config->port_clock,
&pipe_config->dp_m_n); &pipe_config->dp_m_n);
if (is_edp(intel_dp) && dev_priv->vbt.edp_bpp && if (is_edp(intel_dp) && dev_priv->vbt.edp.bpp &&
pipe_config->pipe_bpp > dev_priv->vbt.edp_bpp) { pipe_config->pipe_bpp > dev_priv->vbt.edp.bpp) {
/* /*
* This is a big fat ugly hack. * This is a big fat ugly hack.
* *
...@@ -2402,8 +2402,8 @@ static void intel_dp_get_config(struct intel_encoder *encoder, ...@@ -2402,8 +2402,8 @@ static void intel_dp_get_config(struct intel_encoder *encoder,
* load. * load.
*/ */
DRM_DEBUG_KMS("pipe has %d bpp for eDP panel, overriding BIOS-provided max %d bpp\n", 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); pipe_config->pipe_bpp, dev_priv->vbt.edp.bpp);
dev_priv->vbt.edp_bpp = pipe_config->pipe_bpp; dev_priv->vbt.edp.bpp = pipe_config->pipe_bpp;
} }
} }
...@@ -5111,7 +5111,7 @@ intel_dp_init_panel_power_sequencer(struct drm_device *dev, ...@@ -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", 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); 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 /* Upper limits from eDP 1.3 spec. Note that we use the clunky units of
* our hw here, which are all in 100usec. */ * our hw here, which are all in 100usec. */
......
...@@ -924,7 +924,7 @@ void intel_lvds_init(struct drm_device *dev) ...@@ -924,7 +924,7 @@ void intel_lvds_init(struct drm_device *dev)
if (HAS_PCH_SPLIT(dev)) { if (HAS_PCH_SPLIT(dev)) {
if ((lvds & LVDS_DETECTED) == 0) if ((lvds & LVDS_DETECTED) == 0)
return; return;
if (dev_priv->vbt.edp_support) { if (dev_priv->vbt.edp.support) {
DRM_DEBUG_KMS("disable LVDS for eDP support\n"); DRM_DEBUG_KMS("disable LVDS for eDP support\n");
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment