Skip to content

Commit

Permalink
hack! drm/panel-edp: Re-try if we fail to read panel EDID the first time
Browse files Browse the repository at this point in the history
  • Loading branch information
qzed committed Aug 4, 2022
1 parent 99ae7a6 commit b1b3fd4
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion drivers/gpu/drm/panel/panel-edp.c
Expand Up @@ -699,6 +699,7 @@ static int generic_edp_panel_probe(struct device *dev, struct panel_edp *panel)
u32 reliable_ms = 0;
u32 absent_ms = 0;
int ret;
int i;

desc = devm_kzalloc(dev, sizeof(*desc), GFP_KERNEL);
if (!desc)
Expand All @@ -722,7 +723,17 @@ static int generic_edp_panel_probe(struct device *dev, struct panel_edp *panel)
goto exit;
}

panel_id = drm_edid_get_panel_id(panel->ddc);
for (i = 0; i < 10; i++) {
if (i > 0) {
dev_warn(dev, "Failed to identify panel via EDID, trying again\n");
msleep(100);
}

panel_id = drm_edid_get_panel_id(panel->ddc);
if (panel_id)
break;
}

if (!panel_id) {
dev_err(dev, "Couldn't identify panel via EDID\n");
ret = -EIO;
Expand Down

0 comments on commit b1b3fd4

Please sign in to comment.