-
- Downloads
drm/panel: Check for already prepared/enabled in drm_panel
In a whole pile of panel drivers, we have code to make the prepare/unprepare/enable/disable callbacks behave as no-ops if they've already been called. It's silly to have this code duplicated everywhere. Add it to the core instead so that we can eventually delete it from all the drivers. Note: to get some idea of the duplicated code, try: git grep 'if.*>prepared' -- drivers/gpu/drm/panel git grep 'if.*>enabled' -- drivers/gpu/drm/panel NOTE: arguably, the right thing to do here is actually to skip this patch and simply remove all the extra checks from the individual drivers. Perhaps the checks were needed at some point in time in the past but maybe they no longer are? Certainly as we continue transitioning over to "panel_bridge" then we expect there to be much less variety in how these calls are made. When we're called as part of the bridge chain, things should be pretty simple. In fact, there was some discussion in the past about these checks [1], including a discussion about whether the checks were needed and whether the calls ought to be refcounted. At the time, I decided not to mess with it because it felt too risky. Looking closer at it now, I'm fairly certain that nothing in the existing codebase is expecting these calls to be refcounted. The only real question is whether someone is already doing something to ensure prepare()/unprepare() match and enabled()/disable() match. I would say that, even if there is something else ensuring that things match, there's enough complexity that adding an extra bool and an extra double-check here is a good idea. Let's add a drm_warn() to let people know that it's considered a minor error to take advantage of drm_panel's double-checking but we'll still make things work fine. We'll also add an entry to the official DRM todo list to remove the now pointless check from the panels after this patch lands and, eventually, fixup anyone who is triggering the new warning. [1] https://lore.kernel.org/r/20210416153909.v4.27.I502f2a92ddd36c3d28d014dd75e170c2d405a0a5@changeid Acked-by:Neil Armstrong <neil.armstrong@linaro.org> Reviewed-by:
Maxime Ripard <mripard@kernel.org> Signed-off-by:
Douglas Anderson <dianders@chromium.org> Link: https://patchwork.freedesktop.org/patch/msgid/20230727101636.v4.2.I59b417d4c29151cc2eff053369ec4822b606f375@changeid
-
mentioned in commit 157c1381
-
mentioned in commit 2b8c19b9
-
mentioned in commit 3004d2e9
-
mentioned in commit b605f257
-
mentioned in commit 5a847750
-
mentioned in commit f124478d
-
mentioned in commit e28df86a
-
mentioned in commit 2a1c99d7
-
mentioned in commit 4e5e6fa7
-
mentioned in commit 3c24e31c
-
mentioned in commit 3904f317
-
mentioned in commit f9055051
-
mentioned in commit 598dc42f
-
mentioned in commit 12866fdc
-
mentioned in commit 7c9526e5
-
mentioned in commit db45a699
-
mentioned in commit 698acd40
-
mentioned in commit 9a3f7eb7
-
mentioned in commit 2469cb5c
-
mentioned in commit 804c4d0a
-
mentioned in commit e9864996
-
mentioned in commit 15573957
-
mentioned in commit b7c906d6
-
mentioned in commit 316bb147