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