Lines Matching refs:cursor

56  * @regs:         cursor registers
57 * @width: cursor width
58 * @height: cursor height
61 * @pixmap: pixmap dma buffer (clut8-format cursor)
81 readl(cursor->regs + reg))
94 struct sti_cursor *cursor, u32 val)
96 if (cursor->pixmap.paddr == val)
97 seq_printf(s, "\tVirt @: %p", cursor->pixmap.base);
101 struct sti_cursor *cursor, u32 val)
103 if (cursor->clut_paddr == val)
104 seq_printf(s, "\tVirt @: %p", cursor->clut);
110 struct sti_cursor *cursor = (struct sti_cursor *)node->info_ent->data;
113 sti_plane_to_str(&cursor->plane), cursor->regs);
117 cursor_dbg_vpo(s, readl(cursor->regs + CUR_VPO));
119 cursor_dbg_pml(s, cursor, readl(cursor->regs + CUR_PML));
122 cursor_dbg_size(s, readl(cursor->regs + CUR_SIZE));
124 cursor_dbg_cml(s, cursor, readl(cursor->regs + CUR_CML));
132 { "cursor", cursor_dbg_show, 0, NULL },
135 static void cursor_debugfs_init(struct sti_cursor *cursor,
141 cursor_debugfs_files[i].data = cursor;
148 static void sti_cursor_argb8888_to_clut8(struct sti_cursor *cursor, u32 *src)
150 u8 *dst = cursor->pixmap.base;
154 for (i = 0; i < cursor->height; i++) {
155 for (j = 0; j < cursor->width; j++) {
168 static void sti_cursor_init(struct sti_cursor *cursor)
170 unsigned short *base = cursor->clut;
190 struct sti_cursor *cursor = to_sti_cursor(plane);
221 DRM_ERROR("Invalid cursor size (%dx%d)\n",
226 /* If the cursor size has changed, re-allocated the pixmap */
227 if (!cursor->pixmap.base ||
228 (cursor->width != src_w) ||
229 (cursor->height != src_h)) {
230 cursor->width = src_w;
231 cursor->height = src_h;
233 if (cursor->pixmap.base)
234 dma_free_wc(cursor->dev, cursor->pixmap.size,
235 cursor->pixmap.base, cursor->pixmap.paddr);
237 cursor->pixmap.size = cursor->width * cursor->height;
239 cursor->pixmap.base = dma_alloc_wc(cursor->dev,
240 cursor->pixmap.size,
241 &cursor->pixmap.paddr,
243 if (!cursor->pixmap.base) {
268 struct sti_cursor *cursor = to_sti_cursor(plane);
287 sti_cursor_argb8888_to_clut8(cursor, (u32 *)dma_obj->vaddr);
293 writel(val, cursor->regs + CUR_AWS);
297 writel(val, cursor->regs + CUR_AWE);
300 writel(cursor->pixmap.paddr, cursor->regs + CUR_PML);
301 writel(cursor->width, cursor->regs + CUR_PMP);
302 writel(cursor->height << 16 | cursor->width, cursor->regs + CUR_SIZE);
306 writel((y << 16) | x, cursor->regs + CUR_VPO);
309 writel(cursor->clut_paddr, cursor->regs + CUR_CML);
310 writel(CUR_CTL_CLUT_UPDATE, cursor->regs + CUR_CTL);
347 struct sti_cursor *cursor = to_sti_cursor(plane);
349 cursor_debugfs_init(cursor, drm_plane->dev->primary);
369 struct sti_cursor *cursor;
373 cursor = devm_kzalloc(dev, sizeof(*cursor), GFP_KERNEL);
374 if (!cursor) {
375 DRM_ERROR("Failed to allocate memory for cursor\n");
381 cursor->clut = dma_alloc_wc(dev, size, &cursor->clut_paddr,
384 if (!cursor->clut) {
385 DRM_ERROR("Failed to allocate memory for cursor clut\n");
389 cursor->dev = dev;
390 cursor->regs = baseaddr;
391 cursor->plane.desc = desc;
392 cursor->plane.status = STI_PLANE_DISABLED;
394 sti_cursor_init(cursor);
396 res = drm_universal_plane_init(drm_dev, &cursor->plane.drm_plane,
407 drm_plane_helper_add(&cursor->plane.drm_plane,
410 sti_plane_init_property(&cursor->plane, DRM_PLANE_TYPE_CURSOR);
412 return &cursor->plane.drm_plane;
415 dma_free_wc(dev, size, cursor->clut, cursor->clut_paddr);
417 devm_kfree(dev, cursor);