Lines Matching refs:gdp

149 				   readl(gdp->regs + reg ## _OFFSET))
183 static void gdp_dbg_nvn(struct seq_file *s, struct sti_gdp *gdp, int val) in gdp_dbg_nvn() argument
189 if (gdp->node_list[i].top_field_paddr == val) { in gdp_dbg_nvn()
190 base = gdp->node_list[i].top_field; in gdp_dbg_nvn()
193 if (gdp->node_list[i].btm_field_paddr == val) { in gdp_dbg_nvn()
194 base = gdp->node_list[i].btm_field; in gdp_dbg_nvn()
218 struct sti_gdp *gdp = (struct sti_gdp *)node->info_ent->data; in gdp_dbg_show() local
219 struct drm_plane *drm_plane = &gdp->plane.drm_plane; in gdp_dbg_show()
227 sti_plane_to_str(&gdp->plane), gdp->regs); in gdp_dbg_show()
230 gdp_dbg_ctl(s, readl(gdp->regs + GAM_GDP_CTL_OFFSET)); in gdp_dbg_show()
233 gdp_dbg_vpo(s, readl(gdp->regs + GAM_GDP_VPO_OFFSET)); in gdp_dbg_show()
235 gdp_dbg_vps(s, readl(gdp->regs + GAM_GDP_VPS_OFFSET)); in gdp_dbg_show()
239 gdp_dbg_size(s, readl(gdp->regs + GAM_GDP_SIZE_OFFSET)); in gdp_dbg_show()
241 gdp_dbg_nvn(s, gdp, readl(gdp->regs + GAM_GDP_NVN_OFFSET)); in gdp_dbg_show()
245 gdp_dbg_ppt(s, readl(gdp->regs + GAM_GDP_PPT_OFFSET)); in gdp_dbg_show()
248 gdp_dbg_mst(s, readl(gdp->regs + GAM_GDP_MST_OFFSET)); in gdp_dbg_show()
285 struct sti_gdp *gdp = (struct sti_gdp *)node->info_ent->data; in gdp_node_dbg_show() local
289 seq_printf(s, "\n%s[%d].top", sti_plane_to_str(&gdp->plane), b); in gdp_node_dbg_show()
290 gdp_node_dump_node(s, gdp->node_list[b].top_field); in gdp_node_dbg_show()
291 seq_printf(s, "\n%s[%d].btm", sti_plane_to_str(&gdp->plane), b); in gdp_node_dbg_show()
292 gdp_node_dump_node(s, gdp->node_list[b].btm_field); in gdp_node_dbg_show()
318 static int gdp_debugfs_init(struct sti_gdp *gdp, struct drm_minor *minor) in gdp_debugfs_init() argument
324 switch (gdp->plane.desc) { in gdp_debugfs_init()
346 gdp_debugfs_files[i].data = gdp; in gdp_debugfs_init()
397 static struct sti_gdp_node_list *sti_gdp_get_free_nodes(struct sti_gdp *gdp) in sti_gdp_get_free_nodes() argument
402 hw_nvn = readl(gdp->regs + GAM_GDP_NVN_OFFSET); in sti_gdp_get_free_nodes()
407 if ((hw_nvn != gdp->node_list[i].btm_field_paddr) && in sti_gdp_get_free_nodes()
408 (hw_nvn != gdp->node_list[i].top_field_paddr)) in sti_gdp_get_free_nodes()
409 return &gdp->node_list[i]; in sti_gdp_get_free_nodes()
413 sti_plane_to_str(&gdp->plane), hw_nvn); in sti_gdp_get_free_nodes()
416 return &gdp->node_list[0]; in sti_gdp_get_free_nodes()
429 struct sti_gdp_node_list *sti_gdp_get_current_nodes(struct sti_gdp *gdp) in sti_gdp_get_current_nodes() argument
434 hw_nvn = readl(gdp->regs + GAM_GDP_NVN_OFFSET); in sti_gdp_get_current_nodes()
439 if ((hw_nvn == gdp->node_list[i].btm_field_paddr) || in sti_gdp_get_current_nodes()
440 (hw_nvn == gdp->node_list[i].top_field_paddr)) in sti_gdp_get_current_nodes()
441 return &gdp->node_list[i]; in sti_gdp_get_current_nodes()
445 hw_nvn, sti_plane_to_str(&gdp->plane)); in sti_gdp_get_current_nodes()
456 static void sti_gdp_disable(struct sti_gdp *gdp) in sti_gdp_disable() argument
460 DRM_DEBUG_DRIVER("%s\n", sti_plane_to_str(&gdp->plane)); in sti_gdp_disable()
464 gdp->node_list[i].top_field->gam_gdp_ppt |= GAM_GDP_PPT_IGNORE; in sti_gdp_disable()
465 gdp->node_list[i].btm_field->gam_gdp_ppt |= GAM_GDP_PPT_IGNORE; in sti_gdp_disable()
468 if (sti_vtg_unregister_client(gdp->vtg, &gdp->vtg_field_nb)) in sti_gdp_disable()
471 if (gdp->clk_pix) in sti_gdp_disable()
472 clk_disable_unprepare(gdp->clk_pix); in sti_gdp_disable()
474 gdp->plane.status = STI_PLANE_DISABLED; in sti_gdp_disable()
475 gdp->vtg = NULL; in sti_gdp_disable()
492 struct sti_gdp *gdp = container_of(nb, struct sti_gdp, vtg_field_nb); in sti_gdp_field_cb() local
494 if (gdp->plane.status == STI_PLANE_FLUSHING) { in sti_gdp_field_cb()
497 sti_plane_to_str(&gdp->plane)); in sti_gdp_field_cb()
499 sti_gdp_disable(gdp); in sti_gdp_field_cb()
504 gdp->is_curr_top = true; in sti_gdp_field_cb()
507 gdp->is_curr_top = false; in sti_gdp_field_cb()
517 static void sti_gdp_init(struct sti_gdp *gdp) in sti_gdp_init() argument
519 struct device_node *np = gdp->dev->of_node; in sti_gdp_init()
527 base = dma_alloc_wc(gdp->dev, size, &dma_addr, GFP_KERNEL); in sti_gdp_init()
540 gdp->node_list[i].top_field = base; in sti_gdp_init()
541 gdp->node_list[i].top_field_paddr = dma_addr; in sti_gdp_init()
551 gdp->node_list[i].btm_field = base; in sti_gdp_init()
552 gdp->node_list[i].btm_field_paddr = dma_addr; in sti_gdp_init()
562 switch (gdp->plane.desc) { in sti_gdp_init()
580 gdp->clk_pix = devm_clk_get(gdp->dev, clk_name); in sti_gdp_init()
581 if (IS_ERR(gdp->clk_pix)) in sti_gdp_init()
584 gdp->clk_main_parent = devm_clk_get(gdp->dev, "main_parent"); in sti_gdp_init()
585 if (IS_ERR(gdp->clk_main_parent)) in sti_gdp_init()
588 gdp->clk_aux_parent = devm_clk_get(gdp->dev, "aux_parent"); in sti_gdp_init()
589 if (IS_ERR(gdp->clk_aux_parent)) in sti_gdp_init()
625 struct sti_gdp *gdp = to_sti_gdp(plane); in sti_gdp_atomic_check() local
667 if (mode->clock && gdp->clk_pix) { in sti_gdp_atomic_check()
677 clkp = gdp->clk_main_parent; in sti_gdp_atomic_check()
679 clkp = gdp->clk_aux_parent; in sti_gdp_atomic_check()
682 clk_set_parent(gdp->clk_pix, clkp); in sti_gdp_atomic_check()
684 res = clk_set_rate(gdp->clk_pix, rate); in sti_gdp_atomic_check()
711 struct sti_gdp *gdp = to_sti_gdp(plane); in sti_gdp_atomic_update() local
745 if (!gdp->vtg) { in sti_gdp_atomic_update()
746 struct sti_compositor *compo = dev_get_drvdata(gdp->dev); in sti_gdp_atomic_update()
750 gdp->vtg = compo->vtg[mixer->id]; in sti_gdp_atomic_update()
751 sti_vtg_register_client(gdp->vtg, &gdp->vtg_field_nb, crtc); in sti_gdp_atomic_update()
752 clk_prepare_enable(gdp->clk_pix); in sti_gdp_atomic_update()
766 list = sti_gdp_get_free_nodes(gdp); in sti_gdp_atomic_update()
770 dev_dbg(gdp->dev, "%s %s top_node:0x%p btm_node:0x%p\n", __func__, in sti_gdp_atomic_update()
794 dst_w = sti_gdp_get_dst(gdp->dev, dst_w, src_w); in sti_gdp_atomic_update()
795 dst_h = sti_gdp_get_dst(gdp->dev, dst_h, src_h); in sti_gdp_atomic_update()
827 curr_list = sti_gdp_get_current_nodes(gdp); in sti_gdp_atomic_update()
831 dev_dbg(gdp->dev, "Current NVN:0x%X\n", in sti_gdp_atomic_update()
832 readl(gdp->regs + GAM_GDP_NVN_OFFSET)); in sti_gdp_atomic_update()
833 dev_dbg(gdp->dev, "Posted buff: %lx current buff: %x\n", in sti_gdp_atomic_update()
835 readl(gdp->regs + GAM_GDP_PML_OFFSET)); in sti_gdp_atomic_update()
843 writel(gdp->is_curr_top ? in sti_gdp_atomic_update()
845 gdp->regs + GAM_GDP_NVN_OFFSET); in sti_gdp_atomic_update()
850 if (gdp->is_curr_top) { in sti_gdp_atomic_update()
858 gdp->regs + GAM_GDP_NVN_OFFSET); in sti_gdp_atomic_update()
862 writel(dma_updated_top, gdp->regs + GAM_GDP_NVN_OFFSET); in sti_gdp_atomic_update()
901 struct sti_gdp *gdp = to_sti_gdp(plane); in sti_gdp_late_register() local
903 return gdp_debugfs_init(gdp, drm_plane->dev->primary); in sti_gdp_late_register()
922 struct sti_gdp *gdp; in sti_gdp_create() local
925 gdp = devm_kzalloc(dev, sizeof(*gdp), GFP_KERNEL); in sti_gdp_create()
926 if (!gdp) { in sti_gdp_create()
931 gdp->dev = dev; in sti_gdp_create()
932 gdp->regs = baseaddr; in sti_gdp_create()
933 gdp->plane.desc = desc; in sti_gdp_create()
934 gdp->plane.status = STI_PLANE_DISABLED; in sti_gdp_create()
936 gdp->vtg_field_nb.notifier_call = sti_gdp_field_cb; in sti_gdp_create()
938 sti_gdp_init(gdp); in sti_gdp_create()
940 res = drm_universal_plane_init(drm_dev, &gdp->plane.drm_plane, in sti_gdp_create()
951 drm_plane_helper_add(&gdp->plane.drm_plane, &sti_gdp_helpers_funcs); in sti_gdp_create()
953 sti_plane_init_property(&gdp->plane, type); in sti_gdp_create()
955 return &gdp->plane.drm_plane; in sti_gdp_create()
958 devm_kfree(dev, gdp); in sti_gdp_create()