|
@@ -449,19 +449,22 @@ static int queue_setup(struct vb2_queue *vq, const struct v4l2_format *pfmt,
|
|
struct camif_vp *vp = vb2_get_drv_priv(vq);
|
|
struct camif_vp *vp = vb2_get_drv_priv(vq);
|
|
struct camif_dev *camif = vp->camif;
|
|
struct camif_dev *camif = vp->camif;
|
|
struct camif_frame *frame = &vp->out_frame;
|
|
struct camif_frame *frame = &vp->out_frame;
|
|
- const struct camif_fmt *fmt = vp->out_fmt;
|
|
|
|
|
|
+ const struct camif_fmt *fmt;
|
|
unsigned int size;
|
|
unsigned int size;
|
|
|
|
|
|
if (pfmt) {
|
|
if (pfmt) {
|
|
pix = &pfmt->fmt.pix;
|
|
pix = &pfmt->fmt.pix;
|
|
fmt = s3c_camif_find_format(vp, &pix->pixelformat, -1);
|
|
fmt = s3c_camif_find_format(vp, &pix->pixelformat, -1);
|
|
|
|
+ if (fmt == NULL)
|
|
|
|
+ return -EINVAL;
|
|
size = (pix->width * pix->height * fmt->depth) / 8;
|
|
size = (pix->width * pix->height * fmt->depth) / 8;
|
|
} else {
|
|
} else {
|
|
|
|
+ fmt = vp->out_fmt;
|
|
|
|
+ if (fmt == NULL)
|
|
|
|
+ return -EINVAL;
|
|
size = (frame->f_width * frame->f_height * fmt->depth) / 8;
|
|
size = (frame->f_width * frame->f_height * fmt->depth) / 8;
|
|
}
|
|
}
|
|
|
|
|
|
- if (fmt == NULL)
|
|
|
|
- return -EINVAL;
|
|
|
|
*num_planes = 1;
|
|
*num_planes = 1;
|
|
|
|
|
|
if (pix)
|
|
if (pix)
|