Lines Matching refs:layer

53 	struct sti_layer layer;  member
65 #define to_sti_cursor(x) container_of(x, struct sti_cursor, layer)
67 static const uint32_t *sti_cursor_get_formats(struct sti_layer *layer) in sti_cursor_get_formats() argument
72 static unsigned int sti_cursor_get_nb_formats(struct sti_layer *layer) in sti_cursor_get_nb_formats() argument
77 static void sti_cursor_argb8888_to_clut8(struct sti_layer *layer) in sti_cursor_argb8888_to_clut8() argument
79 struct sti_cursor *cursor = to_sti_cursor(layer); in sti_cursor_argb8888_to_clut8()
80 u32 *src = layer->vaddr; in sti_cursor_argb8888_to_clut8()
99 static int sti_cursor_prepare_layer(struct sti_layer *layer, bool first_prepare) in sti_cursor_prepare_layer() argument
101 struct sti_cursor *cursor = to_sti_cursor(layer); in sti_cursor_prepare_layer()
102 struct drm_display_mode *mode = layer->mode; in sti_cursor_prepare_layer()
108 dev_dbg(layer->dev, "%s %s\n", __func__, sti_layer_to_str(layer)); in sti_cursor_prepare_layer()
110 if (layer->src_w < STI_CURS_MIN_SIZE || in sti_cursor_prepare_layer()
111 layer->src_h < STI_CURS_MIN_SIZE || in sti_cursor_prepare_layer()
112 layer->src_w > STI_CURS_MAX_SIZE || in sti_cursor_prepare_layer()
113 layer->src_h > STI_CURS_MAX_SIZE) { in sti_cursor_prepare_layer()
115 layer->src_w, layer->src_h); in sti_cursor_prepare_layer()
121 (cursor->width != layer->src_w) || in sti_cursor_prepare_layer()
122 (cursor->height != layer->src_h)) { in sti_cursor_prepare_layer()
123 cursor->width = layer->src_w; in sti_cursor_prepare_layer()
124 cursor->height = layer->src_h; in sti_cursor_prepare_layer()
127 dma_free_writecombine(layer->dev, in sti_cursor_prepare_layer()
134 cursor->pixmap.base = dma_alloc_writecombine(layer->dev, in sti_cursor_prepare_layer()
145 sti_cursor_argb8888_to_clut8(layer); in sti_cursor_prepare_layer()
151 writel(val, layer->regs + CUR_AWS); in sti_cursor_prepare_layer()
155 writel(val, layer->regs + CUR_AWE); in sti_cursor_prepare_layer()
159 writel(cursor->clut_paddr, layer->regs + CUR_CML); in sti_cursor_prepare_layer()
160 writel(CUR_CTL_CLUT_UPDATE, layer->regs + CUR_CTL); in sti_cursor_prepare_layer()
166 static int sti_cursor_commit_layer(struct sti_layer *layer) in sti_cursor_commit_layer() argument
168 struct sti_cursor *cursor = to_sti_cursor(layer); in sti_cursor_commit_layer()
169 struct drm_display_mode *mode = layer->mode; in sti_cursor_commit_layer()
172 dev_dbg(layer->dev, "%s %s\n", __func__, sti_layer_to_str(layer)); in sti_cursor_commit_layer()
175 writel(cursor->pixmap.paddr, layer->regs + CUR_PML); in sti_cursor_commit_layer()
176 writel(cursor->width, layer->regs + CUR_PMP); in sti_cursor_commit_layer()
177 writel(cursor->height << 16 | cursor->width, layer->regs + CUR_SIZE); in sti_cursor_commit_layer()
179 ydo = sti_vtg_get_line_number(*mode, layer->dst_y); in sti_cursor_commit_layer()
180 xdo = sti_vtg_get_pixel_number(*mode, layer->dst_y); in sti_cursor_commit_layer()
181 writel((ydo << 16) | xdo, layer->regs + CUR_VPO); in sti_cursor_commit_layer()
186 static int sti_cursor_disable_layer(struct sti_layer *layer) in sti_cursor_disable_layer() argument
191 static void sti_cursor_init(struct sti_layer *layer) in sti_cursor_init() argument
193 struct sti_cursor *cursor = to_sti_cursor(layer); in sti_cursor_init()
239 cursor->layer.ops = &cursor_ops; in sti_cursor_create()