diff mbox

[v7,1/5] staging/android: add num_fences field to struct sync_file_info

Message ID 1457034046-27678-1-git-send-email-gustavo@padovan.org (mailing list archive)
State New, archived
Headers show

Commit Message

Gustavo Padovan March 3, 2016, 7:40 p.m. UTC
From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

Inform userspace how many fences are in the sync_fence_info field.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 drivers/staging/android/sync.c      | 2 ++
 drivers/staging/android/uapi/sync.h | 2 ++
 2 files changed, 4 insertions(+)

Comments

Greg Hackmann March 9, 2016, 2:36 a.m. UTC | #1
On 03/03/2016 11:40 AM, Gustavo Padovan wrote:
> From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
>
> Inform userspace how many fences are in the sync_fence_info field.
>
> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
>   drivers/staging/android/sync.c      | 2 ++
>   drivers/staging/android/uapi/sync.h | 2 ++
>   2 files changed, 4 insertions(+)
>
> diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c
> index 3a8f210..31aa462 100644
> --- a/drivers/staging/android/sync.c
> +++ b/drivers/staging/android/sync.c
> @@ -525,6 +525,8 @@ static long sync_file_ioctl_fence_info(struct sync_file *sync_file,
>   	if (info->status >= 0)
>   		info->status = !info->status;
>
> +	info->num_fences = sync_file->num_fences;
> +
>   	len = sizeof(struct sync_file_info);
>
>   	for (i = 0; i < sync_file->num_fences; ++i) {
> diff --git a/drivers/staging/android/uapi/sync.h b/drivers/staging/android/uapi/sync.h
> index a0cf357..4ffb7cc 100644
> --- a/drivers/staging/android/uapi/sync.h
> +++ b/drivers/staging/android/uapi/sync.h
> @@ -47,12 +47,14 @@ struct sync_fence_info {
>    *		userspace including pt_info.
>    * @name:	name of fence
>    * @status:	status of fence. 1: signaled 0:active <0:error
> + * @num_fences	number of fences in the sync_file
>    * @sync_fence_info: array of sync_fence_info for every fence in the sync_file
>    */
>   struct sync_file_info {
>   	__u32	len;
>   	char	name[32];
>   	__s32	status;
> +	__u32	num_fences;
>
>   	__u8	sync_fence_info[0];
>   };
>

Greg, this is ultimately your call.  But to echo what I said before, I'm 
OK with the ABI break here if that's what's needed to get sync moved out 
of staging.

Pragmatically speaking, this won't break ordinary Android apps, because 
they don't get direct access to sync fence fds to begin with.  Some 
privileged system processes do, but they go through libsync, which can 
be changed to deal with the ABI differences.

Anyway, for the whole series:

Acked-by: Greg Hackmann <ghackmann@google.com>
Greg Kroah-Hartman March 31, 2016, 1:22 a.m. UTC | #2
On Thu, Mar 03, 2016 at 04:40:42PM -0300, Gustavo Padovan wrote:
> From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

<snip>

Gustavo, can you resend both series of your android patches so I know I
have the latest ones to work with?  Please also collect the acks that
people have provided so far.

thanks,

greg k-h
Gustavo Padovan March 31, 2016, 2:53 a.m. UTC | #3
Hi Greg,

2016-03-30 Greg Kroah-Hartman <gregkh@linuxfoundation.org>:

> On Thu, Mar 03, 2016 at 04:40:42PM -0300, Gustavo Padovan wrote:
> > From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> 
> <snip>
> 
> Gustavo, can you resend both series of your android patches so I know I
> have the latest ones to work with?  Please also collect the acks that
> people have provided so far.

I have resent it already. The lastest patches on this series is v10,
it contain the acks

https://lkml.org/lkml/2016/3/18/298

	Gustavo
Greg Kroah-Hartman March 31, 2016, 3:02 a.m. UTC | #4
On Wed, Mar 30, 2016 at 11:53:38PM -0300, Gustavo Padovan wrote:
> Hi Greg,
> 
> 2016-03-30 Greg Kroah-Hartman <gregkh@linuxfoundation.org>:
> 
> > On Thu, Mar 03, 2016 at 04:40:42PM -0300, Gustavo Padovan wrote:
> > > From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> > 
> > <snip>
> > 
> > Gustavo, can you resend both series of your android patches so I know I
> > have the latest ones to work with?  Please also collect the acks that
> > people have provided so far.
> 
> I have resent it already. The lastest patches on this series is v10,
> it contain the acks
> 
> https://lkml.org/lkml/2016/3/18/298

Ok, I'll review those, thanks.

greg k-h
diff mbox

Patch

diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c
index 3a8f210..31aa462 100644
--- a/drivers/staging/android/sync.c
+++ b/drivers/staging/android/sync.c
@@ -525,6 +525,8 @@  static long sync_file_ioctl_fence_info(struct sync_file *sync_file,
 	if (info->status >= 0)
 		info->status = !info->status;
 
+	info->num_fences = sync_file->num_fences;
+
 	len = sizeof(struct sync_file_info);
 
 	for (i = 0; i < sync_file->num_fences; ++i) {
diff --git a/drivers/staging/android/uapi/sync.h b/drivers/staging/android/uapi/sync.h
index a0cf357..4ffb7cc 100644
--- a/drivers/staging/android/uapi/sync.h
+++ b/drivers/staging/android/uapi/sync.h
@@ -47,12 +47,14 @@  struct sync_fence_info {
  *		userspace including pt_info.
  * @name:	name of fence
  * @status:	status of fence. 1: signaled 0:active <0:error
+ * @num_fences	number of fences in the sync_file
  * @sync_fence_info: array of sync_fence_info for every fence in the sync_file
  */
 struct sync_file_info {
 	__u32	len;
 	char	name[32];
 	__s32	status;
+	__u32	num_fences;
 
 	__u8	sync_fence_info[0];
 };