Lines Matching refs:cursor

80 				   readl(cursor->regs + reg))
93 struct sti_cursor *cursor, u32 val) in cursor_dbg_pml() argument
95 if (cursor->pixmap.paddr == val) in cursor_dbg_pml()
96 seq_printf(s, "\tVirt @: %p", cursor->pixmap.base); in cursor_dbg_pml()
100 struct sti_cursor *cursor, u32 val) in cursor_dbg_cml() argument
102 if (cursor->clut_paddr == val) in cursor_dbg_cml()
103 seq_printf(s, "\tVirt @: %p", cursor->clut); in cursor_dbg_cml()
109 struct sti_cursor *cursor = (struct sti_cursor *)node->info_ent->data; in cursor_dbg_show() local
112 sti_plane_to_str(&cursor->plane), cursor->regs); in cursor_dbg_show()
116 cursor_dbg_vpo(s, readl(cursor->regs + CUR_VPO)); in cursor_dbg_show()
118 cursor_dbg_pml(s, cursor, readl(cursor->regs + CUR_PML)); in cursor_dbg_show()
121 cursor_dbg_size(s, readl(cursor->regs + CUR_SIZE)); in cursor_dbg_show()
123 cursor_dbg_cml(s, cursor, readl(cursor->regs + CUR_CML)); in cursor_dbg_show()
134 static int cursor_debugfs_init(struct sti_cursor *cursor, in cursor_debugfs_init() argument
140 cursor_debugfs_files[i].data = cursor; in cursor_debugfs_init()
147 static void sti_cursor_argb8888_to_clut8(struct sti_cursor *cursor, u32 *src) in sti_cursor_argb8888_to_clut8() argument
149 u8 *dst = cursor->pixmap.base; in sti_cursor_argb8888_to_clut8()
153 for (i = 0; i < cursor->height; i++) { in sti_cursor_argb8888_to_clut8()
154 for (j = 0; j < cursor->width; j++) { in sti_cursor_argb8888_to_clut8()
167 static void sti_cursor_init(struct sti_cursor *cursor) in sti_cursor_init() argument
169 unsigned short *base = cursor->clut; in sti_cursor_init()
187 struct sti_cursor *cursor = to_sti_cursor(plane); in sti_cursor_atomic_check() local
219 if (!cursor->pixmap.base || in sti_cursor_atomic_check()
220 (cursor->width != src_w) || in sti_cursor_atomic_check()
221 (cursor->height != src_h)) { in sti_cursor_atomic_check()
222 cursor->width = src_w; in sti_cursor_atomic_check()
223 cursor->height = src_h; in sti_cursor_atomic_check()
225 if (cursor->pixmap.base) in sti_cursor_atomic_check()
226 dma_free_wc(cursor->dev, cursor->pixmap.size, in sti_cursor_atomic_check()
227 cursor->pixmap.base, cursor->pixmap.paddr); in sti_cursor_atomic_check()
229 cursor->pixmap.size = cursor->width * cursor->height; in sti_cursor_atomic_check()
231 cursor->pixmap.base = dma_alloc_wc(cursor->dev, in sti_cursor_atomic_check()
232 cursor->pixmap.size, in sti_cursor_atomic_check()
233 &cursor->pixmap.paddr, in sti_cursor_atomic_check()
235 if (!cursor->pixmap.base) { in sti_cursor_atomic_check()
259 struct sti_cursor *cursor = to_sti_cursor(plane); in sti_cursor_atomic_update() local
278 sti_cursor_argb8888_to_clut8(cursor, (u32 *)cma_obj->vaddr); in sti_cursor_atomic_update()
284 writel(val, cursor->regs + CUR_AWS); in sti_cursor_atomic_update()
288 writel(val, cursor->regs + CUR_AWE); in sti_cursor_atomic_update()
291 writel(cursor->pixmap.paddr, cursor->regs + CUR_PML); in sti_cursor_atomic_update()
292 writel(cursor->width, cursor->regs + CUR_PMP); in sti_cursor_atomic_update()
293 writel(cursor->height << 16 | cursor->width, cursor->regs + CUR_SIZE); in sti_cursor_atomic_update()
297 writel((y << 16) | x, cursor->regs + CUR_VPO); in sti_cursor_atomic_update()
300 writel(cursor->clut_paddr, cursor->regs + CUR_CML); in sti_cursor_atomic_update()
301 writel(CUR_CTL_CLUT_UPDATE, cursor->regs + CUR_CTL); in sti_cursor_atomic_update()
343 struct sti_cursor *cursor = to_sti_cursor(plane); in sti_cursor_late_register() local
345 return cursor_debugfs_init(cursor, drm_plane->dev->primary); in sti_cursor_late_register()
363 struct sti_cursor *cursor; in sti_cursor_create() local
367 cursor = devm_kzalloc(dev, sizeof(*cursor), GFP_KERNEL); in sti_cursor_create()
368 if (!cursor) { in sti_cursor_create()
375 cursor->clut = dma_alloc_wc(dev, size, &cursor->clut_paddr, in sti_cursor_create()
378 if (!cursor->clut) { in sti_cursor_create()
383 cursor->dev = dev; in sti_cursor_create()
384 cursor->regs = baseaddr; in sti_cursor_create()
385 cursor->plane.desc = desc; in sti_cursor_create()
386 cursor->plane.status = STI_PLANE_DISABLED; in sti_cursor_create()
388 sti_cursor_init(cursor); in sti_cursor_create()
390 res = drm_universal_plane_init(drm_dev, &cursor->plane.drm_plane, in sti_cursor_create()
401 drm_plane_helper_add(&cursor->plane.drm_plane, in sti_cursor_create()
404 sti_plane_init_property(&cursor->plane, DRM_PLANE_TYPE_CURSOR); in sti_cursor_create()
406 return &cursor->plane.drm_plane; in sti_cursor_create()
409 dma_free_wc(dev, size, cursor->clut, cursor->clut_paddr); in sti_cursor_create()
411 devm_kfree(dev, cursor); in sti_cursor_create()