drm/panel-edp: Don't re-read the EDID every time we power off the panel
authorDouglas Anderson <dianders@chromium.org>
Tue, 14 Sep 2021 20:22:01 +0000 (13:22 -0700)
committerDouglas Anderson <dianders@chromium.org>
Mon, 20 Sep 2021 16:24:35 +0000 (09:24 -0700)
The simple-panel driver is for panels that are not hot-pluggable at
runtime. Let's keep our cached EDID around until driver unload.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20210914132020.v5.14.Ib810fb3bebd0bd6763e4609e1a6764d06064081e@changeid
drivers/gpu/drm/panel/panel-edp.c

index 3e53be63cf2a2dee8f97f24cf57993ced4223477..f01497d1a8c7f4740e26caffbc14ec2c2a803cf9 100644 (file)
@@ -362,9 +362,6 @@ static int panel_edp_suspend(struct device *dev)
        regulator_disable(p->supply);
        p->unprepared_time = ktime_get();
 
-       kfree(p->edid);
-       p->edid = NULL;
-
        return 0;
 }
 
@@ -758,6 +755,9 @@ static int panel_edp_remove(struct device *dev)
        if (panel->ddc && (!panel->aux || panel->ddc != &panel->aux->ddc))
                put_device(&panel->ddc->dev);
 
+       kfree(panel->edid);
+       panel->edid = NULL;
+
        return 0;
 }