Lines Matching refs:gdp
147 readl(gdp->regs + reg ## _OFFSET))
181 static void gdp_dbg_nvn(struct seq_file *s, struct sti_gdp *gdp, int val) in gdp_dbg_nvn() argument
187 if (gdp->node_list[i].top_field_paddr == val) { in gdp_dbg_nvn()
188 base = gdp->node_list[i].top_field; in gdp_dbg_nvn()
191 if (gdp->node_list[i].btm_field_paddr == val) { in gdp_dbg_nvn()
192 base = gdp->node_list[i].btm_field; in gdp_dbg_nvn()
216 struct sti_gdp *gdp = (struct sti_gdp *)node->info_ent->data; in gdp_dbg_show() local
217 struct drm_plane *drm_plane = &gdp->plane.drm_plane; in gdp_dbg_show()
225 sti_plane_to_str(&gdp->plane), gdp->regs); in gdp_dbg_show()
228 gdp_dbg_ctl(s, readl(gdp->regs + GAM_GDP_CTL_OFFSET)); in gdp_dbg_show()
231 gdp_dbg_vpo(s, readl(gdp->regs + GAM_GDP_VPO_OFFSET)); in gdp_dbg_show()
233 gdp_dbg_vps(s, readl(gdp->regs + GAM_GDP_VPS_OFFSET)); in gdp_dbg_show()
237 gdp_dbg_size(s, readl(gdp->regs + GAM_GDP_SIZE_OFFSET)); in gdp_dbg_show()
239 gdp_dbg_nvn(s, gdp, readl(gdp->regs + GAM_GDP_NVN_OFFSET)); in gdp_dbg_show()
243 gdp_dbg_ppt(s, readl(gdp->regs + GAM_GDP_PPT_OFFSET)); in gdp_dbg_show()
246 gdp_dbg_mst(s, readl(gdp->regs + GAM_GDP_MST_OFFSET)); in gdp_dbg_show()
283 struct sti_gdp *gdp = (struct sti_gdp *)node->info_ent->data; in gdp_node_dbg_show() local
287 seq_printf(s, "\n%s[%d].top", sti_plane_to_str(&gdp->plane), b); in gdp_node_dbg_show()
288 gdp_node_dump_node(s, gdp->node_list[b].top_field); in gdp_node_dbg_show()
289 seq_printf(s, "\n%s[%d].btm", sti_plane_to_str(&gdp->plane), b); in gdp_node_dbg_show()
290 gdp_node_dump_node(s, gdp->node_list[b].btm_field); in gdp_node_dbg_show()
316 static int gdp_debugfs_init(struct sti_gdp *gdp, struct drm_minor *minor) in gdp_debugfs_init() argument
322 switch (gdp->plane.desc) { in gdp_debugfs_init()
344 gdp_debugfs_files[i].data = gdp; in gdp_debugfs_init()
395 static struct sti_gdp_node_list *sti_gdp_get_free_nodes(struct sti_gdp *gdp) in sti_gdp_get_free_nodes() argument
400 hw_nvn = readl(gdp->regs + GAM_GDP_NVN_OFFSET); in sti_gdp_get_free_nodes()
405 if ((hw_nvn != gdp->node_list[i].btm_field_paddr) && in sti_gdp_get_free_nodes()
406 (hw_nvn != gdp->node_list[i].top_field_paddr)) in sti_gdp_get_free_nodes()
407 return &gdp->node_list[i]; in sti_gdp_get_free_nodes()
411 sti_plane_to_str(&gdp->plane), hw_nvn); in sti_gdp_get_free_nodes()
414 return &gdp->node_list[0]; in sti_gdp_get_free_nodes()
427 struct sti_gdp_node_list *sti_gdp_get_current_nodes(struct sti_gdp *gdp) in sti_gdp_get_current_nodes() argument
432 hw_nvn = readl(gdp->regs + GAM_GDP_NVN_OFFSET); in sti_gdp_get_current_nodes()
437 if ((hw_nvn == gdp->node_list[i].btm_field_paddr) || in sti_gdp_get_current_nodes()
438 (hw_nvn == gdp->node_list[i].top_field_paddr)) in sti_gdp_get_current_nodes()
439 return &gdp->node_list[i]; in sti_gdp_get_current_nodes()
443 hw_nvn, sti_plane_to_str(&gdp->plane)); in sti_gdp_get_current_nodes()
454 static void sti_gdp_disable(struct sti_gdp *gdp) in sti_gdp_disable() argument
458 DRM_DEBUG_DRIVER("%s\n", sti_plane_to_str(&gdp->plane)); in sti_gdp_disable()
462 gdp->node_list[i].top_field->gam_gdp_ppt |= GAM_GDP_PPT_IGNORE; in sti_gdp_disable()
463 gdp->node_list[i].btm_field->gam_gdp_ppt |= GAM_GDP_PPT_IGNORE; in sti_gdp_disable()
466 if (sti_vtg_unregister_client(gdp->vtg, &gdp->vtg_field_nb)) in sti_gdp_disable()
469 if (gdp->clk_pix) in sti_gdp_disable()
470 clk_disable_unprepare(gdp->clk_pix); in sti_gdp_disable()
472 gdp->plane.status = STI_PLANE_DISABLED; in sti_gdp_disable()
473 gdp->vtg = NULL; in sti_gdp_disable()
490 struct sti_gdp *gdp = container_of(nb, struct sti_gdp, vtg_field_nb); in sti_gdp_field_cb() local
492 if (gdp->plane.status == STI_PLANE_FLUSHING) { in sti_gdp_field_cb()
495 sti_plane_to_str(&gdp->plane)); in sti_gdp_field_cb()
497 sti_gdp_disable(gdp); in sti_gdp_field_cb()
502 gdp->is_curr_top = true; in sti_gdp_field_cb()
505 gdp->is_curr_top = false; in sti_gdp_field_cb()
515 static void sti_gdp_init(struct sti_gdp *gdp) in sti_gdp_init() argument
517 struct device_node *np = gdp->dev->of_node; in sti_gdp_init()
525 base = dma_alloc_wc(gdp->dev, size, &dma_addr, GFP_KERNEL); in sti_gdp_init()
538 gdp->node_list[i].top_field = base; in sti_gdp_init()
539 gdp->node_list[i].top_field_paddr = dma_addr; in sti_gdp_init()
549 gdp->node_list[i].btm_field = base; in sti_gdp_init()
550 gdp->node_list[i].btm_field_paddr = dma_addr; in sti_gdp_init()
560 switch (gdp->plane.desc) { in sti_gdp_init()
578 gdp->clk_pix = devm_clk_get(gdp->dev, clk_name); in sti_gdp_init()
579 if (IS_ERR(gdp->clk_pix)) in sti_gdp_init()
582 gdp->clk_main_parent = devm_clk_get(gdp->dev, "main_parent"); in sti_gdp_init()
583 if (IS_ERR(gdp->clk_main_parent)) in sti_gdp_init()
586 gdp->clk_aux_parent = devm_clk_get(gdp->dev, "aux_parent"); in sti_gdp_init()
587 if (IS_ERR(gdp->clk_aux_parent)) in sti_gdp_init()
621 struct sti_gdp *gdp = to_sti_gdp(plane); in sti_gdp_atomic_check() local
661 if (mode->clock && gdp->clk_pix) { in sti_gdp_atomic_check()
671 clkp = gdp->clk_main_parent; in sti_gdp_atomic_check()
673 clkp = gdp->clk_aux_parent; in sti_gdp_atomic_check()
676 clk_set_parent(gdp->clk_pix, clkp); in sti_gdp_atomic_check()
678 res = clk_set_rate(gdp->clk_pix, rate); in sti_gdp_atomic_check()
702 struct sti_gdp *gdp = to_sti_gdp(plane); in sti_gdp_atomic_update() local
736 if (!gdp->vtg) { in sti_gdp_atomic_update()
737 struct sti_compositor *compo = dev_get_drvdata(gdp->dev); in sti_gdp_atomic_update()
741 gdp->vtg = compo->vtg[mixer->id]; in sti_gdp_atomic_update()
742 sti_vtg_register_client(gdp->vtg, &gdp->vtg_field_nb, crtc); in sti_gdp_atomic_update()
743 clk_prepare_enable(gdp->clk_pix); in sti_gdp_atomic_update()
757 list = sti_gdp_get_free_nodes(gdp); in sti_gdp_atomic_update()
761 dev_dbg(gdp->dev, "%s %s top_node:0x%p btm_node:0x%p\n", __func__, in sti_gdp_atomic_update()
785 dst_w = sti_gdp_get_dst(gdp->dev, dst_w, src_w); in sti_gdp_atomic_update()
786 dst_h = sti_gdp_get_dst(gdp->dev, dst_h, src_h); in sti_gdp_atomic_update()
818 curr_list = sti_gdp_get_current_nodes(gdp); in sti_gdp_atomic_update()
822 dev_dbg(gdp->dev, "Current NVN:0x%X\n", in sti_gdp_atomic_update()
823 readl(gdp->regs + GAM_GDP_NVN_OFFSET)); in sti_gdp_atomic_update()
824 dev_dbg(gdp->dev, "Posted buff: %lx current buff: %x\n", in sti_gdp_atomic_update()
826 readl(gdp->regs + GAM_GDP_PML_OFFSET)); in sti_gdp_atomic_update()
834 writel(gdp->is_curr_top ? in sti_gdp_atomic_update()
836 gdp->regs + GAM_GDP_NVN_OFFSET); in sti_gdp_atomic_update()
841 if (gdp->is_curr_top) { in sti_gdp_atomic_update()
849 gdp->regs + GAM_GDP_NVN_OFFSET); in sti_gdp_atomic_update()
853 writel(dma_updated_top, gdp->regs + GAM_GDP_NVN_OFFSET); in sti_gdp_atomic_update()
897 struct sti_gdp *gdp = to_sti_gdp(plane); in sti_gdp_late_register() local
899 return gdp_debugfs_init(gdp, drm_plane->dev->primary); in sti_gdp_late_register()
918 struct sti_gdp *gdp; in sti_gdp_create() local
921 gdp = devm_kzalloc(dev, sizeof(*gdp), GFP_KERNEL); in sti_gdp_create()
922 if (!gdp) { in sti_gdp_create()
927 gdp->dev = dev; in sti_gdp_create()
928 gdp->regs = baseaddr; in sti_gdp_create()
929 gdp->plane.desc = desc; in sti_gdp_create()
930 gdp->plane.status = STI_PLANE_DISABLED; in sti_gdp_create()
932 gdp->vtg_field_nb.notifier_call = sti_gdp_field_cb; in sti_gdp_create()
934 sti_gdp_init(gdp); in sti_gdp_create()
936 res = drm_universal_plane_init(drm_dev, &gdp->plane.drm_plane, in sti_gdp_create()
947 drm_plane_helper_add(&gdp->plane.drm_plane, &sti_gdp_helpers_funcs); in sti_gdp_create()
949 sti_plane_init_property(&gdp->plane, type); in sti_gdp_create()
951 return &gdp->plane.drm_plane; in sti_gdp_create()
954 devm_kfree(dev, gdp); in sti_gdp_create()