<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/staging/android/sync.c, branch v4.7</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.7</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.7'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-04-30T00:37:10Z</updated>
<entry>
<title>staging/android: prepare sync_file for de-staging</title>
<updated>2016-04-30T00:37:10Z</updated>
<author>
<name>Gustavo Padovan</name>
<email>gustavo.padovan@collabora.co.uk</email>
</author>
<published>2016-04-28T13:46:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d4cab38e153d62ecd502645390c0289c1b8337df'/>
<id>urn:sha1:d4cab38e153d62ecd502645390c0289c1b8337df</id>
<content type='text'>
Move its functions and structs to their own file. Also moves function's
docs to the .c file.

Signed-off-by: Gustavo Padovan &lt;gustavo.padovan@collabora.co.uk&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging/android: remove name arg from sync_file_create()</title>
<updated>2016-04-30T00:37:10Z</updated>
<author>
<name>Gustavo Padovan</name>
<email>gustavo.padovan@collabora.co.uk</email>
</author>
<published>2016-04-28T13:46:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d7c3110c28dee67f6766ae26cac629358233a6b4'/>
<id>urn:sha1:d7c3110c28dee67f6766ae26cac629358233a6b4</id>
<content type='text'>
Simplifies the API to only receive the fence it needs to add to the
sync and create a name for the sync_file based on the fence context and
seqno.

Signed-off-by: Gustavo Padovan &lt;gustavo.padovan@collabora.co.uk&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging/android: make sync_file_fdget() static</title>
<updated>2016-04-30T00:37:10Z</updated>
<author>
<name>Gustavo Padovan</name>
<email>gustavo.padovan@collabora.co.uk</email>
</author>
<published>2016-04-28T13:46:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=10e362c387e45f01cc38f62dec8f0bc3f1d676b5'/>
<id>urn:sha1:10e362c387e45f01cc38f62dec8f0bc3f1d676b5</id>
<content type='text'>
There is no plan in the near future to use this function outside of this
file so keep it as static.

Signed-off-by: Gustavo Padovan &lt;gustavo.padovan@collabora.co.uk&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging/android: make sync_file_merge() static</title>
<updated>2016-04-30T00:37:10Z</updated>
<author>
<name>Gustavo Padovan</name>
<email>gustavo.padovan@collabora.co.uk</email>
</author>
<published>2016-04-28T13:46:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4dff14e88ea928eacaa5faacd05d966c04bcecac'/>
<id>urn:sha1:4dff14e88ea928eacaa5faacd05d966c04bcecac</id>
<content type='text'>
There is no plan in the near future to use this function outside of this
file so keep it as static.

Signed-off-by: Gustavo Padovan &lt;gustavo.padovan@collabora.co.uk&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging/android: move sync_file functions comments to sync.c</title>
<updated>2016-04-30T00:37:10Z</updated>
<author>
<name>Gustavo Padovan</name>
<email>gustavo.padovan@collabora.co.uk</email>
</author>
<published>2016-04-28T13:46:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=696f74cf543997732d87956c5a88de6e9bd42605'/>
<id>urn:sha1:696f74cf543997732d87956c5a88de6e9bd42605</id>
<content type='text'>
To keep comments in line with drivers/dma-buf/ move all sync_file comments
to sync.c.

Signed-off-by: Gustavo Padovan &lt;gustavo.padovan@collabora.co.uk&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging/android: drop sync_file_install() and sync_file_put()</title>
<updated>2016-04-30T00:37:10Z</updated>
<author>
<name>Gustavo Padovan</name>
<email>gustavo.padovan@collabora.co.uk</email>
</author>
<published>2016-04-28T13:46:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2a7c1db557e111eaeb967baf2d39ecd6e593b767'/>
<id>urn:sha1:2a7c1db557e111eaeb967baf2d39ecd6e593b767</id>
<content type='text'>
These two functions are just wrappers for one line functions, they
call fd_install() and fput() respectively, so just get rid of them
and use fd_install() and fput() directly for more simplicity.

Signed-off-by: Gustavo Padovan &lt;gustavo.padovan@collabora.co.uk&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging/android: refactor SYNC IOCTLs</title>
<updated>2016-04-30T00:03:49Z</updated>
<author>
<name>Gustavo Padovan</name>
<email>gustavo.padovan@collabora.co.uk</email>
</author>
<published>2016-04-26T15:32:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2d75c88fefb228aedfb135228acb6620db8f0e40'/>
<id>urn:sha1:2d75c88fefb228aedfb135228acb6620db8f0e40</id>
<content type='text'>
Change SYNC_IOC_FILE_INFO (former SYNC_IOC_FENCE_INFO) behaviour to avoid
future API breaks and optimize buffer allocation.

Now num_fences can be filled by the caller to inform how many fences it
wants to retrieve from the kernel. If the num_fences passed is greater
than zero info-&gt;sync_fence_info should point to a buffer with enough space
to fit all fences.

However if num_fences passed to the kernel is 0, the kernel will reply
with number of fences of the sync_file.

Sending first an ioctl with num_fences = 0 can optimize buffer allocation,
in a first call with num_fences = 0 userspace will receive the actual
number of fences in the num_fences filed.

Then it can allocate a buffer with the correct size on sync_fence_info and
call SYNC_IOC_FILE_INFO again, but now with the actual value of num_fences
in the sync_file.

info-&gt;sync_fence_info was converted to __u64 pointer to prevent 32bit
compatibility issues. And a flags member was added.

An example userspace code for the later would be:

	struct sync_file_info *info;
	int err, size, num_fences;

	info = malloc(sizeof(*info));

	info.flags = 0;
	err = ioctl(fd, SYNC_IOC_FILE_INFO, info);
	num_fences = info-&gt;num_fences;

	if (num_fences) {
		info.flags = 0;
		size = sizeof(struct sync_fence_info) * num_fences;
		info-&gt;num_fences = num_fences;
		info-&gt;sync_fence_info = (uint64_t) calloc(num_fences,
							  sizeof(struct sync_fence_info));

		err = ioctl(fd, SYNC_IOC_FILE_INFO, info);
	}

Finally the IOCTLs numbers were changed to avoid any potential old
userspace running the old API to get weird errors. Changing the opcodes
will make them fail right away. This is just a precaution, there no
upstream users of these interfaces yet and the only user is Android, but
we don't expect anyone trying to run android userspace and all it
dependencies on top of upstream kernels.

Signed-off-by: Gustavo Padovan &lt;gustavo.padovan@collabora.co.uk&gt;
Reviewed-by: Maarten Lankhorst &lt;maarten.lankhorst@linux.intel.com&gt;
Acked-by: Greg Hackmann &lt;ghackmann@google.com&gt;
Acked-by: Rob Clark &lt;robdclark@gmail.com&gt;
Acked-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: android: Remove unneeded else following a return</title>
<updated>2016-02-20T23:24:51Z</updated>
<author>
<name>Janani Ravichandran</name>
<email>janani.rvchndrn@gmail.com</email>
</author>
<published>2016-02-18T22:39:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5f9001dc4221a3d63e2ad5f6d5aef159c2734704'/>
<id>urn:sha1:5f9001dc4221a3d63e2ad5f6d5aef159c2734704</id>
<content type='text'>
Remove unnecessary else when there is a return statement in the
corresponding if block.
Coccinelle patch used:

@rule1@
expression e1;
@@

	if (e1) { ... return ...; }
-       else{
	        ...
-            }

@rule2@
expression e2;
statement s1;
@@

	if(e2) { ... return ...; }
-       else
		s1

Signed-off-by: Janani Ravichandran &lt;janani.rvchndrn@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging/android: remove len field from struct sync_fence_info</title>
<updated>2016-02-08T01:34:58Z</updated>
<author>
<name>Gustavo Padovan</name>
<email>gustavo.padovan@collabora.co.uk</email>
</author>
<published>2016-02-03T13:25:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=323de43f79c5055af71c2db44f34e060ac15e1df'/>
<id>urn:sha1:323de43f79c5055af71c2db44f34e060ac15e1df</id>
<content type='text'>
After removing driver_data struct sync_fence_info has now a fixed size,
thus it doesn't need any field to tell its size, it is already known.

Signed-off-by: Gustavo Padovan &lt;gustavo.padovan@collabora.co.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging/android: remove driver_data from struct sync_fence_info</title>
<updated>2016-02-08T01:34:58Z</updated>
<author>
<name>Gustavo Padovan</name>
<email>gustavo.padovan@collabora.co.uk</email>
</author>
<published>2016-02-03T13:25:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c7434b8436f9fb79855f0a52e4e9665becb77aea'/>
<id>urn:sha1:c7434b8436f9fb79855f0a52e4e9665becb77aea</id>
<content type='text'>
It is unclear in what situations driver_data should be used thus better do
not upstream it for now. If a need arises in the future a discussion can
be started to re-add it.

Signed-off-by: Gustavo Padovan &lt;gustavo.padovan@collabora.co.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
