struct drm_connector_state *conn_state)
{
struct rockchip_crtc_state *s = to_rockchip_crtc_state(crtc_state);
- struct rockchip_dp_device *dp = to_dp(encoder);
- int ret;
/*
* The hardware IC designed that VOP must output the RGB10 video
* contoller, that's why we need to hardcode the VOP output mode
* to RGA10 here.
*/
-
- ret = drm_of_encoder_active_endpoint_id(dp->dev->of_node, encoder);
- if (ret < 0)
- return true;
-
- switch (dp->data->chip_type) {
- case RK3399_EDP:
- /*
- * For RK3399, VOP Lit must code the out mode to RGB888,
- * VOP Big must code the out mode to RGB10.
- */
- if (ret)
- s->output_mode = ROCKCHIP_OUT_MODE_P888;
- else
- s->output_mode = ROCKCHIP_OUT_MODE_AAAA;
- break;
-
- default:
- s->output_mode = ROCKCHIP_OUT_MODE_AAAA;
- break;
- }
-
+ s->output_mode = ROCKCHIP_OUT_MODE_AAAA;
s->output_type = DRM_MODE_CONNECTOR_eDP;
return 0;
static void vop_crtc_enable(struct drm_crtc *crtc)
{
struct vop *vop = to_vop(crtc);
+ const struct vop_data *vop_data = vop->data;
struct rockchip_crtc_state *s = to_rockchip_crtc_state(crtc->state);
struct drm_display_mode *adjusted_mode = &crtc->state->adjusted_mode;
u16 hsync_len = adjusted_mode->hsync_end - adjusted_mode->hsync_start;
default:
DRM_ERROR("unsupport connector_type[%d]\n", s->output_type);
}
+
+ if (s->output_mode == ROCKCHIP_OUT_MODE_AAAA &&
+ !(vop_data->feature & VOP_FEATURE_OUTPUT_10BIT))
+ s->output_mode = ROCKCHIP_OUT_MODE_P888;
+
VOP_CTRL_SET(vop, out_mode, s->output_mode);
VOP_CTRL_SET(vop, htotal_pw, (htotal << 16) | hsync_len);
unsigned int area_size;
};
+#define VOP_FEATURE_OUTPUT_10BIT BIT(0)
+
struct vop_data {
const struct vop_reg_data *init_table;
unsigned int table_size;
const struct vop_intr *intr;
const struct vop_win_data *win;
unsigned int win_size;
+ u64 feature;
};
/* interrupt define */
};
static const struct vop_data rk3288_vop = {
+ .feature = VOP_FEATURE_OUTPUT_10BIT,
.init_table = rk3288_init_reg_table,
.table_size = ARRAY_SIZE(rk3288_init_reg_table),
.intr = &rk3288_vop_intr,
};
static const struct vop_data rk3399_vop_big = {
+ .feature = VOP_FEATURE_OUTPUT_10BIT,
.init_table = rk3399_init_reg_table,
.table_size = ARRAY_SIZE(rk3399_init_reg_table),
.intr = &rk3399_vop_intr,