drm/rockchip: dw-dp: support dynamic binding to different vp port

According to the application scenario, DP0/DP1 may be bind to the
same vp port, or different vp port. The corresponding bit in output_if
needs to be set or cleared correctly.

Change-Id: I880946d0c61a209d5a16ff7d2aada43f87a075c5
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
This commit is contained in:
Zheng Yang
2021-11-29 15:30:28 +08:00
committed by Tao Huang
parent 18a6cae4bb
commit ca885383eb

View File

@@ -1496,7 +1496,14 @@ static void dw_dp_encoder_enable(struct drm_encoder *encoder)
static void dw_dp_encoder_disable(struct drm_encoder *encoder)
{
struct dw_dp *dp = encoder_to_dp(encoder);
struct drm_crtc *crtc = encoder->crtc;
struct rockchip_crtc_state *s = to_rockchip_crtc_state(crtc->state);
if (dp->split_mode)
s->output_if &= ~(VOP_OUTPUT_IF_DP0 | VOP_OUTPUT_IF_DP1);
else
s->output_if &= ~(dp->id ? VOP_OUTPUT_IF_DP1 : VOP_OUTPUT_IF_DP0);
}
static int dw_dp_encoder_atomic_check(struct drm_encoder *encoder,
@@ -1519,7 +1526,7 @@ static int dw_dp_encoder_atomic_check(struct drm_encoder *encoder,
s->output_flags |= dp->id ? ROCKCHIP_OUTPUT_DATA_SWAP : 0;
s->output_if |= VOP_OUTPUT_IF_DP0 | VOP_OUTPUT_IF_DP1;
} else {
s->output_if = dp->id ? VOP_OUTPUT_IF_DP1 : VOP_OUTPUT_IF_DP0;
s->output_if |= dp->id ? VOP_OUTPUT_IF_DP1 : VOP_OUTPUT_IF_DP0;
}
s->output_bpc = di->bpc;
s->bus_flags = di->bus_flags;