!connector_helper_funcs->best_encoder)
return -ENXIO;
encoder = connector_helper_funcs->best_encoder(connector);
+ if (!encoder)
+ return -ENXIO;
encoder_helper_funcs = encoder->helper_private;
- if (!encoder || !encoder_helper_funcs->atomic_check)
+ if (!encoder_helper_funcs->atomic_check)
return -ENXIO;
ret = encoder_helper_funcs->atomic_check(encoder, crtc->state,
conn_state);
int pipe = drm_crtc_index(crtc);
struct rockchip_drm_private *priv = crtc->dev->dev_private;
- if (pipe > ROCKCHIP_MAX_CRTC)
+ if (pipe >= ROCKCHIP_MAX_CRTC)
return -EINVAL;
priv->crtc_funcs[pipe] = crtc_funcs;
int pipe = drm_crtc_index(crtc);
struct rockchip_drm_private *priv = crtc->dev->dev_private;
- if (pipe > ROCKCHIP_MAX_CRTC)
+ if (pipe >= ROCKCHIP_MAX_CRTC)
return;
priv->crtc_funcs[pipe] = NULL;
*y2r_table = csc_table->y2r_bt2020;
if (input_csc == CSC_BT2020)
*r2r_table = csc_table->r2r_bt2020_to_bt709;
- if (!is_input_yuv || y2r_table) {
+ if (!is_input_yuv || *y2r_table) {
if (output_csc == CSC_BT709)
*r2y_table = csc_table->r2y_bt709;
else
*r2y_table = csc_table->r2y_bt601;
}
}
-
} else {
if (!is_input_yuv)
return 0;
struct drm_crtc *crtc = state->crtc;
struct vop_win *win = to_vop_win(plane);
struct vop_plane_state *vop_plane_state = to_vop_plane_state(state);
- struct rockchip_crtc_state *s = to_rockchip_crtc_state(crtc->state);
- struct vop *vop = to_vop(state->crtc);
+ struct rockchip_crtc_state *s;
+ struct vop *vop;
struct drm_framebuffer *fb = state->fb;
unsigned int actual_w, actual_h;
unsigned int dsp_stx, dsp_sty;
ymirror = !!(state->rotation & BIT(DRM_REFLECT_Y));
xmirror = !!(state->rotation & BIT(DRM_REFLECT_X));
+ vop = to_vop(state->crtc);
+ s = to_rockchip_crtc_state(crtc->state);
+
spin_lock(&vop->reg_lock);
VOP_WIN_SET(vop, win, xmirror, xmirror);
if (strncmp(s, "jeida", 6) == 0)
return LVDS_FORMAT_JEIDA;
- else if (strncmp(s, "vesa", 6) == 0)
+ else if (strncmp(s, "vesa", 5) == 0)
return LVDS_FORMAT_VESA;
return -EINVAL;