From 2367b261cfbbb7b97626e6cdc7b3d4aef4e5b40f Mon Sep 17 00:00:00 2001 From: "chaoyi.chen" Date: Tue, 18 Feb 2025 11:40:43 +0800 Subject: [PATCH] drm/rockchip: dw_dp: Set output_type in dw_dp_encoder_mode_valid() The output_type may changed after DP encoder bound to CRTC. For example, when performing modeset, calling vop2_crtc_atomic_disable() will clear the output_type to zero. When drm_mode_getconnector() is called again, since the encoder has already been bound to the CRTC, the output_type will not be set and will remain zero. It can lead to the vop2_crtc_mode_valid() being unable to retrieve the correct output_type. This patch set output_type in dw_dp_encoder_mode_valid(), regardless of whether encoder is already bound to a CRTC. Change-Id: I1888d4cc44604072bbf0cbe67a0d21fa8303b7b0 Signed-off-by: chaoyi.chen --- drivers/gpu/drm/rockchip/dw-dp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/dw-dp.c b/drivers/gpu/drm/rockchip/dw-dp.c index 5dc687bfcf67..ec74256903a6 100644 --- a/drivers/gpu/drm/rockchip/dw-dp.c +++ b/drivers/gpu/drm/rockchip/dw-dp.c @@ -3060,7 +3060,10 @@ static enum drm_mode_status dw_dp_encoder_mode_valid(struct drm_encoder *encoder struct drm_device *dev = encoder->dev; struct rockchip_crtc_state *s; - if (!crtc) { + if (crtc) { + s = to_rockchip_crtc_state(crtc->state); + s->output_type = DRM_MODE_CONNECTOR_DisplayPort; + } else { drm_for_each_crtc(crtc, dev) { if (!drm_encoder_crtc_ok(encoder, crtc)) continue;