Lines Matching refs:omap_crtc
27 #define to_omap_crtc(x) container_of(x, struct omap_crtc, base)
29 struct omap_crtc { struct
85 struct omap_crtc *omap_crtc = to_omap_crtc(crtc); in pipe2vbl() argument
87 return dispc_mgr_get_vsync_irq(omap_crtc->channel); in pipe2vbl()
92 struct omap_crtc *omap_crtc = to_omap_crtc(crtc); in omap_crtc_timings() local
93 return &omap_crtc->timings; in omap_crtc_timings()
98 struct omap_crtc *omap_crtc = to_omap_crtc(crtc); in omap_crtc_channel() local
99 return omap_crtc->channel; in omap_crtc_channel()
116 static struct omap_crtc *omap_crtcs[8];
149 struct omap_crtc *omap_crtc = to_omap_crtc(crtc); in omap_crtc_set_enabled() local
150 enum omap_channel channel = omap_crtc->channel; in omap_crtc_set_enabled()
158 if (omap_crtc->channel == OMAP_DSS_CHANNEL_DIGIT) { in omap_crtc_set_enabled()
163 omap_crtc->ignore_digit_sync_lost = true; in omap_crtc_set_enabled()
192 omap_crtc->name, enable ? "enable" : "disable"); in omap_crtc_set_enabled()
195 if (omap_crtc->channel == OMAP_DSS_CHANNEL_DIGIT) { in omap_crtc_set_enabled()
196 omap_crtc->ignore_digit_sync_lost = false; in omap_crtc_set_enabled()
205 struct omap_crtc *omap_crtc = omap_crtcs[mgr->id]; in omap_crtc_enable() local
207 dispc_mgr_setup(omap_crtc->channel, &omap_crtc->info); in omap_crtc_enable()
208 dispc_mgr_set_timings(omap_crtc->channel, in omap_crtc_enable()
209 &omap_crtc->timings); in omap_crtc_enable()
210 omap_crtc_set_enabled(&omap_crtc->base, true); in omap_crtc_enable()
217 struct omap_crtc *omap_crtc = omap_crtcs[mgr->id]; in omap_crtc_disable() local
219 omap_crtc_set_enabled(&omap_crtc->base, false); in omap_crtc_disable()
225 struct omap_crtc *omap_crtc = omap_crtcs[mgr->id]; in omap_crtc_set_timings() local
226 DBG("%s", omap_crtc->name); in omap_crtc_set_timings()
227 omap_crtc->timings = *timings; in omap_crtc_set_timings()
233 struct omap_crtc *omap_crtc = omap_crtcs[mgr->id]; in omap_crtc_set_lcd_config() local
234 DBG("%s", omap_crtc->name); in omap_crtc_set_lcd_config()
235 dispc_mgr_set_lcd_config(omap_crtc->channel, config); in omap_crtc_set_lcd_config()
269 struct omap_crtc *omap_crtc = in omap_crtc_error_irq() local
270 container_of(irq, struct omap_crtc, error_irq); in omap_crtc_error_irq()
272 if (omap_crtc->ignore_digit_sync_lost) { in omap_crtc_error_irq()
278 DRM_ERROR_RATELIMITED("%s: errors: %08x\n", omap_crtc->name, irqstatus); in omap_crtc_error_irq()
283 struct omap_crtc *omap_crtc = in omap_crtc_apply_irq() local
284 container_of(irq, struct omap_crtc, apply_irq); in omap_crtc_apply_irq()
285 struct drm_crtc *crtc = &omap_crtc->base; in omap_crtc_apply_irq()
287 if (!dispc_mgr_go_busy(omap_crtc->channel)) { in omap_crtc_apply_irq()
290 DBG("%s: apply done", omap_crtc->name); in omap_crtc_apply_irq()
291 __omap_irq_unregister(crtc->dev, &omap_crtc->apply_irq); in omap_crtc_apply_irq()
292 queue_work(priv->wq, &omap_crtc->apply_work); in omap_crtc_apply_irq()
298 struct omap_crtc *omap_crtc = in apply_worker() local
299 container_of(work, struct omap_crtc, apply_work); in apply_worker()
300 struct drm_crtc *crtc = &omap_crtc->base; in apply_worker()
317 if (omap_crtc->apply_irq.registered) in apply_worker()
322 &omap_crtc->pending_applies, pending_node) { in apply_worker()
327 need_apply = !list_empty(&omap_crtc->queued_applies); in apply_worker()
331 &omap_crtc->queued_applies, queued_node) { in apply_worker()
336 &omap_crtc->pending_applies); in apply_worker()
340 enum omap_channel channel = omap_crtc->channel; in apply_worker()
342 DBG("%s: GO", omap_crtc->name); in apply_worker()
346 omap_irq_register(dev, &omap_crtc->apply_irq); in apply_worker()
349 queue_work(priv->wq, &omap_crtc->apply_work); in apply_worker()
361 struct omap_crtc *omap_crtc = to_omap_crtc(crtc); in omap_crtc_apply() local
370 list_add_tail(&apply->queued_node, &omap_crtc->queued_applies); in omap_crtc_apply()
377 if (list_empty(&omap_crtc->pending_applies)) { in omap_crtc_apply()
379 queue_work(priv->wq, &omap_crtc->apply_work); in omap_crtc_apply()
387 struct omap_crtc *omap_crtc = in omap_crtc_pre_apply() local
388 container_of(apply, struct omap_crtc, apply); in omap_crtc_pre_apply()
389 struct drm_crtc *crtc = &omap_crtc->base; in omap_crtc_pre_apply()
394 DBG("%s: enabled=%d", omap_crtc->name, omap_crtc->enabled); in omap_crtc_pre_apply()
403 if (omap_crtc->current_encoder && encoder != omap_crtc->current_encoder) in omap_crtc_pre_apply()
404 omap_encoder_set_enabled(omap_crtc->current_encoder, false); in omap_crtc_pre_apply()
406 omap_crtc->current_encoder = encoder; in omap_crtc_pre_apply()
408 if (!omap_crtc->enabled) { in omap_crtc_pre_apply()
414 omap_encoder_update(encoder, omap_crtc->mgr, in omap_crtc_pre_apply()
415 &omap_crtc->timings); in omap_crtc_pre_apply()
428 struct omap_crtc *omap_crtc = to_omap_crtc(crtc); in omap_crtc_flush() local
431 while (!list_empty(&omap_crtc->pending_applies) || in omap_crtc_flush()
432 !list_empty(&omap_crtc->queued_applies) || in omap_crtc_flush()
433 omap_crtc->event || omap_crtc->old_fb) { in omap_crtc_flush()
451 struct omap_crtc *omap_crtc = to_omap_crtc(crtc); in omap_crtc_destroy() local
453 DBG("%s", omap_crtc->name); in omap_crtc_destroy()
455 WARN_ON(omap_crtc->apply_irq.registered); in omap_crtc_destroy()
456 omap_irq_unregister(crtc->dev, &omap_crtc->error_irq); in omap_crtc_destroy()
460 kfree(omap_crtc); in omap_crtc_destroy()
466 struct omap_crtc *omap_crtc = to_omap_crtc(crtc); in omap_crtc_dpms() local
470 DBG("%s: %d", omap_crtc->name, mode); in omap_crtc_dpms()
472 if (enabled != omap_crtc->enabled) { in omap_crtc_dpms()
473 omap_crtc->enabled = enabled; in omap_crtc_dpms()
474 omap_crtc_apply(crtc, &omap_crtc->apply); in omap_crtc_dpms()
498 struct omap_crtc *omap_crtc = to_omap_crtc(crtc); in omap_crtc_mode_set() local
503 omap_crtc->name, mode->base.id, mode->name, in omap_crtc_mode_set()
511 copy_timings_drm_to_omap(&omap_crtc->timings, mode); in omap_crtc_mode_set()
527 struct omap_crtc *omap_crtc = to_omap_crtc(crtc); in omap_crtc_prepare() local
528 DBG("%s", omap_crtc->name); in omap_crtc_prepare()
534 struct omap_crtc *omap_crtc = to_omap_crtc(crtc); in omap_crtc_commit() local
535 DBG("%s", omap_crtc->name); in omap_crtc_commit()
555 struct omap_crtc *omap_crtc = to_omap_crtc(crtc); in vblank_cb() local
562 if (omap_crtc->event) in vblank_cb()
563 drm_send_vblank_event(dev, omap_crtc->pipe, omap_crtc->event); in vblank_cb()
565 fb = omap_crtc->old_fb; in vblank_cb()
567 omap_crtc->event = NULL; in vblank_cb()
568 omap_crtc->old_fb = NULL; in vblank_cb()
578 struct omap_crtc *omap_crtc = in page_flip_worker() local
579 container_of(work, struct omap_crtc, page_flip_work); in page_flip_worker()
580 struct drm_crtc *crtc = &omap_crtc->base; in page_flip_worker()
598 struct omap_crtc *omap_crtc = to_omap_crtc(crtc); in page_flip_cb() local
602 queue_work(priv->wq, &omap_crtc->page_flip_work); in page_flip_cb()
611 struct omap_crtc *omap_crtc = to_omap_crtc(crtc); in omap_crtc_page_flip_locked() local
621 if (omap_crtc->old_fb) { in omap_crtc_page_flip_locked()
627 omap_crtc->event = event; in omap_crtc_page_flip_locked()
628 omap_crtc->old_fb = primary->fb = fb; in omap_crtc_page_flip_locked()
629 drm_framebuffer_reference(omap_crtc->old_fb); in omap_crtc_page_flip_locked()
701 struct omap_crtc *omap_crtc; in omap_crtc_init() local
707 omap_crtc = kzalloc(sizeof(*omap_crtc), GFP_KERNEL); in omap_crtc_init()
708 if (!omap_crtc) in omap_crtc_init()
711 crtc = &omap_crtc->base; in omap_crtc_init()
713 INIT_WORK(&omap_crtc->page_flip_work, page_flip_worker); in omap_crtc_init()
714 INIT_WORK(&omap_crtc->apply_work, apply_worker); in omap_crtc_init()
716 INIT_LIST_HEAD(&omap_crtc->pending_applies); in omap_crtc_init()
717 INIT_LIST_HEAD(&omap_crtc->queued_applies); in omap_crtc_init()
719 omap_crtc->apply.pre_apply = omap_crtc_pre_apply; in omap_crtc_init()
720 omap_crtc->apply.post_apply = omap_crtc_post_apply; in omap_crtc_init()
722 omap_crtc->channel = channel; in omap_crtc_init()
723 omap_crtc->name = channel_names[channel]; in omap_crtc_init()
724 omap_crtc->pipe = id; in omap_crtc_init()
726 omap_crtc->apply_irq.irqmask = pipe2vbl(crtc); in omap_crtc_init()
727 omap_crtc->apply_irq.irq = omap_crtc_apply_irq; in omap_crtc_init()
729 omap_crtc->error_irq.irqmask = in omap_crtc_init()
731 omap_crtc->error_irq.irq = omap_crtc_error_irq; in omap_crtc_init()
732 omap_irq_register(dev, &omap_crtc->error_irq); in omap_crtc_init()
735 omap_crtc->mgr = omap_dss_get_overlay_manager(channel); in omap_crtc_init()
738 info = &omap_crtc->info; in omap_crtc_init()
747 kfree(omap_crtc); in omap_crtc_init()
755 omap_crtcs[channel] = omap_crtc; in omap_crtc_init()