drm: omapdrm: Check the CRTC software state at enable/disable time
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Mon, 18 Apr 2016 00:09:48 +0000 (03:09 +0300)
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Mon, 19 Dec 2016 09:24:58 +0000 (11:24 +0200)
commit03af8157aac6db1d0a84747dec64b9f5a241ed62
tree7a4c4e92f829f9d99a09920d0fdd83ce80753260
parentdadf4659d0608e034b6633f30300c2eff2dafb4c
drm: omapdrm: Check the CRTC software state at enable/disable time

The omapdrm DSS manager enable/disable operations check the DSS manager
state to avoid double enabling/disabling. Check the CRTC software state
instead to decrease the dependency of the DRM layer to the DSS layer.
The dispc_mgr_is_enabled() function then be turned into a static
function, but needs to be moved up in its compilation unit to avoid a
forward declaration.

Add a WARN_ON to catch double enable or disable that should be prevented
by the DRM core and would be a clear sign of a bug. The warning should
eventually be removed.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/gpu/drm/omapdrm/dss/dispc.c
drivers/gpu/drm/omapdrm/dss/omapdss.h
drivers/gpu/drm/omapdrm/omap_crtc.c