Revert "media: vivid: fix wrong sizeimage value for mplane"
This reverts commit fd87bc3da5
.
This commit is contained in:
parent
3c26f43512
commit
23f35dbaf9
2 changed files with 9 additions and 12 deletions
|
@ -113,9 +113,8 @@ static int vid_cap_queue_setup(struct vb2_queue *vq,
|
|||
if (*nplanes != buffers)
|
||||
return -EINVAL;
|
||||
for (p = 0; p < buffers; p++) {
|
||||
if (sizes[p] < tpg_g_line_width(&dev->tpg, p) * h /
|
||||
dev->fmt_cap->vdownsampling[p] +
|
||||
dev->fmt_cap->data_offset[p])
|
||||
if (sizes[p] < tpg_g_line_width(&dev->tpg, p) * h +
|
||||
dev->fmt_cap->data_offset[p])
|
||||
return -EINVAL;
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -63,16 +63,14 @@ static int vid_out_queue_setup(struct vb2_queue *vq,
|
|||
if (sizes[0] < size)
|
||||
return -EINVAL;
|
||||
for (p = 1; p < planes; p++) {
|
||||
if (sizes[p] < dev->bytesperline_out[p] * h /
|
||||
vfmt->vdownsampling[p] +
|
||||
vfmt->data_offset[p])
|
||||
if (sizes[p] < dev->bytesperline_out[p] * h +
|
||||
vfmt->data_offset[p])
|
||||
return -EINVAL;
|
||||
}
|
||||
} else {
|
||||
for (p = 0; p < planes; p++)
|
||||
sizes[p] = p ? dev->bytesperline_out[p] * h /
|
||||
vfmt->vdownsampling[p] +
|
||||
vfmt->data_offset[p] : size;
|
||||
sizes[p] = p ? dev->bytesperline_out[p] * h +
|
||||
vfmt->data_offset[p] : size;
|
||||
}
|
||||
|
||||
if (vq->num_buffers + *nbuffers < 2)
|
||||
|
@ -129,7 +127,7 @@ static int vid_out_buf_prepare(struct vb2_buffer *vb)
|
|||
|
||||
for (p = 0; p < planes; p++) {
|
||||
if (p)
|
||||
size = dev->bytesperline_out[p] * h / vfmt->vdownsampling[p];
|
||||
size = dev->bytesperline_out[p] * h;
|
||||
size += vb->planes[p].data_offset;
|
||||
|
||||
if (vb2_get_plane_payload(vb, p) < size) {
|
||||
|
@ -336,8 +334,8 @@ int vivid_g_fmt_vid_out(struct file *file, void *priv,
|
|||
for (p = 0; p < mp->num_planes; p++) {
|
||||
mp->plane_fmt[p].bytesperline = dev->bytesperline_out[p];
|
||||
mp->plane_fmt[p].sizeimage =
|
||||
mp->plane_fmt[p].bytesperline * mp->height /
|
||||
fmt->vdownsampling[p] + fmt->data_offset[p];
|
||||
mp->plane_fmt[p].bytesperline * mp->height +
|
||||
fmt->data_offset[p];
|
||||
}
|
||||
for (p = fmt->buffers; p < fmt->planes; p++) {
|
||||
unsigned stride = dev->bytesperline_out[p];
|
||||
|
|
Loading…
Reference in a new issue