Lines Matching refs:mdp4_crtc

16 struct mdp4_crtc {  struct
60 #define to_mdp4_crtc(x) container_of(x, struct mdp4_crtc, base) argument
70 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in request_pending() local
72 atomic_or(pending, &mdp4_crtc->pending); in request_pending()
73 mdp_irq_register(&get_kms(crtc)->base, &mdp4_crtc->vblank); in request_pending()
78 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in crtc_flush() local
88 flush |= ovlp2flush(mdp4_crtc->ovlp); in crtc_flush()
90 DBG("%s: flush=%08x", mdp4_crtc->name, flush); in crtc_flush()
92 mdp4_crtc->flushed_mask = flush; in crtc_flush()
100 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in complete_flip() local
106 event = mdp4_crtc->event; in complete_flip()
108 mdp4_crtc->event = NULL; in complete_flip()
109 DBG("%s: send event: %p", mdp4_crtc->name, event); in complete_flip()
117 struct mdp4_crtc *mdp4_crtc = in unref_cursor_worker() local
118 container_of(work, struct mdp4_crtc, unref_cursor_work); in unref_cursor_worker()
119 struct mdp4_kms *mdp4_kms = get_kms(&mdp4_crtc->base); in unref_cursor_worker()
128 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in mdp4_crtc_destroy() local
131 drm_flip_work_cleanup(&mdp4_crtc->unref_cursor_work); in mdp4_crtc_destroy()
133 kfree(mdp4_crtc); in mdp4_crtc_destroy()
163 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in setup_mixer() local
169 mixer_cfg = mixercfg(mixer_cfg, mdp4_crtc->mixer, in setup_mixer()
179 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in blend_setup() local
182 int i, ovlp = mdp4_crtc->ovlp; in blend_setup()
227 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in mdp4_crtc_mode_set_nofb() local
229 enum mdp4_dma dma = mdp4_crtc->dma; in mdp4_crtc_mode_set_nofb()
230 int ovlp = mdp4_crtc->ovlp; in mdp4_crtc_mode_set_nofb()
239 mdp4_crtc->name, DRM_MODE_ARG(mode)); in mdp4_crtc_mode_set_nofb()
270 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in mdp4_crtc_atomic_disable() local
273 DBG("%s", mdp4_crtc->name); in mdp4_crtc_atomic_disable()
275 if (WARN_ON(!mdp4_crtc->enabled)) in mdp4_crtc_atomic_disable()
281 mdp_irq_unregister(&mdp4_kms->base, &mdp4_crtc->err); in mdp4_crtc_atomic_disable()
284 mdp4_crtc->enabled = false; in mdp4_crtc_atomic_disable()
290 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in mdp4_crtc_atomic_enable() local
293 DBG("%s", mdp4_crtc->name); in mdp4_crtc_atomic_enable()
295 if (WARN_ON(mdp4_crtc->enabled)) in mdp4_crtc_atomic_enable()
303 mdp_irq_register(&mdp4_kms->base, &mdp4_crtc->err); in mdp4_crtc_atomic_enable()
307 mdp4_crtc->enabled = true; in mdp4_crtc_atomic_enable()
313 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in mdp4_crtc_atomic_check() local
314 DBG("%s: check", mdp4_crtc->name); in mdp4_crtc_atomic_check()
322 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in mdp4_crtc_atomic_begin() local
323 DBG("%s: begin", mdp4_crtc->name); in mdp4_crtc_atomic_begin()
329 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in mdp4_crtc_atomic_flush() local
333 DBG("%s: event: %p", mdp4_crtc->name, crtc->state->event); in mdp4_crtc_atomic_flush()
335 WARN_ON(mdp4_crtc->event); in mdp4_crtc_atomic_flush()
338 mdp4_crtc->event = crtc->state->event; in mdp4_crtc_atomic_flush()
357 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in update_cursor() local
360 enum mdp4_dma dma = mdp4_crtc->dma; in update_cursor()
363 spin_lock_irqsave(&mdp4_crtc->cursor.lock, flags); in update_cursor()
364 if (mdp4_crtc->cursor.stale) { in update_cursor()
365 struct drm_gem_object *next_bo = mdp4_crtc->cursor.next_bo; in update_cursor()
366 struct drm_gem_object *prev_bo = mdp4_crtc->cursor.scanout_bo; in update_cursor()
367 uint64_t iova = mdp4_crtc->cursor.next_iova; in update_cursor()
376 MDP4_DMA_CURSOR_SIZE_WIDTH(mdp4_crtc->cursor.width) | in update_cursor()
377 MDP4_DMA_CURSOR_SIZE_HEIGHT(mdp4_crtc->cursor.height)); in update_cursor()
390 drm_flip_work_queue(&mdp4_crtc->unref_cursor_work, prev_bo); in update_cursor()
392 mdp4_crtc->cursor.scanout_bo = next_bo; in update_cursor()
393 mdp4_crtc->cursor.stale = false; in update_cursor()
397 MDP4_DMA_CURSOR_POS_X(mdp4_crtc->cursor.x) | in update_cursor()
398 MDP4_DMA_CURSOR_POS_Y(mdp4_crtc->cursor.y)); in update_cursor()
400 spin_unlock_irqrestore(&mdp4_crtc->cursor.lock, flags); in update_cursor()
407 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in mdp4_crtc_cursor_set() local
437 spin_lock_irqsave(&mdp4_crtc->cursor.lock, flags); in mdp4_crtc_cursor_set()
438 old_bo = mdp4_crtc->cursor.next_bo; in mdp4_crtc_cursor_set()
439 mdp4_crtc->cursor.next_bo = cursor_bo; in mdp4_crtc_cursor_set()
440 mdp4_crtc->cursor.next_iova = iova; in mdp4_crtc_cursor_set()
441 mdp4_crtc->cursor.width = width; in mdp4_crtc_cursor_set()
442 mdp4_crtc->cursor.height = height; in mdp4_crtc_cursor_set()
443 mdp4_crtc->cursor.stale = true; in mdp4_crtc_cursor_set()
444 spin_unlock_irqrestore(&mdp4_crtc->cursor.lock, flags); in mdp4_crtc_cursor_set()
448 drm_flip_work_queue(&mdp4_crtc->unref_cursor_work, old_bo); in mdp4_crtc_cursor_set()
462 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in mdp4_crtc_cursor_move() local
465 spin_lock_irqsave(&mdp4_crtc->cursor.lock, flags); in mdp4_crtc_cursor_move()
466 mdp4_crtc->cursor.x = x; in mdp4_crtc_cursor_move()
467 mdp4_crtc->cursor.y = y; in mdp4_crtc_cursor_move()
468 spin_unlock_irqrestore(&mdp4_crtc->cursor.lock, flags); in mdp4_crtc_cursor_move()
500 struct mdp4_crtc *mdp4_crtc = container_of(irq, struct mdp4_crtc, vblank); in mdp4_crtc_vblank_irq() local
501 struct drm_crtc *crtc = &mdp4_crtc->base; in mdp4_crtc_vblank_irq()
505 mdp_irq_unregister(&get_kms(crtc)->base, &mdp4_crtc->vblank); in mdp4_crtc_vblank_irq()
507 pending = atomic_xchg(&mdp4_crtc->pending, 0); in mdp4_crtc_vblank_irq()
515 drm_flip_work_commit(&mdp4_crtc->unref_cursor_work, priv->wq); in mdp4_crtc_vblank_irq()
521 struct mdp4_crtc *mdp4_crtc = container_of(irq, struct mdp4_crtc, err); in mdp4_crtc_err_irq() local
522 struct drm_crtc *crtc = &mdp4_crtc->base; in mdp4_crtc_err_irq()
523 DBG("%s: error: %08x", mdp4_crtc->name, irqstatus); in mdp4_crtc_err_irq()
530 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in mdp4_crtc_wait_for_flush_done() local
540 mdp4_crtc->flushed_mask), in mdp4_crtc_wait_for_flush_done()
543 dev_warn(dev->dev, "vblank time out, crtc=%d\n", mdp4_crtc->id); in mdp4_crtc_wait_for_flush_done()
545 mdp4_crtc->flushed_mask = 0; in mdp4_crtc_wait_for_flush_done()
552 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in mdp4_crtc_vblank() local
553 return mdp4_crtc->vblank.irqmask; in mdp4_crtc_vblank()
559 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in mdp4_crtc_set_config() local
562 mdp4_write(mdp4_kms, REG_MDP4_DMA_CONFIG(mdp4_crtc->dma), config); in mdp4_crtc_set_config()
568 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in mdp4_crtc_set_intf() local
574 switch (mdp4_crtc->dma) { in mdp4_crtc_set_intf()
597 mdp4_crtc->mixer = mixer; in mdp4_crtc_set_intf()
601 DBG("%s: intf_sel=%08x", mdp4_crtc->name, intf_sel); in mdp4_crtc_set_intf()
625 struct mdp4_crtc *mdp4_crtc; in mdp4_crtc_init() local
627 mdp4_crtc = kzalloc(sizeof(*mdp4_crtc), GFP_KERNEL); in mdp4_crtc_init()
628 if (!mdp4_crtc) in mdp4_crtc_init()
631 crtc = &mdp4_crtc->base; in mdp4_crtc_init()
633 mdp4_crtc->id = id; in mdp4_crtc_init()
635 mdp4_crtc->ovlp = ovlp_id; in mdp4_crtc_init()
636 mdp4_crtc->dma = dma_id; in mdp4_crtc_init()
638 mdp4_crtc->vblank.irqmask = dma2irq(mdp4_crtc->dma); in mdp4_crtc_init()
639 mdp4_crtc->vblank.irq = mdp4_crtc_vblank_irq; in mdp4_crtc_init()
641 mdp4_crtc->err.irqmask = dma2err(mdp4_crtc->dma); in mdp4_crtc_init()
642 mdp4_crtc->err.irq = mdp4_crtc_err_irq; in mdp4_crtc_init()
644 snprintf(mdp4_crtc->name, sizeof(mdp4_crtc->name), "%s:%d", in mdp4_crtc_init()
647 spin_lock_init(&mdp4_crtc->cursor.lock); in mdp4_crtc_init()
649 drm_flip_work_init(&mdp4_crtc->unref_cursor_work, in mdp4_crtc_init()