|
@@ -924,15 +924,15 @@ int analogix_dp_get_modes(struct drm_connector *connector)
|
|
|
struct edid *edid;
|
|
|
int ret, num_modes = 0;
|
|
|
|
|
|
- ret = analogix_dp_prepare_panel(dp, true, false);
|
|
|
- if (ret) {
|
|
|
- DRM_ERROR("Failed to prepare panel (%d)\n", ret);
|
|
|
- return 0;
|
|
|
- }
|
|
|
-
|
|
|
if (dp->plat_data->panel) {
|
|
|
num_modes += drm_panel_get_modes(dp->plat_data->panel);
|
|
|
} else {
|
|
|
+ ret = analogix_dp_prepare_panel(dp, true, false);
|
|
|
+ if (ret) {
|
|
|
+ DRM_ERROR("Failed to prepare panel (%d)\n", ret);
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
edid = drm_get_edid(connector, &dp->aux.ddc);
|
|
|
if (edid) {
|
|
|
drm_mode_connector_update_edid_property(&dp->connector,
|
|
@@ -940,15 +940,15 @@ int analogix_dp_get_modes(struct drm_connector *connector)
|
|
|
num_modes += drm_add_edid_modes(&dp->connector, edid);
|
|
|
kfree(edid);
|
|
|
}
|
|
|
+
|
|
|
+ ret = analogix_dp_prepare_panel(dp, false, false);
|
|
|
+ if (ret)
|
|
|
+ DRM_ERROR("Failed to unprepare panel (%d)\n", ret);
|
|
|
}
|
|
|
|
|
|
if (dp->plat_data->get_modes)
|
|
|
num_modes += dp->plat_data->get_modes(dp->plat_data, connector);
|
|
|
|
|
|
- ret = analogix_dp_prepare_panel(dp, false, false);
|
|
|
- if (ret)
|
|
|
- DRM_ERROR("Failed to unprepare panel (%d)\n", ret);
|
|
|
-
|
|
|
return num_modes;
|
|
|
}
|
|
|
|
|
@@ -972,6 +972,9 @@ analogix_dp_detect(struct drm_connector *connector, bool force)
|
|
|
enum drm_connector_status status = connector_status_disconnected;
|
|
|
int ret;
|
|
|
|
|
|
+ if (dp->plat_data->panel)
|
|
|
+ return connector_status_connected;
|
|
|
+
|
|
|
ret = analogix_dp_prepare_panel(dp, true, false);
|
|
|
if (ret) {
|
|
|
DRM_ERROR("Failed to prepare panel (%d)\n", ret);
|