Lines Matching full:dpu

131 static int dpu_wait_stop_done(struct sprd_dpu *dpu)  in dpu_wait_stop_done()  argument
133 struct dpu_context *ctx = &dpu->ctx; in dpu_wait_stop_done()
146 drm_err(dpu->drm, "dpu wait for stop done time out!\n"); in dpu_wait_stop_done()
153 static int dpu_wait_update_done(struct sprd_dpu *dpu) in dpu_wait_update_done() argument
155 struct dpu_context *ctx = &dpu->ctx; in dpu_wait_update_done()
164 drm_err(dpu->drm, "dpu wait for reg update done time out!\n"); in dpu_wait_update_done()
323 static void sprd_dpu_layer(struct sprd_dpu *dpu, struct drm_plane_state *state) in sprd_dpu_layer() argument
325 struct dpu_context *ctx = &dpu->ctx; in sprd_dpu_layer()
380 static void sprd_dpu_flip(struct sprd_dpu *dpu) in sprd_dpu_flip() argument
382 struct dpu_context *ctx = &dpu->ctx; in sprd_dpu_flip()
385 * Make sure the dpu is in stop status. DPU has no shadow in sprd_dpu_flip()
390 dpu_wait_stop_done(dpu); in sprd_dpu_flip()
396 dpu_wait_update_done(dpu); in sprd_dpu_flip()
407 static void sprd_dpu_init(struct sprd_dpu *dpu) in sprd_dpu_init() argument
409 struct dpu_context *ctx = &dpu->ctx; in sprd_dpu_init()
428 /* enable dpu update done INT */ in sprd_dpu_init()
430 /* enable dpu done INT */ in sprd_dpu_init()
432 /* enable dpu dpi vsync */ in sprd_dpu_init()
434 /* enable dpu TE INT */ in sprd_dpu_init()
455 static void sprd_dpu_fini(struct sprd_dpu *dpu) in sprd_dpu_fini() argument
457 struct dpu_context *ctx = &dpu->ctx; in sprd_dpu_fini()
463 static void sprd_dpi_init(struct sprd_dpu *dpu) in sprd_dpi_init() argument
465 struct dpu_context *ctx = &dpu->ctx; in sprd_dpi_init()
487 void sprd_dpu_run(struct sprd_dpu *dpu) in sprd_dpu_run() argument
489 struct dpu_context *ctx = &dpu->ctx; in sprd_dpu_run()
496 void sprd_dpu_stop(struct sprd_dpu *dpu) in sprd_dpu_stop() argument
498 struct dpu_context *ctx = &dpu->ctx; in sprd_dpu_stop()
503 dpu_wait_stop_done(dpu); in sprd_dpu_stop()
536 struct sprd_dpu *dpu = to_sprd_crtc(new_state->crtc); in sprd_plane_atomic_update() local
538 /* start configure dpu layers */ in sprd_plane_atomic_update()
539 sprd_dpu_layer(dpu, new_state); in sprd_plane_atomic_update()
547 struct sprd_dpu *dpu = to_sprd_crtc(old_state->crtc); in sprd_plane_atomic_disable() local
549 layer_reg_wr(&dpu->ctx, REG_LAY_CTRL, 0x00, old_state->zpos); in sprd_plane_atomic_disable()
621 struct sprd_dpu *dpu = to_sprd_crtc(crtc); in sprd_crtc_mode_set_nofb() local
626 drm_display_mode_to_videomode(mode, &dpu->ctx.vm); in sprd_crtc_mode_set_nofb()
633 dpu->ctx.if_type = SPRD_DPU_IF_DPI; in sprd_crtc_mode_set_nofb()
635 dpu->ctx.if_type = SPRD_DPU_IF_EDPI; in sprd_crtc_mode_set_nofb()
638 sprd_dpi_init(dpu); in sprd_crtc_mode_set_nofb()
644 struct sprd_dpu *dpu = to_sprd_crtc(crtc); in sprd_crtc_atomic_enable() local
646 sprd_dpu_init(dpu); in sprd_crtc_atomic_enable()
648 drm_crtc_vblank_on(&dpu->base); in sprd_crtc_atomic_enable()
654 struct sprd_dpu *dpu = to_sprd_crtc(crtc); in sprd_crtc_atomic_disable() local
655 struct drm_device *drm = dpu->base.dev; in sprd_crtc_atomic_disable()
657 drm_crtc_vblank_off(&dpu->base); in sprd_crtc_atomic_disable()
659 sprd_dpu_fini(dpu); in sprd_crtc_atomic_disable()
673 struct sprd_dpu *dpu = to_sprd_crtc(crtc); in sprd_crtc_atomic_flush() local
674 struct drm_device *drm = dpu->base.dev; in sprd_crtc_atomic_flush()
676 sprd_dpu_flip(dpu); in sprd_crtc_atomic_flush()
688 struct sprd_dpu *dpu = to_sprd_crtc(crtc); in sprd_crtc_enable_vblank() local
690 dpu_reg_set(&dpu->ctx, REG_DPU_INT_EN, BIT_DPU_INT_VSYNC); in sprd_crtc_enable_vblank()
697 struct sprd_dpu *dpu = to_sprd_crtc(crtc); in sprd_crtc_disable_vblank() local
699 dpu_reg_clr(&dpu->ctx, REG_DPU_INT_EN, BIT_DPU_INT_VSYNC); in sprd_crtc_disable_vblank()
724 struct sprd_dpu *dpu; in sprd_crtc_init() local
726 dpu = drmm_crtc_alloc_with_planes(drm, struct sprd_dpu, base, in sprd_crtc_init()
729 if (IS_ERR(dpu)) { in sprd_crtc_init()
731 return dpu; in sprd_crtc_init()
733 drm_crtc_helper_add(&dpu->base, &sprd_crtc_helper_funcs); in sprd_crtc_init()
744 dpu->base.port = port; in sprd_crtc_init()
747 return dpu; in sprd_crtc_init()
752 struct sprd_dpu *dpu = data; in sprd_dpu_isr() local
753 struct dpu_context *ctx = &dpu->ctx; in sprd_dpu_isr()
761 drm_warn(dpu->drm, "Warning: dpu underflow!\n"); in sprd_dpu_isr()
764 /* dpu update done isr */ in sprd_dpu_isr()
770 /* dpu stop done isr */ in sprd_dpu_isr()
777 drm_crtc_handle_vblank(&dpu->base); in sprd_dpu_isr()
785 static int sprd_dpu_context_init(struct sprd_dpu *dpu, in sprd_dpu_context_init() argument
789 struct dpu_context *ctx = &dpu->ctx; in sprd_dpu_context_init()
801 dev_err(dev, "failed to map dpu registers\n"); in sprd_dpu_context_init()
807 dev_err(dev, "failed to get dpu irq\n"); in sprd_dpu_context_init()
811 /* disable and clear interrupts before register dpu IRQ. */ in sprd_dpu_context_init()
816 IRQF_TRIGGER_NONE, "DPU", dpu); in sprd_dpu_context_init()
818 dev_err(dev, "failed to register dpu irq handler\n"); in sprd_dpu_context_init()
830 struct sprd_dpu *dpu; in sprd_dpu_bind() local
838 dpu = sprd_crtc_init(drm, &plane->base, dev); in sprd_dpu_bind()
839 if (IS_ERR(dpu)) in sprd_dpu_bind()
840 return PTR_ERR(dpu); in sprd_dpu_bind()
842 dpu->drm = drm; in sprd_dpu_bind()
843 dev_set_drvdata(dev, dpu); in sprd_dpu_bind()
845 ret = sprd_dpu_context_init(dpu, dev); in sprd_dpu_bind()
857 { .compatible = "sprd,sharkl3-dpu" },
878 .name = "sprd-dpu-drv",