drm-panel: If drm_panel_dp_aux_backlight() fails, don't fail panel probe
authorDouglas Anderson <dianders@chromium.org>
Mon, 25 Mar 2024 21:56:27 +0000 (14:56 -0700)
committerDouglas Anderson <dianders@chromium.org>
Mon, 8 Apr 2024 04:47:16 +0000 (21:47 -0700)
If we're using the AUX channel for eDP backlight and it fails to probe
for some reason, let's _not_ fail the panel probe.

At least one case where we could fail to init the backlight is because
of a dead or physically missing panel. As talked about in detail in
the earlier patch in this series, ("drm/panel-edp: If we fail to
powerup/get EDID, use conservative timings"), this can cause the
entire system's display pipeline to fail to come up and that's
non-ideal.

If we fail to init the backlight for some transitory reason, we should
dig in and see if there's a way to fix this (perhaps retries?). Even
in that case, though, having a panel whose backlight is stuck at 100%
(the default, at least in the panel Samsung ATNA33XC20 I tested) is
better than having no panel at all.

Reviewed-by: Hsin-Yi Wang <hsinyi@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240325145626.3.I552e8af0ddb1691cc0fe5d27ea3d8020e36f7006@changeid
drivers/gpu/drm/panel/panel-edp.c
drivers/gpu/drm/panel/panel-samsung-atna33xc20.c

index 62bc6e1a6cfce9513766248b74d0469a61d8e4c8..d29bacf25c128c4413ded71e2d16482a25aa9274 100644 (file)
@@ -944,8 +944,14 @@ static int panel_edp_probe(struct device *dev, const struct panel_desc *desc,
                err = drm_panel_dp_aux_backlight(&panel->base, panel->aux);
                pm_runtime_mark_last_busy(dev);
                pm_runtime_put_autosuspend(dev);
+
+               /*
+                * Warn if we get an error, but don't consider it fatal. Having
+                * a panel where we can't control the backlight is better than
+                * no panel.
+                */
                if (err)
-                       goto err_finished_pm_runtime;
+                       dev_warn(dev, "failed to register dp aux backlight: %d\n", err);
        }
 
        drm_panel_add(&panel->base);
index 9c336c71562b93edede3e6f8d193d1c5ab36ede2..6828a4f24d1464b8462d4804eb5a88524399e41f 100644 (file)
@@ -328,9 +328,14 @@ static int atana33xc20_probe(struct dp_aux_ep_device *aux_ep)
        ret = drm_panel_dp_aux_backlight(&panel->base, aux_ep->aux);
        pm_runtime_mark_last_busy(dev);
        pm_runtime_put_autosuspend(dev);
+
+       /*
+        * Warn if we get an error, but don't consider it fatal. Having
+        * a panel where we can't control the backlight is better than
+        * no panel.
+        */
        if (ret)
-               return dev_err_probe(dev, ret,
-                                    "failed to register dp aux backlight\n");
+               dev_warn(dev, "failed to register dp aux backlight: %d\n", ret);
 
        drm_panel_add(&panel->base);