aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_bios.c
diff options
context:
space:
mode:
authorShobhit Kumar <shobhit.kumar@intel.com>2014-05-27 10:03:59 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-06-05 02:52:33 -0400
commit3e6bd01178928cae58354ce7a6d18ade8b7b4be7 (patch)
treef6543a5d2808b586dcb99a2fdb988ff6cb2e91d8 /drivers/gpu/drm/i915/intel_bios.c
parentc98f50628722e2e287656bc7e7492e3d3a0726b8 (diff)
drm/i915: Detect if MIPI panel based on VBT and initialize only if present
It seems by default the VBT has MIPI configuration block as well. The Generic driver will assume always MIPI if MIPI configuration block is found. This is causing probelm when actually there is eDP. Fix this by looking into general definition block which will have device configurations. From here we can figure out what is the LFP type and initialize MIPI only if MIPI is found. v2: Addressed review comments by Damien - Moved PORT definitions to intel_bios.h and renamed as DVO_PORT_MIPIA - renamed is_mipi to has_mipi and moved definition as suggested - Check has_mipi inside parse_mipi and intel_dsi_init insted of outside v3: Make has_mipi as a bitfield as suggested Signed-off-by: Shobhit Kumar <shobhit.kumar@intel.com> Reviewed-by: Damien Lespiau <damien.lespiau@intel.com> [danvet: fold in conditions to pack everything neatly below 80 chars.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_bios.c')
-rw-r--r--drivers/gpu/drm/i915/intel_bios.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index 2945f57c53ee..3d43da6d3482 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -720,6 +720,10 @@ parse_mipi(struct drm_i915_private *dev_priv, struct bdb_header *bdb)
720 int i, panel_id, seq_size; 720 int i, panel_id, seq_size;
721 u16 block_size; 721 u16 block_size;
722 722
723 /* parse MIPI blocks only if LFP type is MIPI */
724 if (!dev_priv->vbt.has_mipi)
725 return;
726
723 /* Initialize this to undefined indicating no generic MIPI support */ 727 /* Initialize this to undefined indicating no generic MIPI support */
724 dev_priv->vbt.dsi.panel_id = MIPI_DSI_UNDEFINED_PANEL_ID; 728 dev_priv->vbt.dsi.panel_id = MIPI_DSI_UNDEFINED_PANEL_ID;
725 729
@@ -1035,6 +1039,15 @@ parse_device_mapping(struct drm_i915_private *dev_priv,
1035 /* skip the device block if device type is invalid */ 1039 /* skip the device block if device type is invalid */
1036 continue; 1040 continue;
1037 } 1041 }
1042
1043 if (p_child->common.dvo_port >= DVO_PORT_MIPIA
1044 && p_child->common.dvo_port <= DVO_PORT_MIPID
1045 &&p_child->common.device_type & DEVICE_TYPE_MIPI_OUTPUT) {
1046 DRM_DEBUG_KMS("Found MIPI as LFP\n");
1047 dev_priv->vbt.has_mipi = 1;
1048 dev_priv->vbt.dsi.port = p_child->common.dvo_port;
1049 }
1050
1038 child_dev_ptr = dev_priv->vbt.child_dev + count; 1051 child_dev_ptr = dev_priv->vbt.child_dev + count;
1039 count++; 1052 count++;
1040 memcpy((void *)child_dev_ptr, (void *)p_child, 1053 memcpy((void *)child_dev_ptr, (void *)p_child,