Lines Matching refs:crtc

25 static enum drm_mode_status malidp_crtc_mode_valid(struct drm_crtc *crtc,  in malidp_crtc_mode_valid()  argument
28 struct malidp_drm *malidp = crtc_to_malidp_device(crtc); in malidp_crtc_mode_valid()
49 static void malidp_crtc_atomic_enable(struct drm_crtc *crtc, in malidp_crtc_atomic_enable() argument
52 struct malidp_drm *malidp = crtc_to_malidp_device(crtc); in malidp_crtc_atomic_enable()
55 int err = pm_runtime_get_sync(crtc->dev->dev); in malidp_crtc_atomic_enable()
62 drm_display_mode_to_videomode(&crtc->state->adjusted_mode, &vm); in malidp_crtc_atomic_enable()
66 clk_set_rate(hwdev->pxlclk, crtc->state->adjusted_mode.crtc_clock * 1000); in malidp_crtc_atomic_enable()
70 drm_crtc_vblank_on(crtc); in malidp_crtc_atomic_enable()
73 static void malidp_crtc_atomic_disable(struct drm_crtc *crtc, in malidp_crtc_atomic_disable() argument
77 crtc); in malidp_crtc_atomic_disable()
78 struct malidp_drm *malidp = crtc_to_malidp_device(crtc); in malidp_crtc_atomic_disable()
85 drm_crtc_vblank_off(crtc); in malidp_crtc_atomic_disable()
90 err = pm_runtime_put(crtc->dev->dev); in malidp_crtc_atomic_disable()
151 static int malidp_crtc_atomic_check_gamma(struct drm_crtc *crtc, in malidp_crtc_atomic_check_gamma() argument
162 if (crtc->state->gamma_lut && in malidp_crtc_atomic_check_gamma()
163 (crtc->state->gamma_lut->base.id == state->gamma_lut->base.id)) in malidp_crtc_atomic_check_gamma()
189 ret = drm_atomic_helper_check_modeset(crtc->dev, state->state); in malidp_crtc_atomic_check_gamma()
205 static int malidp_crtc_atomic_check_ctm(struct drm_crtc *crtc, in malidp_crtc_atomic_check_ctm() argument
218 if (crtc->state->ctm && (crtc->state->ctm->base.id == in malidp_crtc_atomic_check_ctm()
250 static int malidp_crtc_atomic_check_scaling(struct drm_crtc *crtc, in malidp_crtc_atomic_check_scaling() argument
253 struct malidp_drm *malidp = crtc_to_malidp_device(crtc); in malidp_crtc_atomic_check_scaling()
340 static int malidp_crtc_atomic_check(struct drm_crtc *crtc, in malidp_crtc_atomic_check() argument
344 crtc); in malidp_crtc_atomic_check()
345 struct malidp_drm *malidp = crtc_to_malidp_device(crtc); in malidp_crtc_atomic_check()
424 u32 old_mask = crtc->state->connector_mask; in malidp_crtc_atomic_check()
432 ret = malidp_crtc_atomic_check_gamma(crtc, crtc_state); in malidp_crtc_atomic_check()
433 ret = ret ? ret : malidp_crtc_atomic_check_ctm(crtc, crtc_state); in malidp_crtc_atomic_check()
434 ret = ret ? ret : malidp_crtc_atomic_check_scaling(crtc, crtc_state); in malidp_crtc_atomic_check()
446 static struct drm_crtc_state *malidp_crtc_duplicate_state(struct drm_crtc *crtc) in malidp_crtc_duplicate_state() argument
450 if (WARN_ON(!crtc->state)) in malidp_crtc_duplicate_state()
453 old_state = to_malidp_crtc_state(crtc->state); in malidp_crtc_duplicate_state()
458 __drm_atomic_helper_crtc_duplicate_state(crtc, &state->base); in malidp_crtc_duplicate_state()
470 static void malidp_crtc_destroy_state(struct drm_crtc *crtc, in malidp_crtc_destroy_state() argument
483 static void malidp_crtc_reset(struct drm_crtc *crtc) in malidp_crtc_reset() argument
488 if (crtc->state) in malidp_crtc_reset()
489 malidp_crtc_destroy_state(crtc, crtc->state); in malidp_crtc_reset()
492 __drm_atomic_helper_crtc_reset(crtc, &state->base); in malidp_crtc_reset()
494 __drm_atomic_helper_crtc_reset(crtc, NULL); in malidp_crtc_reset()
497 static int malidp_crtc_enable_vblank(struct drm_crtc *crtc) in malidp_crtc_enable_vblank() argument
499 struct malidp_drm *malidp = crtc_to_malidp_device(crtc); in malidp_crtc_enable_vblank()
507 static void malidp_crtc_disable_vblank(struct drm_crtc *crtc) in malidp_crtc_disable_vblank() argument
509 struct malidp_drm *malidp = crtc_to_malidp_device(crtc); in malidp_crtc_disable_vblank()
550 ret = drmm_crtc_init_with_planes(drm, &malidp->crtc, primary, NULL, in malidp_crtc_init()
555 drm_crtc_helper_add(&malidp->crtc, &malidp_crtc_helper_funcs); in malidp_crtc_init()
556 drm_mode_crtc_set_gamma_size(&malidp->crtc, MALIDP_GAMMA_LUT_SIZE); in malidp_crtc_init()
558 drm_crtc_enable_color_mgmt(&malidp->crtc, 0, true, MALIDP_GAMMA_LUT_SIZE); in malidp_crtc_init()