drm/i915/icl: Find DSI presence for ICL
authorMadhav Chauhan <madhav.chauhan@intel.com>
Tue, 30 Oct 2018 11:56:23 +0000 (13:56 +0200)
committerJani Nikula <jani.nikula@intel.com>
Thu, 1 Nov 2018 10:23:40 +0000 (12:23 +0200)
This patch detects DSI presence for ICL platform
by reading VBT. DSI detection is done while initializing
DSI using newly added function intel_gen11_dsi_init.

v2 by Jani:
 - Preserve old behavour of intel_bios_is_dsi_present()
 - s/intel_gen11_dsi_init/icl_dsi_init/g

Signed-off-by: Madhav Chauhan <madhav.chauhan@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/2324cdfc8918bda3165354e5e0d15053b1074f14.1540900289.git.jani.nikula@intel.com
drivers/gpu/drm/i915/icl_dsi.c
drivers/gpu/drm/i915/intel_bios.c
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_drv.h

index fd82f349ced9265f8460ed5178d1355804b5c4a1..01f422df8c230804ad0780e7a638c01b52262bcc 100644 (file)
@@ -971,3 +971,11 @@ static void __attribute__((unused)) gen11_dsi_disable(
        /* step4: disable IO power */
        gen11_dsi_disable_io_power(encoder);
 }
+
+void icl_dsi_init(struct drm_i915_private *dev_priv)
+{
+       enum port port;
+
+       if (!intel_bios_is_dsi_present(dev_priv, &port))
+               return;
+}
index 1faa494e2bc91a245861135ab5de015a7a6810ff..5fa2133f801d9d13afdd8ca44baf454cfb15de55 100644 (file)
@@ -2039,17 +2039,17 @@ bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv,
 
                dvo_port = child->dvo_port;
 
-               switch (dvo_port) {
-               case DVO_PORT_MIPIA:
-               case DVO_PORT_MIPIC:
+               if (dvo_port == DVO_PORT_MIPIA ||
+                   (dvo_port == DVO_PORT_MIPIB && IS_ICELAKE(dev_priv)) ||
+                   (dvo_port == DVO_PORT_MIPIC && !IS_ICELAKE(dev_priv))) {
                        if (port)
                                *port = dvo_port - DVO_PORT_MIPIA;
                        return true;
-               case DVO_PORT_MIPIB:
-               case DVO_PORT_MIPID:
+               } else if (dvo_port == DVO_PORT_MIPIB ||
+                          dvo_port == DVO_PORT_MIPIC ||
+                          dvo_port == DVO_PORT_MIPID) {
                        DRM_DEBUG_KMS("VBT has unsupported DSI port %c\n",
                                      port_name(dvo_port - DVO_PORT_MIPIA));
-                       break;
                }
        }
 
index 3ea715f1c711f0b12df1859c51242a6de32b75d1..af042b307c8c305c5a7cead75b61202d0832eebe 100644 (file)
@@ -14128,6 +14128,7 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv)
                intel_ddi_init(dev_priv, PORT_D);
                intel_ddi_init(dev_priv, PORT_E);
                intel_ddi_init(dev_priv, PORT_F);
+               icl_dsi_init(dev_priv);
        } else if (IS_GEN9_LP(dev_priv)) {
                /*
                 * FIXME: Broxton doesn't support port detection via the
index 7cce7dc49bbcaef3c20e09b2411d12c15877dcb5..2d9882138b0b6ca3575d666fe84b06dc07da445a 100644 (file)
@@ -1860,6 +1860,9 @@ void intel_dp_mst_encoder_cleanup(struct intel_digital_port *intel_dig_port);
 /* vlv_dsi.c */
 void vlv_dsi_init(struct drm_i915_private *dev_priv);
 
+/* icl_dsi.c */
+void icl_dsi_init(struct drm_i915_private *dev_priv);
+
 /* intel_dsi_dcs_backlight.c */
 int intel_dsi_dcs_init_backlight_funcs(struct intel_connector *intel_connector);