Skip to content

Commit 2cbee8a

Browse files
committed
drm/panel-edp: Abstract out function to set conservative timings
If we're using the generic "edp-panel" compatible string and we fail to detect an eDP panel then we fall back to conservative timings for powering up and powering down the panel. Abstract out the function for setting these timings so it can be used in future patches. No functional change expected--just code movement. Reviewed-by: Hsin-Yi Wang <[email protected]> Signed-off-by: Douglas Anderson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/20240325145626.1.I659b2517d9f619d09e804e071591ecab76335dfb@changeid
1 parent e495e52 commit 2cbee8a

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

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

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,25 @@ static void panel_edp_parse_panel_timing_node(struct device *dev,
760760

761761
static const struct edp_panel_entry *find_edp_panel(u32 panel_id, const struct drm_edid *edid);
762762

763+
static void panel_edp_set_conservative_timings(struct panel_edp *panel, struct panel_desc *desc)
764+
{
765+
/*
766+
* It's highly likely that the panel will work if we use very
767+
* conservative timings, so let's do that.
768+
*
769+
* Nearly all panels have a "unprepare" delay of 500 ms though
770+
* there are a few with 1000. Let's stick 2000 in just to be
771+
* super conservative.
772+
*
773+
* An "enable" delay of 80 ms seems the most common, but we'll
774+
* throw in 200 ms to be safe.
775+
*/
776+
desc->delay.unprepare = 2000;
777+
desc->delay.enable = 200;
778+
779+
panel->detected_panel = ERR_PTR(-EINVAL);
780+
}
781+
763782
static int generic_edp_panel_probe(struct device *dev, struct panel_edp *panel)
764783
{
765784
struct panel_desc *desc;
@@ -816,26 +835,7 @@ static int generic_edp_panel_probe(struct device *dev, struct panel_edp *panel)
816835
dev_warn(dev,
817836
"Unknown panel %s %#06x, using conservative timings\n",
818837
vend, product_id);
819-
820-
/*
821-
* It's highly likely that the panel will work if we use very
822-
* conservative timings, so let's do that. We already know that
823-
* the HPD-related delays must have worked since we got this
824-
* far, so we really just need the "unprepare" / "enable"
825-
* delays. We don't need "prepare_to_enable" since that
826-
* overlaps the "enable" delay anyway.
827-
*
828-
* Nearly all panels have a "unprepare" delay of 500 ms though
829-
* there are a few with 1000. Let's stick 2000 in just to be
830-
* super conservative.
831-
*
832-
* An "enable" delay of 80 ms seems the most common, but we'll
833-
* throw in 200 ms to be safe.
834-
*/
835-
desc->delay.unprepare = 2000;
836-
desc->delay.enable = 200;
837-
838-
panel->detected_panel = ERR_PTR(-EINVAL);
838+
panel_edp_set_conservative_timings(panel, desc);
839839
} else {
840840
dev_info(dev, "Detected %s %s (%#06x)\n",
841841
vend, panel->detected_panel->ident.name, product_id);

0 commit comments

Comments
 (0)