drm/msm: Disable mdp5 crtc when there are no active planes

Submitted by Sean Paul on July 2, 2018, 8 p.m.


Message ID 20180702200041.248415-1-seanpaul@chromium.org
State New
Headers show
Series "drm/msm: Disable mdp5 crtc when there are no active planes" ( rev: 1 ) in DRI devel

Not browsing as part of any series.

Commit Message

Sean Paul July 2, 2018, 8 p.m.
Unlike other compositors, we don't get a crtc disable from weston
when the cable is unplugged. As such, when the cable is re-plugged
the kernel doesn't detect an enable/mode change and initiates a
simple plane update instead of a modeset.

This patch clears the mode when all planes are off.

Signed-off-by: Sean Paul <seanpaul@chromium.org>

Sorry for the wide distribution, I'm not 100% on whether this is the
right place to fix this.

Is this expected behavior from weston? Once we have solid fill support,
it seems reasonable that a crtc might be left on if no planes are
active (for blanking the screen, etc). However, hotplug is currently
borked, so I don't want to just leave it as-is if this should be
handled in the kernel.

Suggestions welcome!


 drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c
index 63dcc39b5efd..e89e46a4014e 100644
--- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c
+++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c
@@ -645,7 +645,7 @@  static int mdp5_crtc_atomic_check(struct drm_crtc *crtc,
 	/* bail out early if there aren't any planes */
 	if (!cnt)
-		return 0;
+		return drm_atomic_set_mode_for_crtc(state, NULL);
 	hw_cfg = mdp5_cfg_get_hw_config(mdp5_kms->cfg);