Lines Matching refs:hvs

70 void vc4_hvs_dump_state(struct vc4_hvs *hvs)  in vc4_hvs_dump_state()  argument
72 struct drm_device *drm = &hvs->vc4->base; in vc4_hvs_dump_state()
73 struct drm_printer p = drm_info_printer(&hvs->pdev->dev); in vc4_hvs_dump_state()
79 drm_print_regset32(&p, &hvs->regset); in vc4_hvs_dump_state()
85 readl((u32 __iomem *)hvs->dlist + i + 0), in vc4_hvs_dump_state()
86 readl((u32 __iomem *)hvs->dlist + i + 1), in vc4_hvs_dump_state()
87 readl((u32 __iomem *)hvs->dlist + i + 2), in vc4_hvs_dump_state()
88 readl((u32 __iomem *)hvs->dlist + i + 3)); in vc4_hvs_dump_state()
111 struct vc4_hvs *hvs = vc4->hvs; in vc4_hvs_debugfs_dlist() local
129 dlist_word = readl((u32 __iomem *)vc4->hvs->dlist + j); in vc4_hvs_debugfs_dlist()
180 static int vc4_hvs_upload_linear_kernel(struct vc4_hvs *hvs, in vc4_hvs_upload_linear_kernel() argument
192 ret = drm_mm_insert_node(&hvs->dlist_mm, space, VC4_KERNEL_DWORDS); in vc4_hvs_upload_linear_kernel()
194 drm_err(&hvs->vc4->base, "Failed to allocate space for filter kernel: %d\n", in vc4_hvs_upload_linear_kernel()
199 dst_kernel = hvs->dlist + space->start; in vc4_hvs_upload_linear_kernel()
213 static void vc4_hvs_lut_load(struct vc4_hvs *hvs, in vc4_hvs_lut_load() argument
216 struct drm_device *drm = &hvs->vc4->base; in vc4_hvs_lut_load()
243 static void vc4_hvs_update_gamma_lut(struct vc4_hvs *hvs, in vc4_hvs_update_gamma_lut() argument
257 vc4_hvs_lut_load(hvs, vc4_crtc); in vc4_hvs_update_gamma_lut()
260 u8 vc4_hvs_get_fifo_frame_count(struct vc4_hvs *hvs, unsigned int fifo) in vc4_hvs_get_fifo_frame_count() argument
262 struct drm_device *drm = &hvs->vc4->base; in vc4_hvs_get_fifo_frame_count()
288 int vc4_hvs_get_fifo_from_output(struct vc4_hvs *hvs, unsigned int output) in vc4_hvs_get_fifo_from_output() argument
290 struct vc4_dev *vc4 = hvs->vc4; in vc4_hvs_get_fifo_from_output()
347 static int vc4_hvs_init_channel(struct vc4_hvs *hvs, struct drm_crtc *crtc, in vc4_hvs_init_channel() argument
350 struct vc4_dev *vc4 = hvs->vc4; in vc4_hvs_init_channel()
403 vc4_hvs_lut_load(hvs, vc4_crtc); in vc4_hvs_init_channel()
410 void vc4_hvs_stop_channel(struct vc4_hvs *hvs, unsigned int chan) in vc4_hvs_stop_channel() argument
412 struct drm_device *drm = &hvs->vc4->base; in vc4_hvs_stop_channel()
464 spin_lock_irqsave(&vc4->hvs->mm_lock, flags); in vc4_hvs_atomic_check()
465 ret = drm_mm_insert_node(&vc4->hvs->dlist_mm, &vc4_state->mm, in vc4_hvs_atomic_check()
467 spin_unlock_irqrestore(&vc4->hvs->mm_lock, flags); in vc4_hvs_atomic_check()
478 struct vc4_hvs *hvs = vc4->hvs; in vc4_hvs_install_dlist() local
541 vc4_hvs_init_channel(vc4->hvs, crtc, mode, oneshot); in vc4_hvs_atomic_enable()
553 vc4_hvs_stop_channel(vc4->hvs, chan); in vc4_hvs_atomic_disable()
563 struct vc4_hvs *hvs = vc4->hvs; in vc4_hvs_atomic_flush() local
571 u32 __iomem *dlist_start = vc4->hvs->dlist + vc4_state->mm.start; in vc4_hvs_atomic_flush()
587 vc4_hvs_dump_state(hvs); in vc4_hvs_atomic_flush()
649 vc4_hvs_update_gamma_lut(hvs, vc4_crtc); in vc4_hvs_atomic_flush()
663 vc4_hvs_dump_state(hvs); in vc4_hvs_atomic_flush()
669 void vc4_hvs_mask_underrun(struct vc4_hvs *hvs, int channel) in vc4_hvs_mask_underrun() argument
671 struct drm_device *drm = &hvs->vc4->base; in vc4_hvs_mask_underrun()
679 dispctrl &= ~(hvs->vc4->is_vc5 ? SCALER5_DISPCTRL_DSPEISLUR(channel) : in vc4_hvs_mask_underrun()
687 void vc4_hvs_unmask_underrun(struct vc4_hvs *hvs, int channel) in vc4_hvs_unmask_underrun() argument
689 struct drm_device *drm = &hvs->vc4->base; in vc4_hvs_unmask_underrun()
697 dispctrl |= (hvs->vc4->is_vc5 ? SCALER5_DISPCTRL_DSPEISLUR(channel) : in vc4_hvs_unmask_underrun()
719 struct vc4_hvs *hvs = vc4->hvs; in vc4_hvs_irq_handler() local
746 vc4_hvs_mask_underrun(hvs, channel); in vc4_hvs_irq_handler()
765 struct vc4_hvs *hvs = vc4->hvs; in vc4_hvs_debugfs_init() local
767 if (!vc4->hvs) in vc4_hvs_debugfs_init()
779 vc4_debugfs_add_regset32(drm, "hvs_regs", &hvs->regset); in vc4_hvs_debugfs_init()
787 struct vc4_hvs *hvs; in __vc4_hvs_alloc() local
789 hvs = drmm_kzalloc(drm, sizeof(*hvs), GFP_KERNEL); in __vc4_hvs_alloc()
790 if (!hvs) in __vc4_hvs_alloc()
793 hvs->vc4 = vc4; in __vc4_hvs_alloc()
794 hvs->pdev = pdev; in __vc4_hvs_alloc()
796 spin_lock_init(&hvs->mm_lock); in __vc4_hvs_alloc()
803 drm_mm_init(&hvs->dlist_mm, in __vc4_hvs_alloc()
814 drm_mm_init(&hvs->lbm_mm, 0, 48 * 1024); in __vc4_hvs_alloc()
817 drm_mm_init(&hvs->lbm_mm, 0, 60 * 1024); in __vc4_hvs_alloc()
819 vc4->hvs = hvs; in __vc4_hvs_alloc()
821 return hvs; in __vc4_hvs_alloc()
829 struct vc4_hvs *hvs = NULL; in vc4_hvs_bind() local
834 hvs = __vc4_hvs_alloc(vc4, NULL); in vc4_hvs_bind()
835 if (IS_ERR(hvs)) in vc4_hvs_bind()
836 return PTR_ERR(hvs); in vc4_hvs_bind()
838 hvs->regs = vc4_ioremap_regs(pdev, 0); in vc4_hvs_bind()
839 if (IS_ERR(hvs->regs)) in vc4_hvs_bind()
840 return PTR_ERR(hvs->regs); in vc4_hvs_bind()
842 hvs->regset.base = hvs->regs; in vc4_hvs_bind()
843 hvs->regset.regs = hvs_regs; in vc4_hvs_bind()
844 hvs->regset.nregs = ARRAY_SIZE(hvs_regs); in vc4_hvs_bind()
860 hvs->core_clk = devm_clk_get(&pdev->dev, NULL); in vc4_hvs_bind()
861 if (IS_ERR(hvs->core_clk)) { in vc4_hvs_bind()
863 return PTR_ERR(hvs->core_clk); in vc4_hvs_bind()
870 hvs->vc5_hdmi_enable_hdmi_20 = true; in vc4_hvs_bind()
873 hvs->vc5_hdmi_enable_4096by2160 = true; in vc4_hvs_bind()
875 hvs->max_core_rate = max_rate; in vc4_hvs_bind()
877 ret = clk_prepare_enable(hvs->core_clk); in vc4_hvs_bind()
885 hvs->dlist = hvs->regs + SCALER_DLIST_START; in vc4_hvs_bind()
887 hvs->dlist = hvs->regs + SCALER5_DLIST_START; in vc4_hvs_bind()
892 ret = vc4_hvs_upload_linear_kernel(hvs, in vc4_hvs_bind()
893 &hvs->mitchell_netravali_filter, in vc4_hvs_bind()
1034 struct vc4_hvs *hvs = vc4->hvs; in vc4_hvs_unbind() local
1037 if (drm_mm_node_allocated(&vc4->hvs->mitchell_netravali_filter)) in vc4_hvs_unbind()
1038 drm_mm_remove_node(&vc4->hvs->mitchell_netravali_filter); in vc4_hvs_unbind()
1040 drm_mm_for_each_node_safe(node, next, &vc4->hvs->dlist_mm) in vc4_hvs_unbind()
1043 drm_mm_takedown(&vc4->hvs->dlist_mm); in vc4_hvs_unbind()
1045 drm_mm_for_each_node_safe(node, next, &vc4->hvs->lbm_mm) in vc4_hvs_unbind()
1047 drm_mm_takedown(&vc4->hvs->lbm_mm); in vc4_hvs_unbind()
1049 clk_disable_unprepare(hvs->core_clk); in vc4_hvs_unbind()
1051 vc4->hvs = NULL; in vc4_hvs_unbind()