20 static const struct mxr_format mxr_fb_fmt_rgb565 = {
26 { .width = 1, .height = 1, .size = 2 },
32 static const struct mxr_format mxr_fb_fmt_argb1555 = {
38 { .width = 1, .height = 1, .size = 2 },
44 static const struct mxr_format mxr_fb_fmt_argb4444 = {
50 { .width = 1, .height = 1, .size = 2 },
56 static const struct mxr_format mxr_fb_fmt_argb8888 = {
62 { .width = 1, .height = 1, .size = 4 },
68 static const struct mxr_format *mxr_graph_format[] = {
77 static void mxr_graph_layer_release(
struct mxr_layer *layer)
83 static void mxr_graph_buffer_set(
struct mxr_layer *layer,
89 addr = vb2_dma_contig_plane_dma_addr(&buf->
vb, 0);
93 static void mxr_graph_stream_set(
struct mxr_layer *layer,
int en)
98 static void mxr_graph_format_set(
struct mxr_layer *layer)
104 static inline unsigned int closest(
unsigned int x,
unsigned int a,
105 unsigned int b,
unsigned long flags)
107 unsigned int mid = (a +
b) / 2;
136 static inline unsigned int do_center(
unsigned int center,
137 unsigned int size,
unsigned int upper,
unsigned int flags)
144 lower = center -
min(center, size / 2);
145 return min(lower, upper - size);
148 static void mxr_graph_fix_geometry(
struct mxr_layer *layer,
154 unsigned int x_center, y_center;
239 .
release = mxr_graph_layer_release,
240 .buffer_set = mxr_graph_buffer_set,
241 .stream_set = mxr_graph_stream_set,
242 .format_set = mxr_graph_format_set,
243 .fix_geometry = mxr_graph_fix_geometry,
251 mxr_err(mdev,
"failed to initialize layer(%d) base\n", idx);