]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915: Handle downstream facing ports w/o EDID
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 4 Sep 2020 11:53:50 +0000 (14:53 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 17 Sep 2020 15:38:14 +0000 (18:38 +0300)
Use drm_dp_downstream_mode() to get a suitable mode for downstream
facing ports which don't have an EDID.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200904115354.25336-15-ville.syrjala@linux.intel.com
Reviewed-by: Lyude Paul <lyude@redhat.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/display/intel_dp.c

index 2538ffaa7463cccd6dcb0c102a0f71ce33efe4fa..124b23e419a0f36752a1c5b2b7854376364b617e 100644 (file)
@@ -6313,7 +6313,7 @@ static int intel_dp_get_modes(struct drm_connector *connector)
        }
 
        /* if eDP has no EDID, fall back to fixed mode */
-       if (intel_dp_is_edp(intel_attached_dp(to_intel_connector(connector))) &&
+       if (intel_dp_is_edp(intel_attached_dp(intel_connector)) &&
            intel_connector->panel.fixed_mode) {
                struct drm_display_mode *mode;
 
@@ -6325,6 +6325,19 @@ static int intel_dp_get_modes(struct drm_connector *connector)
                }
        }
 
+       if (!edid) {
+               struct intel_dp *intel_dp = intel_attached_dp(intel_connector);
+               struct drm_display_mode *mode;
+
+               mode = drm_dp_downstream_mode(connector->dev,
+                                             intel_dp->dpcd,
+                                             intel_dp->downstream_ports);
+               if (mode) {
+                       drm_mode_probed_add(connector, mode);
+                       return 1;
+               }
+       }
+
        return 0;
 }