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 <chaoyi.chen@rock-chips.com>
This commit is contained in:
chaoyi.chen
2025-02-18 11:40:43 +08:00
committed by Tao Huang
parent de85a5fecf
commit 2367b261cf

View File

@@ -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;