Lines Matching refs:cursor
78 readl(cursor->regs + reg))
91 struct sti_cursor *cursor, u32 val) in cursor_dbg_pml() argument
93 if (cursor->pixmap.paddr == val) in cursor_dbg_pml()
94 seq_printf(s, "\tVirt @: %p", cursor->pixmap.base); in cursor_dbg_pml()
98 struct sti_cursor *cursor, u32 val) in cursor_dbg_cml() argument
100 if (cursor->clut_paddr == val) in cursor_dbg_cml()
101 seq_printf(s, "\tVirt @: %p", cursor->clut); in cursor_dbg_cml()
107 struct sti_cursor *cursor = (struct sti_cursor *)node->info_ent->data; in cursor_dbg_show() local
110 sti_plane_to_str(&cursor->plane), cursor->regs); in cursor_dbg_show()
114 cursor_dbg_vpo(s, readl(cursor->regs + CUR_VPO)); in cursor_dbg_show()
116 cursor_dbg_pml(s, cursor, readl(cursor->regs + CUR_PML)); in cursor_dbg_show()
119 cursor_dbg_size(s, readl(cursor->regs + CUR_SIZE)); in cursor_dbg_show()
121 cursor_dbg_cml(s, cursor, readl(cursor->regs + CUR_CML)); in cursor_dbg_show()
132 static int cursor_debugfs_init(struct sti_cursor *cursor, in cursor_debugfs_init() argument
138 cursor_debugfs_files[i].data = cursor; in cursor_debugfs_init()
145 static void sti_cursor_argb8888_to_clut8(struct sti_cursor *cursor, u32 *src) in sti_cursor_argb8888_to_clut8() argument
147 u8 *dst = cursor->pixmap.base; in sti_cursor_argb8888_to_clut8()
151 for (i = 0; i < cursor->height; i++) { in sti_cursor_argb8888_to_clut8()
152 for (j = 0; j < cursor->width; j++) { in sti_cursor_argb8888_to_clut8()
165 static void sti_cursor_init(struct sti_cursor *cursor) in sti_cursor_init() argument
167 unsigned short *base = cursor->clut; in sti_cursor_init()
185 struct sti_cursor *cursor = to_sti_cursor(plane); in sti_cursor_atomic_check() local
217 if (!cursor->pixmap.base || in sti_cursor_atomic_check()
218 (cursor->width != src_w) || in sti_cursor_atomic_check()
219 (cursor->height != src_h)) { 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()
223 if (cursor->pixmap.base) in sti_cursor_atomic_check()
224 dma_free_wc(cursor->dev, cursor->pixmap.size, in sti_cursor_atomic_check()
225 cursor->pixmap.base, cursor->pixmap.paddr); in sti_cursor_atomic_check()
227 cursor->pixmap.size = cursor->width * cursor->height; in sti_cursor_atomic_check()
229 cursor->pixmap.base = dma_alloc_wc(cursor->dev, in sti_cursor_atomic_check()
230 cursor->pixmap.size, in sti_cursor_atomic_check()
231 &cursor->pixmap.paddr, in sti_cursor_atomic_check()
233 if (!cursor->pixmap.base) { in sti_cursor_atomic_check()
257 struct sti_cursor *cursor = to_sti_cursor(plane); in sti_cursor_atomic_update() local
276 sti_cursor_argb8888_to_clut8(cursor, (u32 *)cma_obj->vaddr); in sti_cursor_atomic_update()
282 writel(val, cursor->regs + CUR_AWS); in sti_cursor_atomic_update()
286 writel(val, cursor->regs + CUR_AWE); in sti_cursor_atomic_update()
289 writel(cursor->pixmap.paddr, cursor->regs + CUR_PML); in sti_cursor_atomic_update()
290 writel(cursor->width, cursor->regs + CUR_PMP); in sti_cursor_atomic_update()
291 writel(cursor->height << 16 | cursor->width, cursor->regs + CUR_SIZE); in sti_cursor_atomic_update()
295 writel((y << 16) | x, cursor->regs + CUR_VPO); in sti_cursor_atomic_update()
298 writel(cursor->clut_paddr, cursor->regs + CUR_CML); in sti_cursor_atomic_update()
299 writel(CUR_CTL_CLUT_UPDATE, cursor->regs + CUR_CTL); in sti_cursor_atomic_update()
342 struct sti_cursor *cursor = to_sti_cursor(plane); in sti_cursor_late_register() local
344 return cursor_debugfs_init(cursor, drm_plane->dev->primary); in sti_cursor_late_register()
362 struct sti_cursor *cursor; in sti_cursor_create() local
366 cursor = devm_kzalloc(dev, sizeof(*cursor), GFP_KERNEL); in sti_cursor_create()
367 if (!cursor) { in sti_cursor_create()
374 cursor->clut = dma_alloc_wc(dev, size, &cursor->clut_paddr, in sti_cursor_create()
377 if (!cursor->clut) { in sti_cursor_create()
382 cursor->dev = dev; in sti_cursor_create()
383 cursor->regs = baseaddr; in sti_cursor_create()
384 cursor->plane.desc = desc; in sti_cursor_create()
385 cursor->plane.status = STI_PLANE_DISABLED; in sti_cursor_create()
387 sti_cursor_init(cursor); in sti_cursor_create()
389 res = drm_universal_plane_init(drm_dev, &cursor->plane.drm_plane, in sti_cursor_create()
400 drm_plane_helper_add(&cursor->plane.drm_plane, in sti_cursor_create()
403 sti_plane_init_property(&cursor->plane, DRM_PLANE_TYPE_CURSOR); in sti_cursor_create()
405 return &cursor->plane.drm_plane; in sti_cursor_create()
408 dma_free_wc(dev, size, cursor->clut, cursor->clut_paddr); in sti_cursor_create()
410 devm_kfree(dev, cursor); in sti_cursor_create()