diff mbox

[09/10] staging/android: add flags member to sync ioctl structs

Message ID 1454102426-20637-10-git-send-email-gustavo@padovan.org (mailing list archive)
State New, archived
Headers show

Commit Message

Gustavo Padovan Jan. 29, 2016, 9:20 p.m. UTC
From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

Play safe and add flags member to all structs. So we don't need to
break API or create new IOCTL in the future if new features that requires
flags arises.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
---
 drivers/staging/android/uapi/sync.h | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Emil Velikov Jan. 30, 2016, 6:12 p.m. UTC | #1
Hi Gustavo,

> @@ -54,6 +59,7 @@ struct sync_file_info {
>         __u32   len;
As mentioned previously - can we rework this variable to indicate the
total length (or the number) of fence_info struct instances. It seems
to be the more common approach afaict. Might also want to move it just
above the fence_into?

-Emil
Maarten Lankhorst Feb. 1, 2016, 8:39 a.m. UTC | #2
Op 29-01-16 om 22:20 schreef Gustavo Padovan:
> From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
>
> Play safe and add flags member to all structs. So we don't need to
> break API or create new IOCTL in the future if new features that requires
> flags arises.
>
This only helps if you reject flags != 0 in the ioctl, else when you extend the abi userspace might initialize it with garbage.

~Maarten
Gustavo Padovan Feb. 1, 2016, 1:24 p.m. UTC | #3
2016-01-30 Emil Velikov <emil.l.velikov@gmail.com>:

> Hi Gustavo,
> 
> > @@ -54,6 +59,7 @@ struct sync_file_info {
> >         __u32   len;
> As mentioned previously - can we rework this variable to indicate the
> total length (or the number) of fence_info struct instances. It seems
> to be the more common approach afaict. Might also want to move it just
> above the fence_into?

Sure, I think this is a good idea.

	Gustavo
diff mbox

Patch

diff --git a/drivers/staging/android/uapi/sync.h b/drivers/staging/android/uapi/sync.h
index b00f0eb..45921f6 100644
--- a/drivers/staging/android/uapi/sync.h
+++ b/drivers/staging/android/uapi/sync.h
@@ -19,11 +19,13 @@ 
  * @fd2:	file descriptor of second fence
  * @name:	name of new fence
  * @fence:	returns the fd of the new fence to userspace
+ * @flags:	merge_data flags
  */
 struct sync_merge_data {
 	__s32	fd2; /* fd of second fence */
 	char	name[32]; /* name of new fence */
 	__s32	fence; /* fd on newly created fence */
+	__u32	flags;
 };
 
 /**
@@ -31,12 +33,14 @@  struct sync_merge_data {
  * @obj_name:		name of parent sync_timeline
  * @driver_name:	name of driver implementing the parent
  * @status:		status of the fence 0:active 1:signaled <0:error
+ * @flags:		fence_info flags
  * @timestamp_ns:	timestamp of status change in nanoseconds
  */
 struct fence_info {
 	char	obj_name[32];
 	char	driver_name[32];
 	__s32	status;
+	__u32	flags;
 	__u64	timestamp_ns;
 };
 
@@ -47,6 +51,7 @@  struct fence_info {
  *		userspace including pt_info.
  * @name:	name of fence
  * @status:	status of fence. 1: signaled 0:active <0:error
+ * @flags:	sync_file_info flags
  * @num_fences	number of fences in the sync_file
  * @fence_info:	a fence_info struct for every fence in the sync_file
  */
@@ -54,6 +59,7 @@  struct sync_file_info {
 	__u32	len;
 	char	name[32];
 	__s32	status;
+	__u32	flags;
 	__u32	num_fences;
 
 	__u64	*fence_info;