#define FIMC_IS_MAX_SENSOR_NAME_LEN (16)
+#define FIMC_IS_IOCTL_S_CTRL 0x1000
+#define FIMC_IS_IOCTL_G_CTRL 0x2000
+
#define FIMC_IS_A5_MEM_SIZE (0x01400000)
#define FIMC_IS_REGION_SIZE (0x00005000)
#define FIMC_IS_SETFILE_SIZE (0x00140000)
return ret;
}
-static int csi_s_format(struct v4l2_subdev *subdev, struct v4l2_mbus_framefmt *fmt)
+static int csi_set_format(struct v4l2_subdev *sd,
+ struct v4l2_subdev_pad_config *cfg,
+ struct v4l2_subdev_format *format)
{
- int ret = 0;
struct fimc_is_device_csi *csi;
+ struct v4l2_mbus_framefmt *fmt;
- BUG_ON(!subdev);
- BUG_ON(!fmt);
+ BUG_ON(!sd);
+ BUG_ON(!format);
- csi = v4l2_get_subdevdata(subdev);
+ csi = v4l2_get_subdevdata(sd);
if (!csi) {
err("csi is NULL");
return -EINVAL;
}
+ fmt = &format->format;
+
csi->image.window.offs_h = 0;
csi->image.window.offs_v = 0;
csi->image.window.width = fmt->width;
csi->image.format.pixelformat = fmt->code;
csi->image.format.field = fmt->field;
- mdbgd_front("%s(%dx%d, %X)\n", csi, __func__, fmt->width, fmt->height, fmt->code);
- return ret;
+ mdbgd_front("%s(%dx%d, %X)\n", csi, __func__, fmt->width,fmt->height,
+ fmt->code);
+ return 0;
}
+static const struct v4l2_subdev_pad_ops pad_ops = {
+ .set_fmt = csi_set_format
+};
+
static const struct v4l2_subdev_video_ops video_ops = {
.s_stream = csi_s_stream,
.s_parm = csi_s_param,
- .s_mbus_fmt = csi_s_format
};
static const struct v4l2_subdev_ops subdev_ops = {
.core = &core_ops,
- .video = &video_ops
+ .pad = &pad_ops,
+ .video = &video_ops,
};
#ifdef DBG_CSIISR
return ret;
}
-/* value : csi ch */
-static long flite_init(struct v4l2_subdev *subdev, unsigned int cmd,
- void *value)
+/* cmd: 0, value : csi ch */
+static long flite_subdev_ioctl(struct v4l2_subdev *subdev, unsigned int cmd,
+ void *value)
{
- int ret = 0;
struct fimc_is_device_flite *flite;
+ struct v4l2_control *ctrl;
+ u32 width, height, ratio;
BUG_ON(!subdev);
flite = v4l2_get_subdevdata(subdev);
if (!flite) {
err("flite is NULL");
- ret = -EINVAL;
- goto p_err;
+ return -EINVAL;
}
- flite->csi = (long)value;
+ switch (cmd) {
+ case 0:
+ flite->csi = (long)value;
+ break;
-p_err:
- return ret;
+ case FIMC_IS_IOCTL_S_CTRL:
+ ctrl = value;
+ if (ctrl->id == V4L2_CID_IS_S_BNS) {
+ width = flite->image.window.width;
+ height = flite->image.window.height;
+ ratio = ctrl->value;
+
+ flite->image.window.otf_width
+ = rounddown((width * 1000 / ratio), 4);
+ flite->image.window.otf_height
+ = rounddown((height * 1000 / ratio), 2);
+ } else {
+ err("Unsupported ctrl->id: %#x", ctrl->id);
+ }
+ break;
+ default:
+ err("Unsupported ioctl: %#x", cmd);
+ return -EINVAL;
+ }
+
+ return 0;
}
static int flite_stream_on(struct v4l2_subdev *subdev,
return 0;
}
-static int flite_s_format(struct v4l2_subdev *subdev, struct v4l2_mbus_framefmt *fmt)
+static int flite_set_format(struct v4l2_subdev *sd,
+ struct v4l2_subdev_pad_config *cfg,
+ struct v4l2_subdev_format *format)
{
int ret = 0;
struct fimc_is_device_flite *flite;
+ struct v4l2_mbus_framefmt *fmt;
- BUG_ON(!subdev);
- BUG_ON(!fmt);
+ BUG_ON(!sd);
+ BUG_ON(!format);
- flite = v4l2_get_subdevdata(subdev);
+ fmt = &format->format;
+
+ flite = v4l2_get_subdevdata(sd);
if (!flite) {
err("flite is NULL");
ret = -EINVAL;
return ret;
}
-static int flite_s_ctrl(struct v4l2_subdev *subdev, struct v4l2_control *ctrl)
-{
- int ret = 0;
- struct fimc_is_device_flite *flite;
-
- BUG_ON(!subdev);
- BUG_ON(!ctrl);
-
- flite = v4l2_get_subdevdata(subdev);
- if (!flite) {
- err("flite is NULL");
- ret = -EINVAL;
- goto p_err;
- }
-
- switch (ctrl->id) {
- case V4L2_CID_IS_S_BNS:
- {
- u32 width, height, ratio;
-
- width = flite->image.window.width;
- height = flite->image.window.height;
- ratio = ctrl->value;
-
- flite->image.window.otf_width
- = rounddown((width * 1000 / ratio), 4);
- flite->image.window.otf_height
- = rounddown((height * 1000 / ratio), 2);
- }
- break;
- default:
- err("unsupported ioctl(%d)\n", ctrl->id);
- ret = -EINVAL;
- break;
- }
-
-p_err:
- return ret;
-}
-
static const struct v4l2_subdev_core_ops core_ops = {
- .ioctl = flite_init,
- .s_ctrl = flite_s_ctrl,
+ .ioctl = flite_subdev_ioctl,
+};
+
+static const struct v4l2_subdev_pad_ops pad_ops = {
+ .set_fmt = flite_set_format
};
static const struct v4l2_subdev_video_ops video_ops = {
.s_stream = flite_s_stream,
- .s_mbus_fmt = flite_s_format
};
static const struct v4l2_subdev_ops subdev_ops = {
.core = &core_ops,
+ .pad = &pad_ops,
.video = &video_ops
};
struct v4l2_subdev *subdev_csi;
struct v4l2_subdev *subdev_flite;
struct fimc_is_module_enum *module;
- struct v4l2_mbus_framefmt subdev_format;
+ struct v4l2_subdev_format subdev_format;
BUG_ON(!device);
BUG_ON(!device->subdev_module);
device->image.window.height = height;
device->image.window.o_height = height;
- subdev_format.code = format->pixelformat;
- subdev_format.field = format->field;
- subdev_format.width = width;
- subdev_format.height = height;
+ subdev_format.format.code = format->pixelformat;
+ subdev_format.format.field = format->field;
+ subdev_format.format.width = width;
+ subdev_format.format.height = height;
if (test_bit(FIMC_IS_SENSOR_DRIVING, &device->state)) {
- ret = v4l2_subdev_call(subdev_module, video, s_mbus_fmt, &subdev_format);
+ ret = v4l2_subdev_call(subdev_module, pad, set_fmt, NULL,
+ &subdev_format);
if (ret) {
merr("v4l2_module_call(s_format) failed(%d)", device, ret);
goto p_err;
}
}
- ret = v4l2_subdev_call(subdev_csi, video, s_mbus_fmt, &subdev_format);
+ ret = v4l2_subdev_call(subdev_csi, pad, set_fmt, NULL, &subdev_format);
if (ret) {
merr("v4l2_csi_call(s_format) failed(%d)", device, ret);
goto p_err;
}
- ret = v4l2_subdev_call(subdev_flite, video, s_mbus_fmt, &subdev_format);
+ ret = v4l2_subdev_call(subdev_flite, pad, set_fmt, NULL, &subdev_format);
if (ret) {
merr("v4l2_flite_call(s_format) failed(%d)", device, ret);
goto p_err;
int fimc_is_sensor_s_ctrl(struct fimc_is_device_sensor *device,
struct v4l2_control *ctrl)
{
- int ret = 0;
- struct v4l2_subdev *subdev_module;
+ int ret;
BUG_ON(!device);
BUG_ON(!device->subdev_module);
BUG_ON(!device->subdev_csi);
BUG_ON(!ctrl);
- subdev_module = device->subdev_module;
-
- ret = v4l2_subdev_call(subdev_module, core, s_ctrl, ctrl);
- if (ret) {
- err("s_ctrl failed(%d)", ret);
- goto p_err;
- }
+ ret = v4l2_subdev_call(device->subdev_module, core, ioctl,
+ FIMC_IS_IOCTL_S_CTRL, ctrl);
+ if (ret)
+ err("FIMC_IS_IOCTL_S_CTRL failed: %d", ret);
-p_err:
return ret;
}
}
int fimc_is_sensor_g_ctrl(struct fimc_is_device_sensor *device,
- struct v4l2_control *ctrl)
+ struct v4l2_control *ctrl)
{
- int ret = 0;
- struct v4l2_subdev *subdev_module;
+ int ret;
BUG_ON(!device);
BUG_ON(!device->subdev_module);
BUG_ON(!device->subdev_csi);
BUG_ON(!ctrl);
- subdev_module = device->subdev_module;
-
- ret = v4l2_subdev_call(subdev_module, core, g_ctrl, ctrl);
- if (ret) {
- err("g_ctrl failed(%d)", ret);
- goto p_err;
- }
+ ret = v4l2_subdev_call(device->subdev_module, core, ioctl,
+ FIMC_IS_IOCTL_G_CTRL, ctrl);
+ if (ret)
+ err("FIMC_IS_IOCTL_G_CTRL failed: %d", ret);
-p_err:
return ret;
}
return kvaddr;
}
-
-static void *fimc_is_dma_contig_init(struct platform_device *pdev)
-{
- return vb2_dma_contig_init_ctx(&pdev->dev);
-}
-
int vb2_null_attach_iommu(void *alloc_ctx)
{
return 0;
}
-const struct fimc_is_vb2 fimc_is_vb2_dc = {
+static const struct fimc_is_vb2 fimc_is_vb2_dc = {
.ops = &vb2_dma_contig_memops,
- .init = fimc_is_dma_contig_init,
.cleanup = vb2_null_destroy_context,
.plane_addr = plane_addr,
.plane_kvaddr = plane_kvaddr,
.suspend = vb2_null_detach_iommu,
.set_cacheable = vb2_null_set_cached,
};
-#define fimc_is_vb2_allocator (&fimc_is_vb2_dc)
-int fimc_is_mem_probe(struct fimc_is_mem *this,
- struct platform_device *pdev)
+int fimc_is_mem_probe(struct fimc_is_mem *this, struct platform_device *pdev)
{
- u32 ret = 0;
+ this->vb2 = &fimc_is_vb2_dc;
- this->vb2 = fimc_is_vb2_allocator;
-
- this->alloc_ctx = this->vb2->init(pdev);
- if (IS_ERR(this->alloc_ctx)) {
- ret = PTR_ERR(this->alloc_ctx);
- goto p_err;
- }
-
-p_err:
- return ret;
+ this->pdev = pdev;
+ return 0;
}
struct fimc_is_mem {
struct platform_device *pdev;
- struct vb2_alloc_ctx *alloc_ctx;
-
const struct fimc_is_vb2 *vb2;
};
struct fimc_is_fmt {
char *name;
- enum v4l2_mbus_pixelcode mbus_code;
+ u32 mbus_code;
u32 pixelformat;
u32 field;
u32 num_planes;
};
static int fimc_is_3aa_queue_setup(struct vb2_queue *vbq,
- const struct v4l2_format *fmt,
unsigned int *num_buffers,
unsigned int *num_planes,
unsigned int sizes[],
- void *allocators[])
+ struct device *alloc_devs[])
{
int ret = 0;
struct fimc_is_video_ctx *vctx = vbq->drv_priv;
queue = GET_VCTX_QUEUE(vctx, vbq);
video = vctx->video;
- ret = fimc_is_queue_setup(queue,
- video->alloc_ctx,
- num_planes,
- sizes,
- allocators);
+ ret = fimc_is_queue_setup(queue, video->alloc_dev,
+ num_planes, sizes, alloc_devs);
if (ret)
merr("fimc_is_queue_setup failed(%d)", vctx, ret);
struct fimc_is_queue *queue;
BUG_ON(!vctx);
- index = vb->v4l2_buf.index;
+ index = vb->index;
#ifdef DBG_STREAMING
- mdbgv_3aa("%s(%02d:%d)\n", vctx, __func__, vb->v4l2_buf.type, index);
+ mdbgv_3aa("%s(%02d:%d)\n", vctx, __func__, vb->type, index);
#endif
video = vctx->video;
device = vctx->device;
leader = &device->group_3aa.leader;
- if (V4L2_TYPE_IS_OUTPUT(vb->v4l2_buf.type)) {
+ if (V4L2_TYPE_IS_OUTPUT(vb->type)) {
queue = GET_SRC_QUEUE(vctx);
ret = fimc_is_queue_buffer_queue(queue, video->vb2, vb);
if (ret) {
static void fimc_is_3aa_buffer_finish(struct vb2_buffer *vb)
{
- u32 index = vb->v4l2_buf.index;
+ u32 index = vb->index;
struct fimc_is_video_ctx *vctx = vb->vb2_queue->drv_priv;
struct fimc_is_device_ischain *device = vctx->device;
struct fimc_is_group *group = &device->group_3aa;
BUG_ON(!device);
#ifdef DBG_STREAMING
- mdbgv_3aa("%s(%02d:%d)\n", vctx, __func__, vb->v4l2_buf.type, index);
+ mdbgv_3aa("%s(%02d:%d)\n", vctx, __func__, vb->type, index);
#endif
- if (V4L2_TYPE_IS_OUTPUT(vb->v4l2_buf.type)) {
+ if (V4L2_TYPE_IS_OUTPUT(vb->type)) {
queue = vctx->q_src;
fimc_is_ischain_3aa_buffer_finish(device, index);
} else {
};
static int fimc_is_3aac_queue_setup(struct vb2_queue *vbq,
- const struct v4l2_format *fmt,
unsigned int *num_buffers,
unsigned int *num_planes,
unsigned int sizes[],
- void *allocators[])
+ struct device *alloc_devs[])
{
int ret = 0;
struct fimc_is_video_ctx *vctx = vbq->drv_priv;
queue = GET_VCTX_QUEUE(vctx, vbq);
video = vctx->video;
- ret = fimc_is_queue_setup(queue,
- video->alloc_ctx,
- num_planes,
- sizes,
- allocators);
+ ret = fimc_is_queue_setup(queue, video->alloc_dev,
+ num_planes, sizes, alloc_devs);
if (ret)
merr("fimc_is_queue_setup failed(%d)", vctx, ret);
BUG_ON(!vctx);
#ifdef DBG_STREAMING
- mdbgv_3aac("%s(%d)\n", vctx, __func__, vb->v4l2_buf.index);
+ mdbgv_3aac("%s(%d)\n", vctx, __func__, vb->index);
#endif
queue = GET_DST_QUEUE(vctx);
return;
}
- ret = fimc_is_subdev_buffer_queue(subdev, vb->v4l2_buf.index);
+ ret = fimc_is_subdev_buffer_queue(subdev, vb->index);
if (ret) {
merr("fimc_is_subdev_buffer_queue failed(%d)", vctx, ret);
return;
struct fimc_is_subdev *subdev = &ischain->taac;
#ifdef DBG_STREAMING
- mdbgv_3aac("%s(%d)\n", vctx, __func__, vb->v4l2_buf.index);
+ mdbgv_3aac("%s(%d)\n", vctx, __func__, vb->index);
#endif
- fimc_is_subdev_buffer_finish(subdev, vb->v4l2_buf.index);
+ fimc_is_subdev_buffer_finish(subdev, vb->index);
}
const struct vb2_ops fimc_is_3aac_qops = {
};
static int fimc_is_isp_queue_setup(struct vb2_queue *vbq,
- const struct v4l2_format *fmt,
unsigned int *num_buffers, unsigned int *num_planes,
unsigned int sizes[],
- void *allocators[])
+ struct device *alloc_devs[])
{
int ret = 0;
struct fimc_is_video_ctx *vctx = vbq->drv_priv;
queue = GET_SRC_QUEUE(vctx);
video = vctx->video;
- ret = fimc_is_queue_setup(queue,
- video->alloc_ctx,
- num_planes,
- sizes,
- allocators);
+ ret = fimc_is_queue_setup(queue, video->alloc_dev,
+ num_planes, sizes, alloc_devs);
if (ret)
merr("fimc_is_queue_setup failed(%d)", vctx, ret);
struct fimc_is_device_ischain *device;
BUG_ON(!vctx);
- index = vb->v4l2_buf.index;
+ index = vb->index;
#ifdef DBG_STREAMING
mdbgv_isp("%s(%d)\n", vctx, __func__, index);
}
#ifdef DBG_STREAMING
- mdbgv_isp("%s(%d)\n", vctx, __func__, vb->v4l2_buf.index);
+ mdbgv_isp("%s(%d)\n", vctx, __func__, vb->index);
#endif
- fimc_is_ischain_isp_buffer_finish(device, vb->v4l2_buf.index);
+ fimc_is_ischain_isp_buffer_finish(device, vb->index);
}
const struct vb2_ops fimc_is_isp_qops = {
};
static int fimc_is_scc_queue_setup(struct vb2_queue *vbq,
- const struct v4l2_format *fmt,
unsigned int *num_buffers,
unsigned int *num_planes, unsigned int sizes[],
- void *allocators[])
+ struct device *alloc_devs[])
{
int ret = 0;
struct fimc_is_video_ctx *vctx = vbq->drv_priv;
queue = GET_DST_QUEUE(vctx);
video = vctx->video;
- ret = fimc_is_queue_setup(queue,
- video->alloc_ctx,
- num_planes,
- sizes,
- allocators);
+ ret = fimc_is_queue_setup(queue, video->alloc_dev,
+ num_planes, sizes, alloc_devs);
if (ret)
merr("fimc_is_queue_setup failed(%d)", vctx, ret);
return;
}
- ret = fimc_is_subdev_buffer_queue(scc, vb->v4l2_buf.index);
+ ret = fimc_is_subdev_buffer_queue(scc, vb->index);
if (ret) {
merr("fimc_is_subdev_buffer_queue failed(%d)", vctx, ret);
return;
BUG_ON(!vctx);
#ifdef DBG_STREAMING
- mdbgv_scc("%s(%d)\n", vctx, __func__, vb->v4l2_buf.index);
+ mdbgv_scc("%s(%d)\n", vctx, __func__, vb->index);
#endif
device = vctx->device;
subdev = &device->scc;
- fimc_is_subdev_buffer_finish(subdev, vb->v4l2_buf.index);
+ fimc_is_subdev_buffer_finish(subdev, vb->index);
}
const struct vb2_ops fimc_is_scc_qops = {
};
static int fimc_is_scp_queue_setup(struct vb2_queue *vbq,
- const struct v4l2_format *fmt,
unsigned int *num_buffers,
unsigned int *num_planes,
unsigned int sizes[],
- void *allocators[])
+ struct device *alloc_devs[])
{
int ret = 0;
struct fimc_is_video_ctx *vctx = vbq->drv_priv;
queue = GET_DST_QUEUE(vctx);
video = vctx->video;
- ret = fimc_is_queue_setup(queue,
- video->alloc_ctx,
- num_planes,
- sizes,
- allocators);
+ ret = fimc_is_queue_setup(queue, video->alloc_dev,
+ num_planes, sizes, alloc_devs);
if (ret)
merr("fimc_is_queue_setup failed(%d)", vctx, ret);
return;
}
- ret = fimc_is_subdev_buffer_queue(subdev, vb->v4l2_buf.index);
+ ret = fimc_is_subdev_buffer_queue(subdev, vb->index);
if (ret) {
merr("fimc_is_subdev_buffer_queue failed(%d)", vctx, ret);
return;
struct fimc_is_subdev *scp = &ischain->scp;
#ifdef DBG_STREAMING
- dbg_scp("%s(%d)\n", __func__, vb->v4l2_buf.index);
+ dbg_scp("%s(%d)\n", __func__, vb->index);
#endif
- fimc_is_subdev_buffer_finish(scp, vb->v4l2_buf.index);
+ fimc_is_subdev_buffer_finish(scp, vb->index);
}
const struct vb2_ops fimc_is_scp_qops = {
goto p_err;
}
- ret = v4l2_subdev_call(subdev_flite, core, s_ctrl, ctrl);
+ ret = v4l2_subdev_call(subdev_flite, core, ioctl,
+ FIMC_IS_IOCTL_S_CTRL, ctrl);
if (ret) {
merr("v4l2_flite_call(s_ctrl) failed(%d)", device, ret);
goto p_err;
};
static int fimc_is_sen_queue_setup(struct vb2_queue *vbq,
- const struct v4l2_format *fmt,
unsigned int *num_buffers, unsigned int *num_planes,
- unsigned int sizes[],
- void *allocators[])
+ unsigned int sizes[], struct device *alloc_devs[])
{
int ret = 0;
struct fimc_is_video_ctx *vctx = vbq->drv_priv;
queue = GET_DST_QUEUE(vctx);
video = vctx->video;
- ret = fimc_is_queue_setup(queue,
- video->alloc_ctx,
- num_planes,
- sizes,
- allocators);
+ ret = fimc_is_queue_setup(queue, video->alloc_dev, num_planes,
+ sizes, alloc_devs);
if (ret)
merr("fimc_is_queue_setup failed(%d)", vctx, ret);
struct fimc_is_device_sensor *device;
#ifdef DBG_STREAMING
- mdbgv_sensor("%s(%d)\n", vctx, __func__, vb->v4l2_buf.index);
+ mdbgv_sensor("%s(%d)\n", vctx, __func__, vb->index);
#endif
queue = GET_DST_QUEUE(vctx);
return;
}
- ret = fimc_is_sensor_buffer_queue(device, vb->v4l2_buf.index);
+ ret = fimc_is_sensor_buffer_queue(device, vb->index);
if (ret) {
merr("fimc_is_sensor_buffer_queue failed(%d)", device, ret);
return;
struct fimc_is_device_sensor *device;
#ifdef DBG_STREAMING
- mdbgv_sensor("%s(%d)\n", vctx, __func__, vb->v4l2_buf.index);
+ mdbgv_sensor("%s(%d)\n", vctx, __func__, vb->index);
#endif
device = vctx->device;
- ret = fimc_is_sensor_buffer_finish(
- device,
- vb->v4l2_buf.index);
+ ret = fimc_is_sensor_buffer_finish(device, vb->index);
if (ret)
merr("fimc_is_sensor_buffer_finish failed(%d)", device, ret);
}
};
static int fimc_is_vdc_queue_setup(struct vb2_queue *vbq,
- const struct v4l2_format *fmt,
unsigned int *num_buffers,
unsigned int *num_planes,
unsigned int sizes[],
- void *allocators[])
+ struct device *alloc_devs[])
{
int ret = 0;
struct fimc_is_video_ctx *vctx = vbq->drv_priv;
queue = GET_DST_QUEUE(vctx);
video = vctx->video;
- ret = fimc_is_queue_setup(queue,
- video->alloc_ctx,
- num_planes,
- sizes,
- allocators);
+ ret = fimc_is_queue_setup(queue, video->alloc_dev,
+ num_planes, sizes, alloc_devs);
if (ret)
merr("fimc_is_queue_setup failed(%d)", vctx, ret);
return;
}
- ret = fimc_is_subdev_buffer_queue(subdev, vb->v4l2_buf.index);
+ ret = fimc_is_subdev_buffer_queue(subdev, vb->index);
if (ret) {
merr("fimc_is_subdev_buffer_queue failed(%d)", vctx, ret);
return;
struct fimc_is_subdev *dis = &ischain->dis;
#ifdef DBG_STREAMING
- dbg_vdisc("%s(%d)\n", __func__, vb->v4l2_buf.index);
+ dbg_vdisc("%s(%d)\n", __func__, vb->index);
#endif
- fimc_is_subdev_buffer_finish(dis, vb->v4l2_buf.index);
+ fimc_is_subdev_buffer_finish(dis, vb->index);
}
const struct vb2_ops fimc_is_vdc_qops = {
};
static int fimc_is_vdo_queue_setup(struct vb2_queue *vbq,
- const struct v4l2_format *fmt,
unsigned int *num_buffers, unsigned int *num_planes,
unsigned int sizes[],
- void *allocators[])
+ struct device *alloc_devs[])
{
int ret = 0;
struct fimc_is_video_ctx *vctx = vbq->drv_priv;
queue = GET_SRC_QUEUE(vctx);
video = vctx->video;
- ret = fimc_is_queue_setup(queue,
- video->alloc_ctx,
- num_planes,
- sizes,
- allocators);
+ ret = fimc_is_queue_setup(queue, video->alloc_dev,
+ num_planes, sizes, alloc_devs);
if (ret)
merr("fimc_is_queue_setup failed(%d)", vctx, ret);
struct fimc_is_device_ischain *device;
BUG_ON(!vctx);
- index = vb->v4l2_buf.index;
+ index = vb->index;
#ifdef DBG_STREAMING
dbg_vdiso("%s(%d)\n", __func__, index);
struct fimc_is_device_ischain *device = vctx->device;
#ifdef DBG_STREAMING
- mdbgv_vdo("%s(%d)\n", vctx, __func__, vb->v4l2_buf.index);
+ mdbgv_vdo("%s(%d)\n", vctx, __func__, vb->index);
#endif
- fimc_is_ischain_vdo_buffer_finish(device, vb->v4l2_buf.index);
+ fimc_is_ischain_vdo_buffer_finish(device, vb->index);
}
const struct vb2_ops fimc_is_vdo_qops = {
.name = "YUV 4:2:2 packed, YCbYCr",
.pixelformat = V4L2_PIX_FMT_YUYV,
.num_planes = 1 + SPARE_PLANE,
- .mbus_code = V4L2_MBUS_FMT_YUYV8_2X8,
+ .mbus_code = MEDIA_BUS_FMT_YUYV8_2X8,
}, {
.name = "YUV 4:2:2 packed, CbYCrY",
.pixelformat = V4L2_PIX_FMT_UYVY,
.num_planes = 1 + SPARE_PLANE,
- .mbus_code = V4L2_MBUS_FMT_UYVY8_2X8,
+ .mbus_code = MEDIA_BUS_FMT_UYVY8_2X8,
}, {
.name = "YUV 4:2:2 planar, Y/Cb/Cr",
.pixelformat = V4L2_PIX_FMT_YUV422P,
.name = "JPEG",
.pixelformat = V4L2_PIX_FMT_JPEG,
.num_planes = 1 + SPARE_PLANE,
- .mbus_code = V4L2_MBUS_FMT_JPEG_1X8,
+ .mbus_code = MEDIA_BUS_FMT_JPEG_1X8,
}
};
vbq_src->drv_priv = vctx;
vbq_src->ops = vctx->vb2_ops;
vbq_src->mem_ops = vctx->mem_ops;
+ vbq_src->dev = vctx->video->alloc_dev;
vbq_src->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY;
vbq_src->allow_zero_bytesused = 1;
vbq_dst->drv_priv = vctx;
vbq_dst->ops = vctx->vb2_ops;
vbq_dst->mem_ops = vctx->mem_ops;
+ vbq_dst->dev = vctx->video->alloc_dev;
vbq_dst->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY;
ret = vb2_queue_init(vbq_dst);
return ret;
}
-int fimc_is_queue_setup(struct fimc_is_queue *queue,
- void *alloc_ctx,
- unsigned int *num_planes,
- unsigned int sizes[],
- void *allocators[])
+int fimc_is_queue_setup(struct fimc_is_queue *queue, void *alloc_dev,
+ unsigned int *num_planes, unsigned int sizes[],
+ struct device *alloc_devs[])
{
- u32 ret = 0;
u32 plane;
BUG_ON(!queue);
- BUG_ON(!alloc_ctx);
+ BUG_ON(!alloc_dev);
BUG_ON(!num_planes);
BUG_ON(!sizes);
- BUG_ON(!allocators);
+ BUG_ON(!alloc_devs);
*num_planes = (queue->framecfg.format.num_planes);
fimc_is_set_plane_size(&queue->framecfg, sizes);
for (plane = 0; plane < *num_planes; plane++) {
- allocators[plane] = alloc_ctx;
+ alloc_devs[plane] = alloc_dev;
queue->framecfg.size[plane] = sizes[plane];
mdbgv_vid("queue[%d] size : %d\n", plane, sizes[plane]);
}
- return ret;
+ return 0;
}
int fimc_is_queue_buffer_queue(struct fimc_is_queue *queue,
struct fimc_is_framemgr *framemgr;
struct fimc_is_frame *frame;
- index = vb->v4l2_buf.index;
+ index = vb->index;
framemgr = &queue->framemgr;
BUG_ON(framemgr->id == FRAMEMGR_ID_INVALID);
snprintf(video->vd.name, sizeof(video->vd.name), "%s", video_name);
video->id = video_number;
video->vb2 = mem->vb2;
- video->alloc_ctx = mem->alloc_ctx;
+ video->alloc_dev = &mem->pdev->dev;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0))
video->vd.vfl_dir = vfl_dir;
#endif
#define FIMC_IS_VIDEO_VDC_NAME FIMC_IS_VIDEO_NAME("vdisc")
#define FIMC_IS_VIDEO_VDO_NAME FIMC_IS_VIDEO_NAME("vdiso")
+struct device;
struct fimc_is_device_ischain;
struct fimc_is_subdev;
struct fimc_is_queue;
struct video_device vd;
struct media_pad pads;
const struct fimc_is_vb2 *vb2;
- void *alloc_ctx;
+ struct device *alloc_dev;
};
struct fimc_is_core *fimc_is_video_ctx_2_core(struct fimc_is_video_ctx *vctx);
struct fimc_is_video_ctx *vctx);
/* queue operation */
-int fimc_is_queue_setup(struct fimc_is_queue *queue,
- void *alloc_ctx,
- unsigned int *num_planes,
- unsigned int sizes[],
- void *allocators[]);
+int fimc_is_queue_setup(struct fimc_is_queue *queue, void *alloc_ctx,
+ unsigned int *num_planes, unsigned int sizes[],
+ struct device *alloc_devs[]);
+
int fimc_is_queue_buffer_queue(struct fimc_is_queue *queue,
const struct fimc_is_vb2 *vb2,
struct vb2_buffer *vb);
return ret;
}
-static int sensor_6d1_s_format(struct v4l2_subdev *subdev, struct v4l2_mbus_framefmt *fmt)
+static int sensor_6d1_set_format(struct v4l2_subdev *sd,
+ struct v4l2_subdev_pad_config *cfg,
+ struct v4l2_subdev_format *format)
{
/* TODO */
return 0;
}
+static const struct v4l2_subdev_pad_ops pad_ops = {
+ .set_fmt = sensor_6d1_set_format
+};
+
static const struct v4l2_subdev_video_ops video_ops = {
.s_stream = sensor_6d1_s_stream,
.s_parm = sensor_6d1_s_param,
- .s_mbus_fmt = sensor_6d1_s_format
};
static const struct v4l2_subdev_ops subdev_ops = {
.core = &core_ops,
+ .pad = &pad_ops,
.video = &video_ops
};