]> git.baikalelectronics.ru Git - kernel.git/commit
drm/omap: dsi: allow DSI commands to be sent early
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Tue, 15 Dec 2020 10:46:57 +0000 (12:46 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Tue, 15 Dec 2020 14:17:32 +0000 (16:17 +0200)
commit62b1d4298ab5f24312c1fe5eb3a829e7db573f1e
tree3941a9ee94a2fc461ac1a36bf6d3b1ab6bd82619
parent98994fe17799f14fa003d28b18a082f162aec745
drm/omap: dsi: allow DSI commands to be sent early

Panel drivers can send DSI commands in panel's prepare(), which happens
before the bridge's enable() is called. The OMAP DSI driver currently
only sets up the DSI interface at bridge's enable(), so prepare() cannot
be used to send DSI commands.

This patch fixes the issue by making it possible to enable the DSI
interface any time a command is about to be sent. Disabling the
interface is be done via delayed work.

Clarifications for the delayed disable work and the panel doing DSI
transactions:

bridge_enable: If the disable callback is called just before
bridge_enable takes the dsi_bus_lock, no problem, bridge_enable just
enables the interface again. If the callback is ran just after
bridge_enable's dsi_bus_unlock, no problem, dsi->video_enabled == true
so the callback does nothing.

bridge_disable: similar to bridge-enable, the callback won't do anything
if video_enabled == true, and after bridge-disable has turned the video
and the interface off, there's nothing to do for the callback.

omap_dsi_host_detach: this is called when the panel does
mipi_dsi_detach(), and we expect the panel to _not_ do any DSI
transactions after (or during) mipi_dsi_detatch(), so there are no
race conditions.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-85-tomi.valkeinen@ti.com
drivers/gpu/drm/omapdrm/dss/dsi.c
drivers/gpu/drm/omapdrm/dss/dsi.h