Lines Matching refs:crtc

61 drm_crtc_to_atmel_hlcdc_crtc(struct drm_crtc *crtc)  in drm_crtc_to_atmel_hlcdc_crtc()  argument
63 return container_of(crtc, struct atmel_hlcdc_crtc, base); in drm_crtc_to_atmel_hlcdc_crtc()
68 struct atmel_hlcdc_crtc *crtc = drm_crtc_to_atmel_hlcdc_crtc(c); in atmel_hlcdc_crtc_mode_set_nofb() local
69 struct regmap *regmap = crtc->dc->hlcdc->regmap; in atmel_hlcdc_crtc_mode_set_nofb()
85 if (en_iter->crtc == c) { in atmel_hlcdc_crtc_mode_set_nofb()
100 ret = clk_prepare_enable(crtc->dc->hlcdc->sys_clk); in atmel_hlcdc_crtc_mode_set_nofb()
124 prate = clk_get_rate(crtc->dc->hlcdc->sys_clk); in atmel_hlcdc_crtc_mode_set_nofb()
126 if (!crtc->dc->desc->fixed_clksrc) { in atmel_hlcdc_crtc_mode_set_nofb()
181 clk_disable_unprepare(crtc->dc->hlcdc->sys_clk); in atmel_hlcdc_crtc_mode_set_nofb()
188 struct atmel_hlcdc_crtc *crtc = drm_crtc_to_atmel_hlcdc_crtc(c); in atmel_hlcdc_crtc_mode_valid() local
190 return atmel_hlcdc_dc_mode_valid(crtc->dc, mode); in atmel_hlcdc_crtc_mode_valid()
197 struct atmel_hlcdc_crtc *crtc = drm_crtc_to_atmel_hlcdc_crtc(c); in atmel_hlcdc_crtc_atomic_disable() local
198 struct regmap *regmap = crtc->dc->hlcdc->regmap; in atmel_hlcdc_crtc_atomic_disable()
220 clk_disable_unprepare(crtc->dc->hlcdc->sys_clk); in atmel_hlcdc_crtc_atomic_disable()
232 struct atmel_hlcdc_crtc *crtc = drm_crtc_to_atmel_hlcdc_crtc(c); in atmel_hlcdc_crtc_atomic_enable() local
233 struct regmap *regmap = crtc->dc->hlcdc->regmap; in atmel_hlcdc_crtc_atomic_enable()
241 clk_prepare_enable(crtc->dc->hlcdc->sys_clk); in atmel_hlcdc_crtc_atomic_enable()
324 struct atmel_hlcdc_crtc *crtc; in atmel_hlcdc_crtc_select_output_mode() local
327 crtc = drm_crtc_to_atmel_hlcdc_crtc(state->crtc); in atmel_hlcdc_crtc_select_output_mode()
332 if (!cstate->crtc) in atmel_hlcdc_crtc_select_output_mode()
337 if (crtc->dc->desc->conflicting_output_formats) in atmel_hlcdc_crtc_select_output_mode()
378 struct atmel_hlcdc_crtc *crtc = drm_crtc_to_atmel_hlcdc_crtc(c); in atmel_hlcdc_crtc_atomic_flush() local
388 crtc->event = c->state->event; in atmel_hlcdc_crtc_atomic_flush()
406 struct atmel_hlcdc_crtc *crtc = drm_crtc_to_atmel_hlcdc_crtc(c); in atmel_hlcdc_crtc_destroy() local
409 kfree(crtc); in atmel_hlcdc_crtc_destroy()
412 static void atmel_hlcdc_crtc_finish_page_flip(struct atmel_hlcdc_crtc *crtc) in atmel_hlcdc_crtc_finish_page_flip() argument
414 struct drm_device *dev = crtc->base.dev; in atmel_hlcdc_crtc_finish_page_flip()
418 if (crtc->event) { in atmel_hlcdc_crtc_finish_page_flip()
419 drm_crtc_send_vblank_event(&crtc->base, crtc->event); in atmel_hlcdc_crtc_finish_page_flip()
420 drm_crtc_vblank_put(&crtc->base); in atmel_hlcdc_crtc_finish_page_flip()
421 crtc->event = NULL; in atmel_hlcdc_crtc_finish_page_flip()
432 static void atmel_hlcdc_crtc_reset(struct drm_crtc *crtc) in atmel_hlcdc_crtc_reset() argument
436 if (crtc->state) { in atmel_hlcdc_crtc_reset()
437 __drm_atomic_helper_crtc_destroy_state(crtc->state); in atmel_hlcdc_crtc_reset()
438 state = drm_crtc_state_to_atmel_hlcdc_crtc_state(crtc->state); in atmel_hlcdc_crtc_reset()
440 crtc->state = NULL; in atmel_hlcdc_crtc_reset()
445 __drm_atomic_helper_crtc_reset(crtc, &state->base); in atmel_hlcdc_crtc_reset()
449 atmel_hlcdc_crtc_duplicate_state(struct drm_crtc *crtc) in atmel_hlcdc_crtc_duplicate_state() argument
453 if (WARN_ON(!crtc->state)) in atmel_hlcdc_crtc_duplicate_state()
459 __drm_atomic_helper_crtc_duplicate_state(crtc, &state->base); in atmel_hlcdc_crtc_duplicate_state()
461 cur = drm_crtc_state_to_atmel_hlcdc_crtc_state(crtc->state); in atmel_hlcdc_crtc_duplicate_state()
467 static void atmel_hlcdc_crtc_destroy_state(struct drm_crtc *crtc, in atmel_hlcdc_crtc_destroy_state() argument
479 struct atmel_hlcdc_crtc *crtc = drm_crtc_to_atmel_hlcdc_crtc(c); in atmel_hlcdc_crtc_enable_vblank() local
480 struct regmap *regmap = crtc->dc->hlcdc->regmap; in atmel_hlcdc_crtc_enable_vblank()
490 struct atmel_hlcdc_crtc *crtc = drm_crtc_to_atmel_hlcdc_crtc(c); in atmel_hlcdc_crtc_disable_vblank() local
491 struct regmap *regmap = crtc->dc->hlcdc->regmap; in atmel_hlcdc_crtc_disable_vblank()
511 struct atmel_hlcdc_crtc *crtc; in atmel_hlcdc_crtc_create() local
515 crtc = kzalloc(sizeof(*crtc), GFP_KERNEL); in atmel_hlcdc_crtc_create()
516 if (!crtc) in atmel_hlcdc_crtc_create()
519 crtc->dc = dc; in atmel_hlcdc_crtc_create()
539 ret = drm_crtc_init_with_planes(dev, &crtc->base, &primary->base, in atmel_hlcdc_crtc_create()
545 crtc->id = drm_crtc_index(&crtc->base); in atmel_hlcdc_crtc_create()
553 overlay->base.possible_crtcs = 1 << crtc->id; in atmel_hlcdc_crtc_create()
557 drm_crtc_helper_add(&crtc->base, &lcdc_crtc_helper_funcs); in atmel_hlcdc_crtc_create()
559 drm_mode_crtc_set_gamma_size(&crtc->base, ATMEL_HLCDC_CLUT_SIZE); in atmel_hlcdc_crtc_create()
560 drm_crtc_enable_color_mgmt(&crtc->base, 0, false, in atmel_hlcdc_crtc_create()
563 dc->crtc = &crtc->base; in atmel_hlcdc_crtc_create()
568 atmel_hlcdc_crtc_destroy(&crtc->base); in atmel_hlcdc_crtc_create()