|
@@ -2955,6 +2955,12 @@ static size_t __vb2_perform_fileio(struct vb2_queue *q, char __user *data, size_
|
|
buf->queued = 0;
|
|
buf->queued = 0;
|
|
buf->size = read ? vb2_get_plane_payload(q->bufs[index], 0)
|
|
buf->size = read ? vb2_get_plane_payload(q->bufs[index], 0)
|
|
: vb2_plane_size(q->bufs[index], 0);
|
|
: vb2_plane_size(q->bufs[index], 0);
|
|
|
|
+ /* Compensate for data_offset on read in the multiplanar case. */
|
|
|
|
+ if (is_multiplanar && read &&
|
|
|
|
+ fileio->b.m.planes[0].data_offset < buf->size) {
|
|
|
|
+ buf->pos = fileio->b.m.planes[0].data_offset;
|
|
|
|
+ buf->size -= buf->pos;
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
buf = &fileio->bufs[index];
|
|
buf = &fileio->bufs[index];
|
|
}
|
|
}
|