21 static const struct mxr_format mxr_fmt_nv12 = {
27 { .width = 1, .height = 1, .size = 1 },
28 { .width = 2, .height = 2, .size = 2 },
34 static const struct mxr_format mxr_fmt_nv21 = {
40 { .width = 1, .height = 1, .size = 1 },
41 { .width = 2, .height = 2, .size = 2 },
47 static const struct mxr_format mxr_fmt_nv12m = {
48 .name =
"NV12 (mplane)",
53 { .width = 1, .height = 1, .size = 1 },
54 { .width = 2, .height = 2, .size = 2 },
57 .plane2subframe = {0, 1},
61 static const struct mxr_format mxr_fmt_nv12mt = {
62 .name =
"NV12 tiled (mplane)",
67 { .width = 128, .height = 32, .size = 4096 },
68 { .width = 128, .height = 32, .size = 2048 },
71 .plane2subframe = {0, 1},
75 static const struct mxr_format *mxr_video_format[] = {
84 static void mxr_vp_layer_release(
struct mxr_layer *layer)
90 static void mxr_vp_buffer_set(
struct mxr_layer *layer,
100 luma_addr[0] = vb2_dma_contig_plane_dma_addr(&buf->
vb, 0);
101 if (layer->
fmt->num_subframes == 2) {
102 chroma_addr[0] = vb2_dma_contig_plane_dma_addr(&buf->
vb, 1);
107 &layer->
fmt->plane[0], layer->
geo.src.full_width,
108 layer->
geo.src.full_height);
111 luma_addr[1] = luma_addr[0] + 0x40;
112 chroma_addr[1] = chroma_addr[0] + 0x40;
114 luma_addr[1] = luma_addr[0] + layer->
geo.src.full_width;
115 chroma_addr[1] = chroma_addr[0];
120 static void mxr_vp_stream_set(
struct mxr_layer *layer,
int en)
125 static void mxr_vp_format_set(
struct mxr_layer *layer)
130 static inline unsigned int do_center(
unsigned int center,
131 unsigned int size,
unsigned int upper,
unsigned int flags)
138 lower = center -
min(center, size / 2);
139 return min(lower, upper - size);
142 static void mxr_vp_fix_geometry(
struct mxr_layer *layer,
148 unsigned long x_center, y_center;
210 .
release = mxr_vp_layer_release,
211 .buffer_set = mxr_vp_buffer_set,
212 .stream_set = mxr_vp_stream_set,
213 .format_set = mxr_vp_format_set,
214 .fix_geometry = mxr_vp_fix_geometry,
222 mxr_err(mdev,
"failed to initialize layer(%d) base\n", idx);