Commit d0e20d0e authored by Mark Yao's avatar Mark Yao

drm/rockchip: direct config connecter gate and out_mode

Both connecter gate and out_mode are not conflict with mode set
configure. Direct setting connecter gate and out_mode, that allow
connector do rockchip_drm_crtc_mode_config after mode set.
Signed-off-by: default avatarMark Yao <mark.yao@rock-chips.com>
parent f32fad51
...@@ -89,9 +89,6 @@ struct vop { ...@@ -89,9 +89,6 @@ struct vop {
struct drm_device *drm_dev; struct drm_device *drm_dev;
bool is_enabled; bool is_enabled;
int connector_type;
int connector_out_mode;
/* mutex vsync_ work */ /* mutex vsync_ work */
struct mutex vsync_mutex; struct mutex vsync_mutex;
bool vsync_work_pending; bool vsync_work_pending;
...@@ -1018,8 +1015,24 @@ int rockchip_drm_crtc_mode_config(struct drm_crtc *crtc, ...@@ -1018,8 +1015,24 @@ int rockchip_drm_crtc_mode_config(struct drm_crtc *crtc,
{ {
struct vop *vop = to_vop(crtc); struct vop *vop = to_vop(crtc);
vop->connector_type = connector_type; if (WARN_ON(!vop->is_enabled))
vop->connector_out_mode = out_mode; return -EINVAL;
switch (connector_type) {
case DRM_MODE_CONNECTOR_LVDS:
VOP_CTRL_SET(vop, rgb_en, 1);
break;
case DRM_MODE_CONNECTOR_eDP:
VOP_CTRL_SET(vop, edp_en, 1);
break;
case DRM_MODE_CONNECTOR_HDMIA:
VOP_CTRL_SET(vop, hdmi_en, 1);
break;
default:
DRM_ERROR("unsupport connector_type[%d]\n", connector_type);
return -EINVAL;
};
VOP_CTRL_SET(vop, out_mode, out_mode);
return 0; return 0;
} }
...@@ -1132,22 +1145,6 @@ static void vop_crtc_enable(struct drm_crtc *crtc) ...@@ -1132,22 +1145,6 @@ static void vop_crtc_enable(struct drm_crtc *crtc)
vop_dsp_hold_valid_irq_disable(vop); vop_dsp_hold_valid_irq_disable(vop);
} }
switch (vop->connector_type) {
case DRM_MODE_CONNECTOR_LVDS:
VOP_CTRL_SET(vop, rgb_en, 1);
break;
case DRM_MODE_CONNECTOR_eDP:
VOP_CTRL_SET(vop, edp_en, 1);
break;
case DRM_MODE_CONNECTOR_HDMIA:
VOP_CTRL_SET(vop, hdmi_en, 1);
break;
default:
DRM_ERROR("unsupport connector_type[%d]\n",
vop->connector_type);
};
VOP_CTRL_SET(vop, out_mode, vop->connector_out_mode);
val = 0x8; val = 0x8;
val |= (adjusted_mode->flags & DRM_MODE_FLAG_NHSYNC) ? 0 : 1; val |= (adjusted_mode->flags & DRM_MODE_FLAG_NHSYNC) ? 0 : 1;
val |= (adjusted_mode->flags & DRM_MODE_FLAG_NVSYNC) ? 0 : (1 << 1); val |= (adjusted_mode->flags & DRM_MODE_FLAG_NVSYNC) ? 0 : (1 << 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment