Lines Matching +full:de +full:- +full:interlacing
1 // SPDX-License-Identifier: GPL-2.0-only
28 * A note about interlacing. Let's consider HDMI 1920x1080i.
36 * This is how it is defined by CEA-861-D - line and pixel numbers are
42 * DE: ~~~|____________________________//__________________________
48 * DE: ~~~|____________________________//__________________________
57 * Odd frame, 563 total lines, VSYNC at line 543-548, pixel 1128.
58 * Even frame, 562 total lines, VSYNC at line 542-547, pixel 2448.
62 * vtotal = mode->crtc_vtotal + 1;
63 * vbackporch = mode->crtc_vsync_start - mode->crtc_vdisplay + 1;
64 * vhorizpos = mode->crtc_hsync_start - mode->crtc_htotal / 2
66 * vtotal = mode->crtc_vtotal;
67 * vbackporch = mode->crtc_vsync_start - mode->crtc_vdisplay;
68 * vhorizpos = mode->crtc_hsync_start;
70 * vfrontporch = mode->crtc_vtotal - mode->crtc_vsync_end;
84 while (regs->offset != ~0) { in armada_drm_crtc_update_regs()
85 void __iomem *reg = dcrtc->base + regs->offset; in armada_drm_crtc_update_regs()
88 val = regs->mask; in armada_drm_crtc_update_regs()
91 writel_relaxed(val | regs->val, reg); in armada_drm_crtc_update_regs()
100 dumb_ctrl = dcrtc->cfg_dumb_ctrl; in armada_drm_crtc_update()
109 * SPI usage. So leave it as-is unless in DUMB24_RGB888_0 mode. in armada_drm_crtc_update()
118 dcrtc->base + LCD_SPU_DUMB_CTRL); in armada_drm_crtc_update()
127 event = xchg(&crtc->state->event, NULL); in armada_drm_crtc_queue_state_event()
130 dcrtc->event = event; in armada_drm_crtc_queue_state_event()
136 struct drm_property_blob *blob = crtc->state->gamma_lut; in armada_drm_update_gamma()
137 void __iomem *base = drm_to_armada_crtc(crtc)->base; in armada_drm_update_gamma()
141 struct drm_color_lut *lut = blob->data; in armada_drm_update_gamma()
177 if (mode->vscan > 1) in armada_drm_crtc_mode_valid()
180 if (mode->flags & DRM_MODE_FLAG_DBLSCAN) in armada_drm_crtc_mode_valid()
183 if (mode->flags & DRM_MODE_FLAG_HSKEW) in armada_drm_crtc_mode_valid()
187 if (!dcrtc->variant->has_spu_adv_reg && in armada_drm_crtc_mode_valid()
188 mode->flags & DRM_MODE_FLAG_INTERLACE) in armada_drm_crtc_mode_valid()
191 if (mode->flags & (DRM_MODE_FLAG_BCAST | DRM_MODE_FLAG_PIXMUX | in armada_drm_crtc_mode_valid()
220 ret = dcrtc->variant->compute_clock(dcrtc, adj, NULL); in armada_drm_crtc_mode_fixup()
227 /* These are locked by dev->vbl_lock */
230 if (dcrtc->irq_ena & mask) { in armada_drm_crtc_disable_irq()
231 dcrtc->irq_ena &= ~mask; in armada_drm_crtc_disable_irq()
232 writel(dcrtc->irq_ena, dcrtc->base + LCD_SPU_IRQ_ENA); in armada_drm_crtc_disable_irq()
238 if ((dcrtc->irq_ena & mask) != mask) { in armada_drm_crtc_enable_irq()
239 dcrtc->irq_ena |= mask; in armada_drm_crtc_enable_irq()
240 writel(dcrtc->irq_ena, dcrtc->base + LCD_SPU_IRQ_ENA); in armada_drm_crtc_enable_irq()
241 if (readl_relaxed(dcrtc->base + LCD_SPU_IRQ_ISR) & mask) in armada_drm_crtc_enable_irq()
242 writel(0, dcrtc->base + LCD_SPU_IRQ_ISR); in armada_drm_crtc_enable_irq()
249 void __iomem *base = dcrtc->base; in armada_drm_crtc_irq()
252 DRM_ERROR("video underflow on crtc %u\n", dcrtc->num); in armada_drm_crtc_irq()
254 DRM_ERROR("graphics underflow on crtc %u\n", dcrtc->num); in armada_drm_crtc_irq()
257 drm_crtc_handle_vblank(&dcrtc->crtc); in armada_drm_crtc_irq()
259 spin_lock(&dcrtc->irq_lock); in armada_drm_crtc_irq()
260 if (stat & GRA_FRAME_IRQ && dcrtc->interlaced) { in armada_drm_crtc_irq()
264 writel_relaxed(dcrtc->v[i].spu_v_porch, base + LCD_SPU_V_PORCH); in armada_drm_crtc_irq()
265 writel_relaxed(dcrtc->v[i].spu_v_h_total, in armada_drm_crtc_irq()
270 val |= dcrtc->v[i].spu_adv_reg; in armada_drm_crtc_irq()
274 if (stat & dcrtc->irq_ena & DUMB_FRAMEDONE) { in armada_drm_crtc_irq()
275 if (dcrtc->update_pending) { in armada_drm_crtc_irq()
276 armada_drm_crtc_update_regs(dcrtc, dcrtc->regs); in armada_drm_crtc_irq()
277 dcrtc->update_pending = false; in armada_drm_crtc_irq()
279 if (dcrtc->cursor_update) { in armada_drm_crtc_irq()
280 writel_relaxed(dcrtc->cursor_hw_pos, in armada_drm_crtc_irq()
282 writel_relaxed(dcrtc->cursor_hw_sz, in armada_drm_crtc_irq()
288 dcrtc->cursor_update = false; in armada_drm_crtc_irq()
292 spin_unlock(&dcrtc->irq_lock); in armada_drm_crtc_irq()
294 if (stat & VSYNC_IRQ && !dcrtc->update_pending) { in armada_drm_crtc_irq()
295 event = xchg(&dcrtc->event, NULL); in armada_drm_crtc_irq()
297 spin_lock(&dcrtc->crtc.dev->event_lock); in armada_drm_crtc_irq()
298 drm_crtc_send_vblank_event(&dcrtc->crtc, event); in armada_drm_crtc_irq()
299 spin_unlock(&dcrtc->crtc.dev->event_lock); in armada_drm_crtc_irq()
300 drm_crtc_vblank_put(&dcrtc->crtc); in armada_drm_crtc_irq()
308 u32 v, stat = readl_relaxed(dcrtc->base + LCD_SPU_IRQ_ISR); in armada_drm_irq()
312 * is set. Writing has some other effect to acknowledge the IRQ - in armada_drm_irq()
315 writel_relaxed(0, dcrtc->base + LCD_SPU_IRQ_ISR); in armada_drm_irq()
317 trace_armada_drm_irq(&dcrtc->crtc, stat); in armada_drm_irq()
320 v = stat & dcrtc->irq_ena; in armada_drm_irq()
332 struct drm_display_mode *adj = &crtc->state->adjusted_mode; in armada_drm_crtc_mode_set_nofb()
338 bool interlaced = !!(adj->flags & DRM_MODE_FLAG_INTERLACE); in armada_drm_crtc_mode_set_nofb()
341 rm = adj->crtc_hsync_start - adj->crtc_hdisplay; in armada_drm_crtc_mode_set_nofb()
342 lm = adj->crtc_htotal - adj->crtc_hsync_end; in armada_drm_crtc_mode_set_nofb()
343 bm = adj->crtc_vsync_start - adj->crtc_vdisplay; in armada_drm_crtc_mode_set_nofb()
344 tm = adj->crtc_vtotal - adj->crtc_vsync_end; in armada_drm_crtc_mode_set_nofb()
347 crtc->base.id, crtc->name, DRM_MODE_ARG(adj)); in armada_drm_crtc_mode_set_nofb()
351 dcrtc->variant->compute_clock(dcrtc, adj, &sclk); in armada_drm_crtc_mode_set_nofb()
355 spin_lock_irqsave(&dcrtc->irq_lock, flags); in armada_drm_crtc_mode_set_nofb()
357 dcrtc->interlaced = interlaced; in armada_drm_crtc_mode_set_nofb()
359 dcrtc->v[1].spu_v_h_total = adj->crtc_vtotal << 16 | in armada_drm_crtc_mode_set_nofb()
360 adj->crtc_htotal; in armada_drm_crtc_mode_set_nofb()
361 dcrtc->v[1].spu_v_porch = tm << 16 | bm; in armada_drm_crtc_mode_set_nofb()
362 val = adj->crtc_hsync_start; in armada_drm_crtc_mode_set_nofb()
363 dcrtc->v[1].spu_adv_reg = val << 20 | val | ADV_VSYNCOFFEN; in armada_drm_crtc_mode_set_nofb()
367 val -= adj->crtc_htotal / 2; in armada_drm_crtc_mode_set_nofb()
368 dcrtc->v[0].spu_adv_reg = val << 20 | val | ADV_VSYNCOFFEN; in armada_drm_crtc_mode_set_nofb()
369 dcrtc->v[0].spu_v_h_total = dcrtc->v[1].spu_v_h_total + in armada_drm_crtc_mode_set_nofb()
371 dcrtc->v[0].spu_v_porch = dcrtc->v[1].spu_v_porch + 1; in armada_drm_crtc_mode_set_nofb()
373 dcrtc->v[0] = dcrtc->v[1]; in armada_drm_crtc_mode_set_nofb()
376 val = adj->crtc_vdisplay << 16 | adj->crtc_hdisplay; in armada_drm_crtc_mode_set_nofb()
380 armada_reg_queue_set(regs, i, dcrtc->v[0].spu_v_porch, LCD_SPU_V_PORCH); in armada_drm_crtc_mode_set_nofb()
381 armada_reg_queue_set(regs, i, dcrtc->v[0].spu_v_h_total, in armada_drm_crtc_mode_set_nofb()
384 if (dcrtc->variant->has_spu_adv_reg) in armada_drm_crtc_mode_set_nofb()
385 armada_reg_queue_mod(regs, i, dcrtc->v[0].spu_adv_reg, in armada_drm_crtc_mode_set_nofb()
389 val = adj->flags & DRM_MODE_FLAG_NVSYNC ? CFG_VSYNC_INV : 0; in armada_drm_crtc_mode_set_nofb()
397 * The non-inverted state of the sync signals is active high. in armada_drm_crtc_mode_set_nofb()
401 if (adj->flags & DRM_MODE_FLAG_NCSYNC) in armada_drm_crtc_mode_set_nofb()
403 if (adj->flags & DRM_MODE_FLAG_NHSYNC) in armada_drm_crtc_mode_set_nofb()
405 if (adj->flags & DRM_MODE_FLAG_NVSYNC) in armada_drm_crtc_mode_set_nofb()
412 spin_unlock_irqrestore(&dcrtc->irq_lock, flags); in armada_drm_crtc_mode_set_nofb()
420 DRM_DEBUG_KMS("[CRTC:%d:%s]\n", crtc->base.id, crtc->name); in armada_drm_crtc_atomic_check()
422 if (crtc_state->gamma_lut && drm_color_lut_size(crtc_state->gamma_lut) != 256) in armada_drm_crtc_atomic_check()
423 return -EINVAL; in armada_drm_crtc_atomic_check()
425 if (crtc_state->color_mgmt_changed) in armada_drm_crtc_atomic_check()
426 crtc_state->planes_changed = true; in armada_drm_crtc_atomic_check()
438 DRM_DEBUG_KMS("[CRTC:%d:%s]\n", crtc->base.id, crtc->name); in armada_drm_crtc_atomic_begin()
440 if (crtc_state->color_mgmt_changed) in armada_drm_crtc_atomic_begin()
443 dcrtc->regs_idx = 0; in armada_drm_crtc_atomic_begin()
444 dcrtc->regs = dcrtc->atomic_regs; in armada_drm_crtc_atomic_begin()
454 DRM_DEBUG_KMS("[CRTC:%d:%s]\n", crtc->base.id, crtc->name); in armada_drm_crtc_atomic_flush()
456 armada_reg_queue_end(dcrtc->regs, dcrtc->regs_idx); in armada_drm_crtc_atomic_flush()
463 dcrtc->update_pending = true; in armada_drm_crtc_atomic_flush()
465 spin_lock_irq(&dcrtc->irq_lock); in armada_drm_crtc_atomic_flush()
467 spin_unlock_irq(&dcrtc->irq_lock); in armada_drm_crtc_atomic_flush()
469 spin_lock_irq(&dcrtc->irq_lock); in armada_drm_crtc_atomic_flush()
470 armada_drm_crtc_update_regs(dcrtc, dcrtc->regs); in armada_drm_crtc_atomic_flush()
471 spin_unlock_irq(&dcrtc->irq_lock); in armada_drm_crtc_atomic_flush()
483 DRM_DEBUG_KMS("[CRTC:%d:%s]\n", crtc->base.id, crtc->name); in armada_drm_crtc_atomic_disable()
485 if (old_state->adjusted_mode.flags & DRM_MODE_FLAG_INTERLACE) in armada_drm_crtc_atomic_disable()
491 if (!crtc->state->active) { in armada_drm_crtc_atomic_disable()
496 if (dcrtc->variant->disable) in armada_drm_crtc_atomic_disable()
497 dcrtc->variant->disable(dcrtc); in armada_drm_crtc_atomic_disable()
503 event = crtc->state->event; in armada_drm_crtc_atomic_disable()
504 crtc->state->event = NULL; in armada_drm_crtc_atomic_disable()
506 spin_lock_irq(&crtc->dev->event_lock); in armada_drm_crtc_atomic_disable()
508 spin_unlock_irq(&crtc->dev->event_lock); in armada_drm_crtc_atomic_disable()
520 DRM_DEBUG_KMS("[CRTC:%d:%s]\n", crtc->base.id, crtc->name); in armada_drm_crtc_atomic_enable()
522 if (!old_state->active) { in armada_drm_crtc_atomic_enable()
525 * been disabled. Reverse the call to ->disable in in armada_drm_crtc_atomic_enable()
528 if (dcrtc->variant->enable) in armada_drm_crtc_atomic_enable()
529 dcrtc->variant->enable(dcrtc, &crtc->state->adjusted_mode); in armada_drm_crtc_atomic_enable()
534 if (crtc->state->adjusted_mode.flags & DRM_MODE_FLAG_INTERLACE) in armada_drm_crtc_atomic_enable()
604 uint32_t xoff, xscr, w = dcrtc->cursor_w, s; in armada_drm_crtc_cursor_update()
605 uint32_t yoff, yscr, h = dcrtc->cursor_h; in armada_drm_crtc_cursor_update()
612 if (dcrtc->cursor_x < 0) { in armada_drm_crtc_cursor_update()
613 xoff = -dcrtc->cursor_x; in armada_drm_crtc_cursor_update()
615 w -= min(xoff, w); in armada_drm_crtc_cursor_update()
616 } else if (dcrtc->cursor_x + w > dcrtc->crtc.mode.hdisplay) { in armada_drm_crtc_cursor_update()
618 xscr = dcrtc->cursor_x; in armada_drm_crtc_cursor_update()
619 w = max_t(int, dcrtc->crtc.mode.hdisplay - dcrtc->cursor_x, 0); in armada_drm_crtc_cursor_update()
622 xscr = dcrtc->cursor_x; in armada_drm_crtc_cursor_update()
625 if (dcrtc->cursor_y < 0) { in armada_drm_crtc_cursor_update()
626 yoff = -dcrtc->cursor_y; in armada_drm_crtc_cursor_update()
628 h -= min(yoff, h); in armada_drm_crtc_cursor_update()
629 } else if (dcrtc->cursor_y + h > dcrtc->crtc.mode.vdisplay) { in armada_drm_crtc_cursor_update()
631 yscr = dcrtc->cursor_y; in armada_drm_crtc_cursor_update()
632 h = max_t(int, dcrtc->crtc.mode.vdisplay - dcrtc->cursor_y, 0); in armada_drm_crtc_cursor_update()
635 yscr = dcrtc->cursor_y; in armada_drm_crtc_cursor_update()
639 s = dcrtc->cursor_w; in armada_drm_crtc_cursor_update()
640 if (dcrtc->interlaced) { in armada_drm_crtc_cursor_update()
646 if (!dcrtc->cursor_obj || !h || !w) { in armada_drm_crtc_cursor_update()
647 spin_lock_irq(&dcrtc->irq_lock); in armada_drm_crtc_cursor_update()
648 dcrtc->cursor_update = false; in armada_drm_crtc_cursor_update()
649 armada_updatel(0, CFG_HWC_ENA, dcrtc->base + LCD_SPU_DMA_CTRL0); in armada_drm_crtc_cursor_update()
650 spin_unlock_irq(&dcrtc->irq_lock); in armada_drm_crtc_cursor_update()
654 spin_lock_irq(&dcrtc->irq_lock); in armada_drm_crtc_cursor_update()
655 para1 = readl_relaxed(dcrtc->base + LCD_SPU_SRAM_PARA1); in armada_drm_crtc_cursor_update()
657 dcrtc->base + LCD_SPU_SRAM_PARA1); in armada_drm_crtc_cursor_update()
658 spin_unlock_irq(&dcrtc->irq_lock); in armada_drm_crtc_cursor_update()
665 armada_drm_crtc_cursor_tran(dcrtc->base); in armada_drm_crtc_cursor_update()
669 if (dcrtc->cursor_hw_sz != (h << 16 | w)) { in armada_drm_crtc_cursor_update()
670 spin_lock_irq(&dcrtc->irq_lock); in armada_drm_crtc_cursor_update()
671 dcrtc->cursor_update = false; in armada_drm_crtc_cursor_update()
672 armada_updatel(0, CFG_HWC_ENA, dcrtc->base + LCD_SPU_DMA_CTRL0); in armada_drm_crtc_cursor_update()
673 spin_unlock_irq(&dcrtc->irq_lock); in armada_drm_crtc_cursor_update()
677 struct armada_gem_object *obj = dcrtc->cursor_obj; in armada_drm_crtc_cursor_update()
679 /* Set the top-left corner of the cursor image */ in armada_drm_crtc_cursor_update()
680 pix = obj->addr; in armada_drm_crtc_cursor_update()
682 armada_load_cursor_argb(dcrtc->base, pix, s, w, h); in armada_drm_crtc_cursor_update()
686 spin_lock_irq(&dcrtc->irq_lock); in armada_drm_crtc_cursor_update()
687 dcrtc->cursor_hw_pos = yscr << 16 | xscr; in armada_drm_crtc_cursor_update()
688 dcrtc->cursor_hw_sz = h << 16 | w; in armada_drm_crtc_cursor_update()
689 dcrtc->cursor_update = true; in armada_drm_crtc_cursor_update()
691 spin_unlock_irq(&dcrtc->irq_lock); in armada_drm_crtc_cursor_update()
709 if (!dcrtc->variant->has_spu_adv_reg) in armada_drm_crtc_cursor_set()
710 return -ENXIO; in armada_drm_crtc_cursor_set()
715 return -ENOMEM; in armada_drm_crtc_cursor_set()
719 return -ENOENT; in armada_drm_crtc_cursor_set()
721 /* Must be a kernel-mapped object */ in armada_drm_crtc_cursor_set()
722 if (!obj->addr) { in armada_drm_crtc_cursor_set()
723 drm_gem_object_put(&obj->obj); in armada_drm_crtc_cursor_set()
724 return -EINVAL; in armada_drm_crtc_cursor_set()
727 if (obj->obj.size < w * h * 4) { in armada_drm_crtc_cursor_set()
729 drm_gem_object_put(&obj->obj); in armada_drm_crtc_cursor_set()
730 return -ENOMEM; in armada_drm_crtc_cursor_set()
734 if (dcrtc->cursor_obj) { in armada_drm_crtc_cursor_set()
735 dcrtc->cursor_obj->update = NULL; in armada_drm_crtc_cursor_set()
736 dcrtc->cursor_obj->update_data = NULL; in armada_drm_crtc_cursor_set()
737 drm_gem_object_put(&dcrtc->cursor_obj->obj); in armada_drm_crtc_cursor_set()
739 dcrtc->cursor_obj = obj; in armada_drm_crtc_cursor_set()
740 dcrtc->cursor_w = w; in armada_drm_crtc_cursor_set()
741 dcrtc->cursor_h = h; in armada_drm_crtc_cursor_set()
744 obj->update_data = dcrtc; in armada_drm_crtc_cursor_set()
745 obj->update = cursor_update; in armada_drm_crtc_cursor_set()
757 if (!dcrtc->variant->has_spu_adv_reg) in armada_drm_crtc_cursor_move()
758 return -EFAULT; in armada_drm_crtc_cursor_move()
760 dcrtc->cursor_x = x; in armada_drm_crtc_cursor_move()
761 dcrtc->cursor_y = y; in armada_drm_crtc_cursor_move()
770 struct armada_private *priv = drm_to_armada_dev(crtc->dev); in armada_drm_crtc_destroy()
772 if (dcrtc->cursor_obj) in armada_drm_crtc_destroy()
773 drm_gem_object_put(&dcrtc->cursor_obj->obj); in armada_drm_crtc_destroy()
775 priv->dcrtc[dcrtc->num] = NULL; in armada_drm_crtc_destroy()
776 drm_crtc_cleanup(&dcrtc->crtc); in armada_drm_crtc_destroy()
778 if (dcrtc->variant->disable) in armada_drm_crtc_destroy()
779 dcrtc->variant->disable(dcrtc); in armada_drm_crtc_destroy()
781 writel_relaxed(0, dcrtc->base + LCD_SPU_IRQ_ENA); in armada_drm_crtc_destroy()
783 of_node_put(dcrtc->crtc.port); in armada_drm_crtc_destroy()
802 spin_lock_irqsave(&dcrtc->irq_lock, flags); in armada_drm_crtc_enable_vblank()
804 spin_unlock_irqrestore(&dcrtc->irq_lock, flags); in armada_drm_crtc_enable_vblank()
813 spin_lock_irqsave(&dcrtc->irq_lock, flags); in armada_drm_crtc_disable_vblank()
815 spin_unlock_irqrestore(&dcrtc->irq_lock, flags); in armada_drm_crtc_disable_vblank()
848 dcrtc->crtc.base.id, dcrtc->crtc.name, desired_hz); in armada_crtc_select_clock()
855 if (params->settable & BIT(i)) { in armada_crtc_select_clock()
870 /* Calculate the divider - if invalid, we can't do this rate */ in armada_crtc_select_clock()
872 if (div == 0 || div > params->div_max) in armada_crtc_select_clock()
875 /* Calculate the actual rate - HDMI requires -0.6%..+0.5% */ in armada_crtc_select_clock()
879 dcrtc->crtc.base.id, dcrtc->crtc.name, in armada_crtc_select_clock()
885 if (permillage < params->permillage_min) in armada_crtc_select_clock()
889 if (permillage > params->permillage_max) in armada_crtc_select_clock()
895 return -ERANGE; in armada_crtc_select_clock()
899 dcrtc->crtc.base.id, dcrtc->crtc.name, in armada_crtc_select_clock()
902 res->desired_clk_hz = desired_clk_hz; in armada_crtc_select_clock()
903 res->clk = clk; in armada_crtc_select_clock()
904 res->div = div; in armada_crtc_select_clock()
926 return -ENOMEM; in armada_drm_crtc_create()
929 if (dev != drm->dev) in armada_drm_crtc_create()
932 dcrtc->variant = variant; in armada_drm_crtc_create()
933 dcrtc->base = base; in armada_drm_crtc_create()
934 dcrtc->num = drm->mode_config.num_crtc; in armada_drm_crtc_create()
935 dcrtc->cfg_dumb_ctrl = DUMB24_RGB888_0; in armada_drm_crtc_create()
936 dcrtc->spu_iopad_ctrl = CFG_VSCALE_LN_EN | CFG_IOPAD_DUMB24; in armada_drm_crtc_create()
937 spin_lock_init(&dcrtc->irq_lock); in armada_drm_crtc_create()
938 dcrtc->irq_ena = CLEAN_SPU_IRQ_ISR; in armada_drm_crtc_create()
941 writel_relaxed(0x00000001, dcrtc->base + LCD_CFG_SCLK_DIV); in armada_drm_crtc_create()
942 writel_relaxed(0x00000000, dcrtc->base + LCD_SPU_BLANKCOLOR); in armada_drm_crtc_create()
943 writel_relaxed(dcrtc->spu_iopad_ctrl, in armada_drm_crtc_create()
944 dcrtc->base + LCD_SPU_IOPAD_CONTROL); in armada_drm_crtc_create()
945 writel_relaxed(0x00000000, dcrtc->base + LCD_SPU_SRAM_PARA0); in armada_drm_crtc_create()
948 CFG_PDWN64x66, dcrtc->base + LCD_SPU_SRAM_PARA1); in armada_drm_crtc_create()
949 writel_relaxed(0x2032ff81, dcrtc->base + LCD_SPU_DMA_CTRL1); in armada_drm_crtc_create()
950 writel_relaxed(dcrtc->irq_ena, dcrtc->base + LCD_SPU_IRQ_ENA); in armada_drm_crtc_create()
951 readl_relaxed(dcrtc->base + LCD_SPU_IRQ_ISR); in armada_drm_crtc_create()
952 writel_relaxed(0, dcrtc->base + LCD_SPU_IRQ_ISR); in armada_drm_crtc_create()
959 if (dcrtc->variant->init) { in armada_drm_crtc_create()
960 ret = dcrtc->variant->init(dcrtc, dev); in armada_drm_crtc_create()
966 armada_updatel(CFG_ARBFAST_ENA, 0, dcrtc->base + LCD_SPU_DMA_CTRL0); in armada_drm_crtc_create()
968 priv->dcrtc[dcrtc->num] = dcrtc; in armada_drm_crtc_create()
970 dcrtc->crtc.port = port; in armada_drm_crtc_create()
974 ret = -ENOMEM; in armada_drm_crtc_create()
984 ret = drm_crtc_init_with_planes(drm, &dcrtc->crtc, primary, NULL, in armada_drm_crtc_create()
989 drm_crtc_helper_add(&dcrtc->crtc, &armada_crtc_helper_funcs); in armada_drm_crtc_create()
991 ret = drm_mode_crtc_set_gamma_size(&dcrtc->crtc, 256); in armada_drm_crtc_create()
995 drm_crtc_enable_color_mgmt(&dcrtc->crtc, 0, false, 256); in armada_drm_crtc_create()
997 return armada_overlay_plane_create(drm, 1 << dcrtc->num); in armada_drm_crtc_create()
1000 primary->funcs->destroy(primary); in armada_drm_crtc_create()
1016 struct device_node *np, *parent = dev->of_node; in armada_lcd_bind()
1024 return -ENXIO; in armada_lcd_bind()
1034 return -ENXIO; in armada_lcd_bind()
1046 armada_drm_crtc_destroy(&dcrtc->crtc); in armada_lcd_unbind()
1056 return component_add(&pdev->dev, &armada_lcd_ops); in armada_lcd_probe()
1061 component_del(&pdev->dev, &armada_lcd_ops); in armada_lcd_remove()
1066 .compatible = "marvell,dove-lcd",
1075 .name = "armada-lcd",
1078 .name = "armada-510-lcd",
1089 .name = "armada-lcd",