Lines Matching refs:tilcdc_crtc
30 struct tilcdc_crtc { struct
61 #define to_tilcdc_crtc(x) container_of(x, struct tilcdc_crtc, base) argument
99 struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); in tilcdc_crtc_load_palette() local
104 reinit_completion(&tilcdc_crtc->palette_loaded); in tilcdc_crtc_load_palette()
108 tilcdc_crtc->palette_dma_handle); in tilcdc_crtc_load_palette()
110 (u32) tilcdc_crtc->palette_dma_handle + in tilcdc_crtc_load_palette()
128 ret = wait_for_completion_timeout(&tilcdc_crtc->palette_loaded, in tilcdc_crtc_load_palette()
206 struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); in tilcdc_crtc_set_clk() local
252 tilcdc_crtc->lcd_fck_rate = clk_rate; in tilcdc_crtc_set_clk()
255 tilcdc_crtc->lcd_fck_rate, crtc->mode.clock, clkdiv); in tilcdc_crtc_set_clk()
275 struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); in tilcdc_crtc_set_mode() local
278 const struct tilcdc_panel_info *info = tilcdc_crtc->info; in tilcdc_crtc_set_mode()
439 tilcdc_crtc->hvtotal_us = in tilcdc_crtc_set_mode()
446 struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); in tilcdc_crtc_enable() local
449 mutex_lock(&tilcdc_crtc->enable_lock); in tilcdc_crtc_enable()
450 if (tilcdc_crtc->enabled || tilcdc_crtc->shutdown) { in tilcdc_crtc_enable()
451 mutex_unlock(&tilcdc_crtc->enable_lock); in tilcdc_crtc_enable()
474 spin_lock_irqsave(&tilcdc_crtc->irq_lock, flags); in tilcdc_crtc_enable()
475 tilcdc_crtc->last_vblank = ktime_get(); in tilcdc_crtc_enable()
477 spin_unlock_irqrestore(&tilcdc_crtc->irq_lock, flags); in tilcdc_crtc_enable()
481 tilcdc_crtc->enabled = true; in tilcdc_crtc_enable()
482 mutex_unlock(&tilcdc_crtc->enable_lock); in tilcdc_crtc_enable()
493 struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); in tilcdc_crtc_off() local
497 mutex_lock(&tilcdc_crtc->enable_lock); in tilcdc_crtc_off()
499 tilcdc_crtc->shutdown = true; in tilcdc_crtc_off()
500 if (!tilcdc_crtc->enabled) { in tilcdc_crtc_off()
501 mutex_unlock(&tilcdc_crtc->enable_lock); in tilcdc_crtc_off()
504 tilcdc_crtc->frame_done = false; in tilcdc_crtc_off()
511 ret = wait_event_timeout(tilcdc_crtc->frame_done_wq, in tilcdc_crtc_off()
512 tilcdc_crtc->frame_done, in tilcdc_crtc_off()
533 tilcdc_crtc->enabled = false; in tilcdc_crtc_off()
534 mutex_unlock(&tilcdc_crtc->enable_lock); in tilcdc_crtc_off()
572 struct tilcdc_crtc *tilcdc_crtc = in tilcdc_crtc_recover_work() local
573 container_of(work, struct tilcdc_crtc, recover_work); in tilcdc_crtc_recover_work()
574 struct drm_crtc *crtc = &tilcdc_crtc->base; in tilcdc_crtc_recover_work()
605 struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); in tilcdc_crtc_update_fb() local
608 if (tilcdc_crtc->event) { in tilcdc_crtc_update_fb()
613 tilcdc_crtc->event = event; in tilcdc_crtc_update_fb()
615 mutex_lock(&tilcdc_crtc->enable_lock); in tilcdc_crtc_update_fb()
617 if (tilcdc_crtc->enabled) { in tilcdc_crtc_update_fb()
622 spin_lock_irqsave(&tilcdc_crtc->irq_lock, flags); in tilcdc_crtc_update_fb()
624 next_vblank = ktime_add_us(tilcdc_crtc->last_vblank, in tilcdc_crtc_update_fb()
625 tilcdc_crtc->hvtotal_us); in tilcdc_crtc_update_fb()
629 tilcdc_crtc->next_fb = fb; in tilcdc_crtc_update_fb()
633 spin_unlock_irqrestore(&tilcdc_crtc->irq_lock, flags); in tilcdc_crtc_update_fb()
636 mutex_unlock(&tilcdc_crtc->enable_lock); in tilcdc_crtc_update_fb()
645 struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); in tilcdc_crtc_mode_fixup() local
647 if (!tilcdc_crtc->simulate_vesa_sync) in tilcdc_crtc_mode_fixup()
691 struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); in tilcdc_crtc_enable_vblank() local
696 spin_lock_irqsave(&tilcdc_crtc->irq_lock, flags); in tilcdc_crtc_enable_vblank()
707 spin_unlock_irqrestore(&tilcdc_crtc->irq_lock, flags); in tilcdc_crtc_enable_vblank()
714 struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); in tilcdc_crtc_disable_vblank() local
719 spin_lock_irqsave(&tilcdc_crtc->irq_lock, flags); in tilcdc_crtc_disable_vblank()
728 spin_unlock_irqrestore(&tilcdc_crtc->irq_lock, flags); in tilcdc_crtc_disable_vblank()
733 struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); in tilcdc_crtc_reset() local
746 tilcdc_crtc->frame_done = false; in tilcdc_crtc_reset()
749 ret = wait_event_timeout(tilcdc_crtc->frame_done_wq, in tilcdc_crtc_reset()
750 tilcdc_crtc->frame_done, in tilcdc_crtc_reset()
872 struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); in tilcdc_crtc_set_panel_info() local
873 tilcdc_crtc->info = info; in tilcdc_crtc_set_panel_info()
879 struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); in tilcdc_crtc_set_simulate_vesa_sync() local
881 tilcdc_crtc->simulate_vesa_sync = simulate_vesa_sync; in tilcdc_crtc_set_simulate_vesa_sync()
888 struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); in tilcdc_crtc_update_clk() local
891 if (tilcdc_crtc->lcd_fck_rate != clk_get_rate(priv->clk)) { in tilcdc_crtc_update_clk()
909 struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); in tilcdc_crtc_irq() local
923 spin_lock(&tilcdc_crtc->irq_lock); in tilcdc_crtc_irq()
925 tilcdc_crtc->last_vblank = now; in tilcdc_crtc_irq()
927 if (tilcdc_crtc->next_fb) { in tilcdc_crtc_irq()
928 set_scanout(crtc, tilcdc_crtc->next_fb); in tilcdc_crtc_irq()
929 tilcdc_crtc->next_fb = NULL; in tilcdc_crtc_irq()
933 spin_unlock(&tilcdc_crtc->irq_lock); in tilcdc_crtc_irq()
942 event = tilcdc_crtc->event; in tilcdc_crtc_irq()
943 tilcdc_crtc->event = NULL; in tilcdc_crtc_irq()
950 if (tilcdc_crtc->frame_intact) in tilcdc_crtc_irq()
951 tilcdc_crtc->sync_lost_count = 0; in tilcdc_crtc_irq()
953 tilcdc_crtc->frame_intact = true; in tilcdc_crtc_irq()
961 complete(&tilcdc_crtc->palette_loaded); in tilcdc_crtc_irq()
973 tilcdc_crtc->frame_intact = false; in tilcdc_crtc_irq()
983 if (tilcdc_crtc->sync_lost_count++ > in tilcdc_crtc_irq()
989 &tilcdc_crtc->recover_work); in tilcdc_crtc_irq()
992 tilcdc_crtc->sync_lost_count = 0; in tilcdc_crtc_irq()
998 tilcdc_crtc->frame_done = true; in tilcdc_crtc_irq()
999 wake_up(&tilcdc_crtc->frame_done_wq); in tilcdc_crtc_irq()
1020 struct tilcdc_crtc *tilcdc_crtc; in tilcdc_crtc_create() local
1024 tilcdc_crtc = devm_kzalloc(dev->dev, sizeof(*tilcdc_crtc), GFP_KERNEL); in tilcdc_crtc_create()
1025 if (!tilcdc_crtc) in tilcdc_crtc_create()
1028 init_completion(&tilcdc_crtc->palette_loaded); in tilcdc_crtc_create()
1029 tilcdc_crtc->palette_base = dmam_alloc_coherent(dev->dev, in tilcdc_crtc_create()
1031 &tilcdc_crtc->palette_dma_handle, in tilcdc_crtc_create()
1033 if (!tilcdc_crtc->palette_base) in tilcdc_crtc_create()
1035 *tilcdc_crtc->palette_base = TILCDC_PALETTE_FIRST_ENTRY; in tilcdc_crtc_create()
1037 crtc = &tilcdc_crtc->base; in tilcdc_crtc_create()
1039 ret = tilcdc_plane_init(dev, &tilcdc_crtc->primary); in tilcdc_crtc_create()
1043 mutex_init(&tilcdc_crtc->enable_lock); in tilcdc_crtc_create()
1045 init_waitqueue_head(&tilcdc_crtc->frame_done_wq); in tilcdc_crtc_create()
1047 spin_lock_init(&tilcdc_crtc->irq_lock); in tilcdc_crtc_create()
1048 INIT_WORK(&tilcdc_crtc->recover_work, tilcdc_crtc_recover_work); in tilcdc_crtc_create()
1051 &tilcdc_crtc->primary, in tilcdc_crtc_create()