mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
drm/bridge: dw-hdmi-qp: Don't read edid again if edid is exist
Reading edid only after plug in or resume. Signed-off-by: Algea Cao <algea.cao@rock-chips.com> Change-Id: I0b69a26d9caeebf81f360bc8674aeacf964fd807
This commit is contained in:
@@ -2261,6 +2261,7 @@ static int dw_hdmi_connector_get_modes(struct drm_connector *connector)
|
||||
struct drm_display_mode *mode;
|
||||
struct drm_display_info *info = &connector->display_info;
|
||||
void *data = hdmi->plat_data->phy_data;
|
||||
struct drm_property_blob *edid_blob_ptr = connector->edid_blob_ptr;
|
||||
int i, ret = 0;
|
||||
|
||||
if (hdmi->plat_data->right && hdmi->plat_data->right->next_bridge) {
|
||||
@@ -2282,7 +2283,17 @@ static int dw_hdmi_connector_get_modes(struct drm_connector *connector)
|
||||
return 0;
|
||||
|
||||
memset(metedata, 0, sizeof(*metedata));
|
||||
edid = drm_get_edid(connector, hdmi->ddc);
|
||||
|
||||
if (edid_blob_ptr && edid_blob_ptr->length) {
|
||||
edid = kmalloc(edid_blob_ptr->length, GFP_KERNEL);
|
||||
if (!edid)
|
||||
return -ENOMEM;
|
||||
memcpy(edid, edid_blob_ptr->data, edid_blob_ptr->length);
|
||||
} else {
|
||||
edid = drm_get_edid(connector, hdmi->ddc);
|
||||
hdmi->hdcp_caps = dw_hdmi_qp_hdcp_capable(hdmi);
|
||||
}
|
||||
|
||||
if (edid) {
|
||||
dev_dbg(hdmi->dev, "got edid: width[%d] x height[%d]\n",
|
||||
edid->width_cm, edid->height_cm);
|
||||
@@ -2310,8 +2321,10 @@ static int dw_hdmi_connector_get_modes(struct drm_connector *connector)
|
||||
else if (hdmi->plat_data->right)
|
||||
secondary = hdmi->plat_data->right;
|
||||
|
||||
if (!secondary)
|
||||
if (!secondary) {
|
||||
kfree(edid);
|
||||
return -ENOMEM;
|
||||
}
|
||||
secondary_data = secondary->plat_data->phy_data;
|
||||
|
||||
list_for_each_entry(mode, &connector->probed_modes, head)
|
||||
@@ -4049,6 +4062,7 @@ void dw_hdmi_qp_suspend(struct device *dev, struct dw_hdmi_qp *hdmi)
|
||||
disable_irq(hdmi->earc_irq);
|
||||
|
||||
pinctrl_pm_select_sleep_state(dev);
|
||||
drm_connector_update_edid_property(&hdmi->connector, NULL);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(dw_hdmi_qp_suspend);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user