Skip to content

Commit ce0ff22

Browse files
committed
drm/panel-edp: If we fail to powerup/get EDID, use conservative timings
If at boot we fail to power up the eDP panel (most often happens if the eDP panel never asserts HPD to us) or if we are unable to read the EDID at bootup to figure out the panel's ID then let's use the conservative eDP panel powerup/powerdown timings but _not_ fail the probe. It might seem strange to _not_ fail the probe in this case since we were unable to powerup the panel and confirm it's there. However, there is a reason to do this. Specifically, if we fail to probe the panel then it really throws the whole display pipeline for loop. Most DRM subsystems are written so that they wait until all components (including the panel) have probed before they set everything up. When the panel doesn't come up then this never happens. As a side effect of not setting everything up then other display adapters don't get initialized. As a practical example, I can see that if I open up a sc7180-trogdor based Chromebook that's using the generic "edp-panel" and unplug the eDP panel that it causes the _external_ DP monitor not to function. This is obviously bad because it means that a device with a dead eDP panel becomes e-waste when it could instead still be given useful life with an external display. NOTES: - When we fail to probe like this, boot is a bit slow because we try several times to power the panel up. This doesn't feel horrible because it'll eventually work and the retries are known to help bring some panels up. - In the case where we hit the condition of failing to power up, the display will likely _never_ have a chance to work again until reboot. Once the panel-edp pm_runtime resume function fails it doesn't ever seem to retry. This is probably for the best given that we don't have any real timing/modes. eDP isn't expected to be "hotplugged" so this makes some sense. - It turns out that this makes panel-edp behave more similarly for users of the generic "edp-panel" compatible string and the old fixed panel compatible string. With the old fixed panel compatible string we don't talk to the panel during probe so we'd actually behave much the same way that we'll now behave for the generic "edp-panel". Reviewed-by: Hsin-Yi Wang <[email protected]> Signed-off-by: Douglas Anderson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/20240325145626.2.Ia7a55a9657b0b6aa4644fd497a0bc595a771258c@changeid
1 parent 2cbee8a commit ce0ff22

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

drivers/gpu/drm/panel/panel-edp.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -808,16 +808,19 @@ static int generic_edp_panel_probe(struct device *dev, struct panel_edp *panel)
808808
/* Power the panel on so we can read the EDID */
809809
ret = pm_runtime_get_sync(dev);
810810
if (ret < 0) {
811-
dev_err(dev, "Couldn't power on panel to read EDID: %d\n", ret);
811+
dev_err(dev,
812+
"Couldn't power on panel to ID it; using conservative timings: %d\n",
813+
ret);
814+
panel_edp_set_conservative_timings(panel, desc);
812815
goto exit;
813816
}
814817

815818
base_block = drm_edid_read_base_block(panel->ddc);
816819
if (base_block) {
817820
panel_id = drm_edid_get_panel_id(base_block);
818821
} else {
819-
dev_err(dev, "Couldn't identify panel via EDID\n");
820-
ret = -EIO;
822+
dev_err(dev, "Couldn't read EDID for ID; using conservative timings\n");
823+
panel_edp_set_conservative_timings(panel, desc);
821824
goto exit;
822825
}
823826
drm_edid_decode_panel_id(panel_id, vend, &product_id);
@@ -844,12 +847,11 @@ static int generic_edp_panel_probe(struct device *dev, struct panel_edp *panel)
844847
desc->delay = *panel->detected_panel->delay;
845848
}
846849

847-
ret = 0;
848850
exit:
849851
pm_runtime_mark_last_busy(dev);
850852
pm_runtime_put_autosuspend(dev);
851853

852-
return ret;
854+
return 0;
853855
}
854856

855857
static int panel_edp_probe(struct device *dev, const struct panel_desc *desc,

0 commit comments

Comments
 (0)