@@ -118,6 +118,7 @@ struct mtk_dp {
const struct mtk_dp_data *data;
struct mtk_dp_info info;
struct mtk_dp_train_info train_info;
+ struct edid *edid;
struct platform_device *phy_dev;
struct phy *phy;
@@ -1993,7 +1994,11 @@ static struct edid *mtk_dp_get_edid(struct drm_bridge *bridge,
usleep_range(2000, 5000);
}
- new_edid = drm_get_edid(connector, &mtk_dp->aux.ddc);
+ /* eDP panels aren't removable, so we can return a cached EDID. */
+ if (mtk_dp->bridge.type == DRM_MODE_CONNECTOR_eDP && mtk_dp->edid)
+ new_edid = drm_edid_duplicate(mtk_dp->edid);
+ else
+ new_edid = drm_get_edid(connector, &mtk_dp->aux.ddc);
/*
* Parse capability here to let atomic_get_input_bus_fmts and
@@ -2022,6 +2027,10 @@ static struct edid *mtk_dp_get_edid(struct drm_bridge *bridge,
drm_atomic_bridge_chain_post_disable(bridge, connector->state->state);
}
+ /* If this is an eDP panel and the read EDID is good, cache it for later */
+ if (mtk_dp->bridge.type == DRM_MODE_CONNECTOR_eDP && !mtk_dp->edid && new_edid)
+ mtk_dp->edid = drm_edid_duplicate(new_edid);
+
return new_edid;
}