.. | .. |
---|
682 | 682 | if (crtc->state) |
---|
683 | 683 | dpu_crtc_destroy_state(crtc, crtc->state); |
---|
684 | 684 | |
---|
685 | | - __drm_atomic_helper_crtc_reset(crtc, &cstate->base); |
---|
| 685 | + if (cstate) |
---|
| 686 | + __drm_atomic_helper_crtc_reset(crtc, &cstate->base); |
---|
| 687 | + else |
---|
| 688 | + __drm_atomic_helper_crtc_reset(crtc, NULL); |
---|
686 | 689 | } |
---|
687 | 690 | |
---|
688 | 691 | /** |
---|
.. | .. |
---|
831 | 834 | struct drm_rect crtc_rect = { 0 }; |
---|
832 | 835 | |
---|
833 | 836 | pstates = kzalloc(sizeof(*pstates) * DPU_STAGE_MAX * 4, GFP_KERNEL); |
---|
| 837 | + if (!pstates) |
---|
| 838 | + return -ENOMEM; |
---|
834 | 839 | |
---|
835 | 840 | if (!state->enable || !state->active) { |
---|
836 | 841 | DPU_DEBUG("crtc%d -> enable %d, active %d, skip atomic_check\n", |
---|
.. | .. |
---|
1257 | 1262 | struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct drm_plane *plane, |
---|
1258 | 1263 | struct drm_plane *cursor) |
---|
1259 | 1264 | { |
---|
| 1265 | + struct msm_drm_private *priv = dev->dev_private; |
---|
| 1266 | + struct dpu_kms *dpu_kms = to_dpu_kms(priv->kms); |
---|
1260 | 1267 | struct drm_crtc *crtc = NULL; |
---|
1261 | 1268 | struct dpu_crtc *dpu_crtc = NULL; |
---|
1262 | 1269 | int i; |
---|
.. | .. |
---|
1288 | 1295 | |
---|
1289 | 1296 | drm_crtc_helper_add(crtc, &dpu_crtc_helper_funcs); |
---|
1290 | 1297 | |
---|
1291 | | - drm_crtc_enable_color_mgmt(crtc, 0, true, 0); |
---|
| 1298 | + if (dpu_kms->catalog->dspp_count) |
---|
| 1299 | + drm_crtc_enable_color_mgmt(crtc, 0, true, 0); |
---|
1292 | 1300 | |
---|
1293 | 1301 | /* save user friendly CRTC name for later */ |
---|
1294 | 1302 | snprintf(dpu_crtc->name, DPU_CRTC_NAME_SIZE, "crtc%u", crtc->base.id); |
---|