Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 584739f5 authored by Maheshwar Ajja's avatar Maheshwar Ajja Committed by Todd Kjos
Browse files

ANDROID: v4l2-compat-ioctl32.c: copy reserved fields



Copy reserved fields along with other fields in v4l2_plane
for userspace clients and drivers to use reserved fields
when required.

Bug: 143160749
Change-Id: I0c7e7485961ab50188cda6ae81998473500bb07b
Signed-off-by: default avatarMaheshwar Ajja <majja@codeaurora.org>
parent f4d0973e
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -465,6 +465,11 @@ struct v4l2_plane32 {
		__s32		fd;
	} m;
	__u32			data_offset;
	/*
	 * few userspace clients and drivers use reserved fields
	 * and it is up to them how these fields are used. v4l2
	 * simply copy reserved fields between them.
	 */
	__u32			reserved[11];
};

@@ -499,7 +504,9 @@ static int get_v4l2_plane32(struct v4l2_plane __user *p64,

	if (copy_in_user(p64, p32, 2 * sizeof(__u32)) ||
	    copy_in_user(&p64->data_offset, &p32->data_offset,
			 sizeof(p64->data_offset)))
			 sizeof(p64->data_offset)) ||
	    copy_in_user(p64->reserved, p32->reserved,
			 sizeof(p64->reserved)))
		return -EFAULT;

	switch (memory) {
@@ -531,7 +538,9 @@ static int put_v4l2_plane32(struct v4l2_plane __user *p64,

	if (copy_in_user(p32, p64, 2 * sizeof(__u32)) ||
	    copy_in_user(&p32->data_offset, &p64->data_offset,
			 sizeof(p64->data_offset)))
			 sizeof(p64->data_offset)) ||
	    copy_in_user(p32->reserved, p64->reserved,
			 sizeof(p32->reserved)))
		return -EFAULT;

	switch (memory) {
+4 −1
Original line number Diff line number Diff line
@@ -935,7 +935,9 @@ struct v4l2_requestbuffers {
 *			descriptor associated with this plane
 * @data_offset:	offset in the plane to the start of data; usually 0,
 *			unless there is a header in front of the data
 *
 * @reserved:		few userspace clients and drivers use reserved fields
 *			and it is up to them how these fields are used. v4l2
 *			simply copy reserved fields between them.
 * Multi-planar buffers consist of one or more planes, e.g. an YCbCr buffer
 * with two planes can have one plane for Y, and another for interleaved CbCr
 * components. Each plane can reside in a separate memory buffer, or even in
@@ -950,6 +952,7 @@ struct v4l2_plane {
		__s32		fd;
	} m;
	__u32			data_offset;
	/* reserved fields used by few userspace clients and drivers */
	__u32			reserved[11];
};