@@ -37,6 +37,7 @@ config VIDEO_SAMSUNG_S5P_MIXER
depends on VIDEO_DEV && VIDEO_V4L2 && PLAT_S5P
default y
select VIDEOBUF2_S5P_IOMMU
+ select VIDEOBUF2_FB
help
Mixer driver for Samsung ARM based SoC.
@@ -134,6 +134,8 @@ struct mxr_layer_ops {
struct mxr_layer {
/** parent mixer device */
struct mxr_device *mdev;
+ /** frame buffer emulator */
+ void *fb;
/** layer index (unique identifier) */
int idx;
/** callbacks for layer methods */
@@ -17,6 +17,7 @@
#include <media/v4l2-ioctl.h>
#include <linux/videodev2.h>
#include <media/videobuf2-s5p-iommu.h>
+#include <media/videobuf2-fb.h>
#include <linux/mm.h>
#include <linux/version.h>
#include <linux/timer.h>
@@ -282,6 +283,8 @@ static int mxr_g_fmt(struct file *file, void *priv,
f->fmt.pix.field = V4L2_FIELD_NONE;
f->fmt.pix.pixelformat = layer->fmt->fourcc;
+ f->fmt.pix_mp.plane_fmt[0].sizeimage = f->fmt.pix.width * f->fmt.pix.height * 2;
+
return 0;
}
@@ -773,11 +776,18 @@ int mxr_base_layer_register(struct mxr_layer *layer)
else
mxr_info(mdev, "registered layer %s as /dev/video%d\n",
layer->vfd.name, layer->vfd.num);
+
+ layer->fb = vb2_fb_register(&layer->vb_queue, &layer->vfd);
+ if (PTR_ERR(layer->fb))
+ layer->fb = NULL;
+
return ret;
}
void mxr_base_layer_unregister(struct mxr_layer *layer)
{
+ if (layer->fb)
+ vb2_fb_unregister(layer->fb);
video_unregister_device(&layer->vfd);
}