From ae488c03abd7cf9291947c3bb01e58ac4de78bed Mon Sep 17 00:00:00 2001 From: Andy Yan Date: Tue, 22 Dec 2020 17:03:04 +0800 Subject: [PATCH] drm: Not mark crtc state as connectors_changed when a writeback connector attatch to a crtc The drm core will disable than enable a crtc when is marked as connectors_changed. But when we attach a writeback connector to a running crtc, we really don't need this disable/enable, which will black a running screen. Change-Id: I636615f27424bc60496ffc487c218f60fb95d719 Signed-off-by: Andy Yan --- drivers/gpu/drm/drm_atomic_helper.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index caa69a093605..9418d0847630 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -296,12 +296,14 @@ update_connector_routing(struct drm_atomic_state *state, if (old_connector_state->crtc != new_connector_state->crtc) { if (old_connector_state->crtc) { crtc_state = drm_atomic_get_new_crtc_state(state, old_connector_state->crtc); - crtc_state->connectors_changed = true; + if (connector->connector_type != DRM_MODE_CONNECTOR_WRITEBACK) + crtc_state->connectors_changed = true; } if (new_connector_state->crtc) { crtc_state = drm_atomic_get_new_crtc_state(state, new_connector_state->crtc); - crtc_state->connectors_changed = true; + if (connector->connector_type != DRM_MODE_CONNECTOR_WRITEBACK) + crtc_state->connectors_changed = true; } } @@ -386,7 +388,8 @@ update_connector_routing(struct drm_atomic_state *state, set_best_encoder(state, new_connector_state, new_encoder); - crtc_state->connectors_changed = true; + if (connector->connector_type != DRM_MODE_CONNECTOR_WRITEBACK) + crtc_state->connectors_changed = true; DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] using [ENCODER:%d:%s] on [CRTC:%d:%s]\n", connector->base.id,