done = priv->active_vb2_buf[priv->ipu_buf_num];
if (done) {
- done->vbuf.field = vdev->fmt.fmt.pix.field;
+ done->vbuf.field = vdev->fmt.field;
done->vbuf.sequence = priv->frame_sequence;
vb = &done->vbuf.vb2_buf;
vb->timestamp = ktime_get_ns();
ipu_idmac_clear_buffer(ch, priv->ipu_buf_num);
if (priv->interweave_swap && ch == priv->out_ch)
- phys += vdev->fmt.fmt.pix.bytesperline;
+ phys += vdev->fmt.bytesperline;
ipu_cpmem_set_buffer(ch, priv->ipu_buf_num, phys);
}
ipu_cpmem_zero(channel);
memset(&image, 0, sizeof(image));
- image.pix = vdev->fmt.fmt.pix;
+ image.pix = vdev->fmt;
image.rect = vdev->compose;
/*
int ret;
infmt = &priv->format_mbus[PRPENCVF_SINK_PAD];
- outfmt = &vdev->fmt.fmt.pix;
+ outfmt = &vdev->fmt;
incc = priv->cc[PRPENCVF_SINK_PAD];
outcc = vdev->cc;
int ret;
infmt = &priv->format_mbus[PRPENCVF_SINK_PAD];
- outfmt = &vdev->fmt.fmt.pix;
+ outfmt = &vdev->fmt;
incc = priv->cc[PRPENCVF_SINK_PAD];
outcc = vdev->cc;
{
struct imx_ic_priv *ic_priv = priv->ic_priv;
struct imx_media_video_dev *vdev = priv->vdev;
- struct v4l2_pix_format *outfmt;
int ret;
ret = prp_get_ipu_resources(priv);
if (ret)
return ret;
- outfmt = &vdev->fmt.fmt.pix;
-
ret = imx_media_alloc_dma_buf(ic_priv->ipu_dev, &priv->underrun_buf,
- outfmt->sizeimage);
+ vdev->fmt.sizeimage);
if (ret)
goto out_put_ipu;
{
struct capture_priv *priv = video_drvdata(file);
- *f = priv->vdev.fmt;
+ f->fmt.pix = priv->vdev.fmt;
return 0;
}
if (ret)
return ret;
- priv->vdev.fmt.fmt.pix = f->fmt.pix;
+ priv->vdev.fmt = f->fmt.pix;
return 0;
}
*/
s->r.left = 0;
s->r.top = 0;
- s->r.width = priv->vdev.fmt.fmt.pix.width;
- s->r.height = priv->vdev.fmt.fmt.pix.height;
+ s->r.width = priv->vdev.fmt.width;
+ s->r.height = priv->vdev.fmt.height;
break;
default:
return -EINVAL;
struct device *alloc_devs[])
{
struct capture_priv *priv = vb2_get_drv_priv(vq);
- struct v4l2_pix_format *pix = &priv->vdev.fmt.fmt.pix;
+ struct v4l2_pix_format *pix = &priv->vdev.fmt;
unsigned int count = *nbuffers;
if (vq->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
{
struct vb2_queue *vq = vb->vb2_queue;
struct capture_priv *priv = vb2_get_drv_priv(vq);
- struct v4l2_pix_format *pix = &priv->vdev.fmt.fmt.pix;
+ struct v4l2_pix_format *pix = &priv->vdev.fmt;
if (vb2_plane_size(vb, 0) < pix->sizeimage) {
dev_err(priv->dev,
if (ret)
return ret;
- return (priv->vdev.fmt.fmt.pix.width != f.fmt.pix.width ||
- priv->vdev.fmt.fmt.pix.height != f.fmt.pix.height ||
+ return (priv->vdev.fmt.width != f.fmt.pix.width ||
+ priv->vdev.fmt.height != f.fmt.pix.height ||
priv->vdev.cc->cs != cc->cs ||
priv->vdev.compose.width != compose.width ||
priv->vdev.compose.height != compose.height) ? -EINVAL : 0;
return ret;
}
- vdev->fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- imx_media_mbus_fmt_to_pix_fmt(&vdev->fmt.fmt.pix,
- &fmt_src.format, NULL);
+ imx_media_mbus_fmt_to_pix_fmt(&vdev->fmt, &fmt_src.format, NULL);
vdev->compose.width = fmt_src.format.width;
vdev->compose.height = fmt_src.format.height;
- vdev->cc = imx_media_find_pixel_format(vdev->fmt.fmt.pix.pixelformat,
+ vdev->cc = imx_media_find_pixel_format(vdev->fmt.pixelformat,
PIXFMT_SEL_ANY);
/* Register the video device. */
done = priv->active_vb2_buf[priv->ipu_buf_num];
if (done) {
- done->vbuf.field = vdev->fmt.fmt.pix.field;
+ done->vbuf.field = vdev->fmt.field;
done->vbuf.sequence = priv->frame_sequence;
vb = &done->vbuf.vb2_buf;
vb->timestamp = ktime_get_ns();
ipu_idmac_clear_buffer(priv->idmac_ch, priv->ipu_buf_num);
if (priv->interweave_swap)
- phys += vdev->fmt.fmt.pix.bytesperline;
+ phys += vdev->fmt.bytesperline;
ipu_cpmem_set_buffer(priv->idmac_ch, priv->ipu_buf_num, phys);
}
ipu_cpmem_zero(priv->idmac_ch);
memset(&image, 0, sizeof(image));
- image.pix = vdev->fmt.fmt.pix;
+ image.pix = vdev->fmt;
image.rect = vdev->compose;
csi_idmac_setup_vb2_buf(priv, phys);
static int csi_idmac_start(struct csi_priv *priv)
{
struct imx_media_video_dev *vdev = priv->vdev;
- struct v4l2_pix_format *outfmt;
int ret;
ret = csi_idmac_get_ipu_resources(priv);
ipu_smfc_map_channel(priv->smfc, priv->csi_id, priv->vc_num);
- outfmt = &vdev->fmt.fmt.pix;
-
ret = imx_media_alloc_dma_buf(priv->dev, &priv->underrun_buf,
- outfmt->sizeimage);
+ vdev->fmt.sizeimage);
if (ret)
goto out_put_ipu;
ipu_cpmem_zero(channel);
memset(&image, 0, sizeof(image));
- image.pix = vdev->fmt.fmt.pix;
+ image.pix = vdev->fmt;
image.rect = vdev->compose;
/* one field to VDIC channels */
image.pix.height /= 2;
struct video_device *vfd;
/* the user format */
- struct v4l2_format fmt;
+ struct v4l2_pix_format fmt;
/* the compose rectangle */
struct v4l2_rect compose;
const struct imx_media_pixfmt *cc;
done = csi->active_vb2_buf[csi->buf_num];
if (done) {
- done->vbuf.field = vdev->fmt.fmt.pix.field;
+ done->vbuf.field = vdev->fmt.field;
done->vbuf.sequence = csi->frame_sequence;
vb = &done->vbuf.vb2_buf;
vb->timestamp = ktime_get_ns();
static int imx7_csi_dma_start(struct imx7_csi *csi)
{
struct imx_media_video_dev *vdev = csi->vdev;
- struct v4l2_pix_format *out_pix = &vdev->fmt.fmt.pix;
int ret;
ret = imx_media_alloc_dma_buf(csi->dev, &csi->underrun_buf,
- out_pix->sizeimage);
+ vdev->fmt.sizeimage);
if (ret < 0) {
v4l2_warn(&csi->sd, "consider increasing the CMA area\n");
return ret;
static int imx7_csi_configure(struct imx7_csi *csi)
{
struct imx_media_video_dev *vdev = csi->vdev;
- struct v4l2_pix_format *out_pix = &vdev->fmt.fmt.pix;
+ struct v4l2_pix_format *out_pix = &vdev->fmt;
__u32 in_code = csi->format_mbus[IMX7_CSI_PAD_SINK].code;
u32 cr1, cr18;
int width = out_pix->width;