drm/i915: use a substruct in vbt data for edp
authorJani Nikula <jani.nikula@intel.com>
Thu, 24 Mar 2016 15:50:20 +0000 (17:50 +0200)
committerJani Nikula <jani.nikula@intel.com>
Tue, 29 Mar 2016 12:12:04 +0000 (15:12 +0300)
Housekeeping, similar to psr, backlight, and dsi. No functional changes.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1458834623-8734-2-git-send-email-jani.nikula@intel.com
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/intel_bios.c
drivers/gpu/drm/i915/intel_ddi.c
drivers/gpu/drm/i915/intel_dp.c
drivers/gpu/drm/i915/intel_lvds.c

index b93ef7017c93eed2c3feb3296b75d87620f12949..fe8021ecb2541f1648582d3b437765f279942f63 100644 (file)
@@ -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;
index 083003b015f5d1dd2e255237f2dd96640b3a0cb6..61eb7a6bb8f06f8a941408e74dcd5e327488fd0e 100644 (file)
@@ -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",
index e6c3a80e136091d4937028762103cfb358decf53..50e4978359a41c0e59ed68d5d8817b5d74b7f8d9 100644 (file)
@@ -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);
index 3ff8f1d6759435fefc9551f0ad58acfd97bfd808..55faad13174d22bf4dd53334abe55033a3d1138e 100644 (file)
@@ -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. */
index 766ba566fef10c5d2d2d22d653a0ade1a21694b5..5d2b2575de335eeee64560e64da48c869481aaaf 100644 (file)
@@ -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;
                }