Lines Matching full:crtc
31 if (conn_st->crtc != crtc_st->crtc) in komeda_crtc_get_color_config()
66 * @crtc: DRM crtc
67 * @state: the crtc state object
77 komeda_crtc_atomic_check(struct drm_crtc *crtc, in komeda_crtc_atomic_check() argument
81 crtc); in komeda_crtc_atomic_check()
82 struct komeda_crtc *kcrtc = to_kcrtc(crtc); in komeda_crtc_atomic_check()
107 /* For active a crtc, mainly need two parts of preparation
203 struct drm_crtc *crtc = &kcrtc->base; in komeda_crtc_handle_event() local
207 drm_crtc_handle_vblank(crtc); in komeda_crtc_handle_event()
215 DRM_WARN("CRTC[%d]: EOW happen but no wb_connector.\n", in komeda_crtc_handle_event()
226 spin_lock_irqsave(&crtc->dev->event_lock, flags); in komeda_crtc_handle_event()
230 } else if (crtc->state->event) { in komeda_crtc_handle_event()
231 event = crtc->state->event; in komeda_crtc_handle_event()
236 crtc->state->event = NULL; in komeda_crtc_handle_event()
237 drm_crtc_send_vblank_event(crtc, event); in komeda_crtc_handle_event()
239 DRM_WARN("CRTC[%d]: FLIP happened but no pending commit.\n", in komeda_crtc_handle_event()
242 spin_unlock_irqrestore(&crtc->dev->event_lock, flags); in komeda_crtc_handle_event()
247 komeda_crtc_do_flush(struct drm_crtc *crtc, in komeda_crtc_do_flush() argument
250 struct komeda_crtc *kcrtc = to_kcrtc(crtc); in komeda_crtc_do_flush()
251 struct komeda_crtc_state *kcrtc_st = to_kcrtc_st(crtc->state); in komeda_crtc_do_flush()
258 DRM_DEBUG_ATOMIC("CRTC%d_FLUSH: active_pipes: 0x%x, affected: 0x%x.\n", in komeda_crtc_do_flush()
259 drm_crtc_index(crtc), in komeda_crtc_do_flush()
278 komeda_crtc_atomic_enable(struct drm_crtc *crtc, in komeda_crtc_atomic_enable() argument
282 crtc); in komeda_crtc_atomic_enable()
283 pm_runtime_get_sync(crtc->dev->dev); in komeda_crtc_atomic_enable()
284 komeda_crtc_prepare(to_kcrtc(crtc)); in komeda_crtc_atomic_enable()
285 drm_crtc_vblank_on(crtc); in komeda_crtc_atomic_enable()
286 WARN_ON(drm_crtc_vblank_get(crtc)); in komeda_crtc_atomic_enable()
287 komeda_crtc_do_flush(crtc, old); in komeda_crtc_atomic_enable()
326 komeda_crtc_atomic_disable(struct drm_crtc *crtc, in komeda_crtc_atomic_disable() argument
330 crtc); in komeda_crtc_atomic_disable()
331 struct komeda_crtc *kcrtc = to_kcrtc(crtc); in komeda_crtc_atomic_disable()
338 DRM_DEBUG_ATOMIC("CRTC%d_DISABLE: active_pipes: 0x%x, affected: 0x%x\n", in komeda_crtc_atomic_disable()
339 drm_crtc_index(crtc), in komeda_crtc_atomic_disable()
352 * use the crtc->state->event to tracking the HW disable operation. in komeda_crtc_atomic_disable()
354 * the crtc->commit is not for disable, but a modeset operation when in komeda_crtc_atomic_disable()
355 * crtc is active, such commit actually has been completed by 3 in komeda_crtc_atomic_disable()
358 * so on this case the crtc->commit is for the whole process. in komeda_crtc_atomic_disable()
360 * flip_done for tracing the disable. and crtc->state->event for in komeda_crtc_atomic_disable()
365 disable_done = (needs_phase2 || crtc->state->active) ? in komeda_crtc_atomic_disable()
366 NULL : &crtc->state->commit->flip_done; in komeda_crtc_atomic_disable()
375 disable_done = crtc->state->active ? in komeda_crtc_atomic_disable()
376 NULL : &crtc->state->commit->flip_done; in komeda_crtc_atomic_disable()
381 drm_crtc_vblank_put(crtc); in komeda_crtc_atomic_disable()
382 drm_crtc_vblank_off(crtc); in komeda_crtc_atomic_disable()
384 pm_runtime_put(crtc->dev->dev); in komeda_crtc_atomic_disable()
388 komeda_crtc_atomic_flush(struct drm_crtc *crtc, in komeda_crtc_atomic_flush() argument
392 crtc); in komeda_crtc_atomic_flush()
394 crtc); in komeda_crtc_atomic_flush()
399 komeda_crtc_do_flush(crtc, old); in komeda_crtc_atomic_flush()
419 struct drm_crtc *crtc = kcrtc_st->base.crtc; in komeda_crtc_get_aclk() local
420 struct komeda_dev *mdev = crtc->dev->dev_private; in komeda_crtc_get_aclk()
424 min_aclk = komeda_calc_min_aclk_rate(to_kcrtc(crtc), pxlclk); in komeda_crtc_get_aclk()
430 komeda_crtc_mode_valid(struct drm_crtc *crtc, const struct drm_display_mode *m) in komeda_crtc_mode_valid() argument
432 struct komeda_dev *mdev = crtc->dev->dev_private; in komeda_crtc_mode_valid()
433 struct komeda_crtc *kcrtc = to_kcrtc(crtc); in komeda_crtc_mode_valid()
450 min_aclk = komeda_calc_min_aclk_rate(to_kcrtc(crtc), min_pxlclk); in komeda_crtc_mode_valid()
461 static bool komeda_crtc_mode_fixup(struct drm_crtc *crtc, in komeda_crtc_mode_fixup() argument
465 struct komeda_crtc *kcrtc = to_kcrtc(crtc); in komeda_crtc_mode_fixup()
495 static void komeda_crtc_reset(struct drm_crtc *crtc) in komeda_crtc_reset() argument
499 if (crtc->state) in komeda_crtc_reset()
500 __drm_atomic_helper_crtc_destroy_state(crtc->state); in komeda_crtc_reset()
502 kfree(to_kcrtc_st(crtc->state)); in komeda_crtc_reset()
503 crtc->state = NULL; in komeda_crtc_reset()
507 __drm_atomic_helper_crtc_reset(crtc, &state->base); in komeda_crtc_reset()
511 komeda_crtc_atomic_duplicate_state(struct drm_crtc *crtc) in komeda_crtc_atomic_duplicate_state() argument
513 struct komeda_crtc_state *old = to_kcrtc_st(crtc->state); in komeda_crtc_atomic_duplicate_state()
520 __drm_atomic_helper_crtc_duplicate_state(crtc, &new->base); in komeda_crtc_atomic_duplicate_state()
529 static void komeda_crtc_atomic_destroy_state(struct drm_crtc *crtc, in komeda_crtc_atomic_destroy_state() argument
536 static int komeda_crtc_vblank_enable(struct drm_crtc *crtc) in komeda_crtc_vblank_enable() argument
538 struct komeda_dev *mdev = crtc->dev->dev_private; in komeda_crtc_vblank_enable()
539 struct komeda_crtc *kcrtc = to_kcrtc(crtc); in komeda_crtc_vblank_enable()
545 static void komeda_crtc_vblank_disable(struct drm_crtc *crtc) in komeda_crtc_vblank_disable() argument
547 struct komeda_dev *mdev = crtc->dev->dev_private; in komeda_crtc_vblank_disable()
548 struct komeda_crtc *kcrtc = to_kcrtc(crtc); in komeda_crtc_vblank_disable()
567 struct komeda_crtc *crtc; in komeda_kms_setup_crtcs() local
575 crtc = &kms->crtcs[kms->n_crtcs]; in komeda_kms_setup_crtcs()
578 crtc->master = master; in komeda_kms_setup_crtcs()
579 crtc->slave = komeda_pipeline_get_slave(master); in komeda_kms_setup_crtcs()
581 if (crtc->slave) in komeda_kms_setup_crtcs()
582 sprintf(str, "pipe-%d", crtc->slave->id); in komeda_kms_setup_crtcs()
586 DRM_INFO("CRTC-%d: master(pipe-%d) slave(%s).\n", in komeda_kms_setup_crtcs()
596 get_crtc_primary(struct komeda_kms_dev *kms, struct komeda_crtc *crtc) in get_crtc_primary() argument
607 if (kplane->layer->base.pipeline == crtc->master) in get_crtc_primary()
638 struct drm_crtc *crtc = &kcrtc->base; in komeda_crtc_add() local
644 err = drm_crtc_init_with_planes(base, crtc, in komeda_crtc_add()
650 drm_crtc_helper_add(crtc, &komeda_crtc_helper_funcs); in komeda_crtc_add()
652 crtc->port = pipe->of_output_port; in komeda_crtc_add()
657 kcrtc->encoder.possible_crtcs = drm_crtc_mask(crtc); in komeda_crtc_add()
668 drm_crtc_enable_color_mgmt(crtc, 0, true, KOMEDA_COLOR_LUT_SIZE); in komeda_crtc_add()