43 #define to_shmob_plane(p) container_of(p, struct shmob_drm_plane, plane)
45 static void shmob_drm_plane_compute_base(
struct shmob_drm_plane *splane,
55 + y * fb->
pitches[0] + x * bpp / 8;
58 bpp = splane->
format->bpp - 8;
61 + y / (bpp == 4 ? 2 : 1) * fb->
pitches[1]
62 + x * (bpp == 16 ? 2 : 1);
75 switch (splane->
format->fourcc) {
94 switch (splane->
format->fourcc) {
118 #define plane_reg_dump(sdev, splane, reg) \
119 dev_dbg(sdev->ddev->dev, "%s(%u): %s 0x%08x 0x%08x\n", __func__, \
120 splane->index, #reg, \
121 lcdc_read(sdev, reg(splane->index)), \
122 lcdc_read(sdev, reg(splane->index) + LCDC_SIDE_B_OFFSET))
133 "LDBCR", lcdc_read(sdev,
LDBCR));
146 shmob_drm_plane_compute_base(splane, fb, splane->
src_x, splane->
src_y);
152 lcdc_write(sdev,
LDBCR,
155 "LDBCR", lcdc_read(sdev,
LDBCR));
172 __shmob_drm_plane_setup(splane, plane->
fb);
187 if (format ==
NULL) {
188 dev_dbg(sdev->
dev,
"update_plane: unsupported format %08x\n",
193 if (src_w >> 16 != crtc_w || src_h >> 16 != crtc_h) {
194 dev_dbg(sdev->
dev,
"%s: scaling not supported\n", __func__);
200 splane->
src_x = src_x >> 16;
201 splane->
src_y = src_y >> 16;
207 __shmob_drm_plane_setup(splane, fb);
211 static int shmob_drm_plane_disable(
struct drm_plane *plane)
222 static void shmob_drm_plane_destroy(
struct drm_plane *plane)
226 shmob_drm_plane_disable(plane);
232 .update_plane = shmob_drm_plane_update,
233 .disable_plane = shmob_drm_plane_disable,
234 .destroy = shmob_drm_plane_destroy,
254 splane = kzalloc(
sizeof(*splane),
GFP_KERNEL);
262 &shmob_drm_plane_funcs, formats,