<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/media/media-entity.c, branch v4.8-rc2</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>[media] media: change pipeline validation return error</title>
<updated>2016-04-29T11:07:17+00:00</updated>
<author>
<name>Helen Mae Koike Fornazier</name>
<email>helen.koike@collabora.co.uk</email>
</author>
<published>2015-06-28T19:14:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=47dfdb3a888733ab76702fc2801b6715c9d77937'/>
<id>47dfdb3a888733ab76702fc2801b6715c9d77937</id>
<content type='text'>
According to the V4L2 API, the VIDIOC_STREAMON ioctl should return EPIPE
if there is a format mismatch in the pipeline configuration.

As the .vidioc_streamon in the v4l2_ioctl_ops usually forwards the error
caused by the v4l2_subdev_link_validate_default (if it is in use), it
should return -EPIPE when it detect the mismatch.

When an entity is connected to a non enabled link,
media_entity_pipeline_start should return -ENOLINK, as the link does not
exist.

Signed-off-by: Helen Mae Koike Fornazier &lt;helen.koike@collabora.co.uk&gt;
Acked-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
According to the V4L2 API, the VIDIOC_STREAMON ioctl should return EPIPE
if there is a format mismatch in the pipeline configuration.

As the .vidioc_streamon in the v4l2_ioctl_ops usually forwards the error
caused by the v4l2_subdev_link_validate_default (if it is in use), it
should return -EPIPE when it detect the mismatch.

When an entity is connected to a non enabled link,
media_entity_pipeline_start should return -ENOLINK, as the link does not
exist.

Signed-off-by: Helen Mae Koike Fornazier &lt;helen.koike@collabora.co.uk&gt;
Acked-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] media-device: get rid of the spinlock</title>
<updated>2016-04-20T16:12:02+00:00</updated>
<author>
<name>Mauro Carvalho Chehab</name>
<email>mchehab@osg.samsung.com</email>
</author>
<published>2016-04-06T13:55:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e2c91d4d78ee3a69ad634bc7ef90688704baab9d'/>
<id>e2c91d4d78ee3a69ad634bc7ef90688704baab9d</id>
<content type='text'>
Right now, the lock schema for media_device struct is messy,
since sometimes, it is protected via a spin lock, while, for
media graph traversal, it is protected by a mutex.

Solve this conflict by always using a mutex.

As a side effect, this prevents a bug when the media notifiers
is called at atomic context, while running the notifier callback:

 BUG: sleeping function called from invalid context at mm/slub.c:1289
 in_atomic(): 1, irqs_disabled(): 0, pid: 3479, name: modprobe
 4 locks held by modprobe/3479:
 #0:  (&amp;dev-&gt;mutex){......}, at: [&lt;ffffffff81ce8933&gt;] __driver_attach+0xa3/0x160
 #1:  (&amp;dev-&gt;mutex){......}, at: [&lt;ffffffff81ce8941&gt;] __driver_attach+0xb1/0x160
 #2:  (register_mutex#5){+.+.+.}, at: [&lt;ffffffffa10596c7&gt;] usb_audio_probe+0x257/0x1c90 [snd_usb_audio]
 #3:  (&amp;(&amp;mdev-&gt;lock)-&gt;rlock){+.+.+.}, at: [&lt;ffffffffa0e6051b&gt;] media_device_register_entity+0x1cb/0x700 [media]
 CPU: 2 PID: 3479 Comm: modprobe Not tainted 4.5.0-rc3+ #49
 Hardware name:                  /NUC5i7RYB, BIOS RYBDWi35.86A.0350.2015.0812.1722 08/12/2015
 0000000000000000 ffff8803b3f6f288 ffffffff81933901 ffff8803c4bae000
 ffff8803c4bae5c8 ffff8803b3f6f2b0 ffffffff811c6af5 ffff8803c4bae000
 ffffffff8285d7f6 0000000000000509 ffff8803b3f6f2f0 ffffffff811c6ce5
 Call Trace:
 [&lt;ffffffff81933901&gt;] dump_stack+0x85/0xc4
 [&lt;ffffffff811c6af5&gt;] ___might_sleep+0x245/0x3a0
 [&lt;ffffffff811c6ce5&gt;] __might_sleep+0x95/0x1a0
 [&lt;ffffffff8155aade&gt;] kmem_cache_alloc_trace+0x20e/0x300
 [&lt;ffffffffa0e66e3d&gt;] ? media_add_link+0x4d/0x140 [media]
 [&lt;ffffffffa0e66e3d&gt;] media_add_link+0x4d/0x140 [media]
 [&lt;ffffffffa0e69931&gt;] media_create_pad_link+0xa1/0x600 [media]
 [&lt;ffffffffa0fe11b3&gt;] au0828_media_graph_notify+0x173/0x360 [au0828]
 [&lt;ffffffffa0e68a6a&gt;] ? media_gobj_create+0x1ba/0x480 [media]
 [&lt;ffffffffa0e606fb&gt;] media_device_register_entity+0x3ab/0x700 [media]

Reviewed-by: Javier Martinez Canillas &lt;javier@osg.samsung.com&gt;
Acked-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Acked-by: Hans Verkuil &lt;hans.verkuil@cisco.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Right now, the lock schema for media_device struct is messy,
since sometimes, it is protected via a spin lock, while, for
media graph traversal, it is protected by a mutex.

Solve this conflict by always using a mutex.

As a side effect, this prevents a bug when the media notifiers
is called at atomic context, while running the notifier callback:

 BUG: sleeping function called from invalid context at mm/slub.c:1289
 in_atomic(): 1, irqs_disabled(): 0, pid: 3479, name: modprobe
 4 locks held by modprobe/3479:
 #0:  (&amp;dev-&gt;mutex){......}, at: [&lt;ffffffff81ce8933&gt;] __driver_attach+0xa3/0x160
 #1:  (&amp;dev-&gt;mutex){......}, at: [&lt;ffffffff81ce8941&gt;] __driver_attach+0xb1/0x160
 #2:  (register_mutex#5){+.+.+.}, at: [&lt;ffffffffa10596c7&gt;] usb_audio_probe+0x257/0x1c90 [snd_usb_audio]
 #3:  (&amp;(&amp;mdev-&gt;lock)-&gt;rlock){+.+.+.}, at: [&lt;ffffffffa0e6051b&gt;] media_device_register_entity+0x1cb/0x700 [media]
 CPU: 2 PID: 3479 Comm: modprobe Not tainted 4.5.0-rc3+ #49
 Hardware name:                  /NUC5i7RYB, BIOS RYBDWi35.86A.0350.2015.0812.1722 08/12/2015
 0000000000000000 ffff8803b3f6f288 ffffffff81933901 ffff8803c4bae000
 ffff8803c4bae5c8 ffff8803b3f6f2b0 ffffffff811c6af5 ffff8803c4bae000
 ffffffff8285d7f6 0000000000000509 ffff8803b3f6f2f0 ffffffff811c6ce5
 Call Trace:
 [&lt;ffffffff81933901&gt;] dump_stack+0x85/0xc4
 [&lt;ffffffff811c6af5&gt;] ___might_sleep+0x245/0x3a0
 [&lt;ffffffff811c6ce5&gt;] __might_sleep+0x95/0x1a0
 [&lt;ffffffff8155aade&gt;] kmem_cache_alloc_trace+0x20e/0x300
 [&lt;ffffffffa0e66e3d&gt;] ? media_add_link+0x4d/0x140 [media]
 [&lt;ffffffffa0e66e3d&gt;] media_add_link+0x4d/0x140 [media]
 [&lt;ffffffffa0e69931&gt;] media_create_pad_link+0xa1/0x600 [media]
 [&lt;ffffffffa0fe11b3&gt;] au0828_media_graph_notify+0x173/0x360 [au0828]
 [&lt;ffffffffa0e68a6a&gt;] ? media_gobj_create+0x1ba/0x480 [media]
 [&lt;ffffffffa0e606fb&gt;] media_device_register_entity+0x3ab/0x700 [media]

Reviewed-by: Javier Martinez Canillas &lt;javier@osg.samsung.com&gt;
Acked-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Acked-by: Hans Verkuil &lt;hans.verkuil@cisco.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] media: add prefixes to interface types</title>
<updated>2016-03-05T12:03:16+00:00</updated>
<author>
<name>Shuah Khan</name>
<email>shuahkh@osg.samsung.com</email>
</author>
<published>2016-03-04T21:14:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=66c1db1bc5e1a21a358d084835a3eff1cf7d5b78'/>
<id>66c1db1bc5e1a21a358d084835a3eff1cf7d5b78</id>
<content type='text'>
Add missing prefixes for DVB, V4L, and ALSA interface types.

Signed-off-by: Shuah Khan &lt;shuahkh@osg.samsung.com&gt;
Acked-by: Hans Verkuil &lt;hans.verkuil@cisco.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add missing prefixes for DVB, V4L, and ALSA interface types.

Signed-off-by: Shuah Khan &lt;shuahkh@osg.samsung.com&gt;
Acked-by: Hans Verkuil &lt;hans.verkuil@cisco.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] media: Media Controller non-locking __media_entity_pipeline_start/stop()</title>
<updated>2016-02-27T11:33:28+00:00</updated>
<author>
<name>Shuah Khan</name>
<email>shuahkh@osg.samsung.com</email>
</author>
<published>2016-02-11T23:41:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fb49f20438f361a60f9af555e5a69d91bb5e358f'/>
<id>fb49f20438f361a60f9af555e5a69d91bb5e358f</id>
<content type='text'>
Add non-locking __media_entity_pipeline_start/stop()
interfaces to be called from code paths that hold the
graph_mutex.

Signed-off-by: Shuah Khan &lt;shuahkh@osg.samsung.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add non-locking __media_entity_pipeline_start/stop()
interfaces to be called from code paths that hold the
graph_mutex.

Signed-off-by: Shuah Khan &lt;shuahkh@osg.samsung.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] media: Media Controller export non locking __media_entity_setup_link()</title>
<updated>2016-02-27T11:33:27+00:00</updated>
<author>
<name>Shuah Khan</name>
<email>shuahkh@osg.samsung.com</email>
</author>
<published>2016-02-11T23:41:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=efc702784f22b8d92bed42c082a8cedc264b50c4'/>
<id>efc702784f22b8d92bed42c082a8cedc264b50c4</id>
<content type='text'>
Export __media_entity_setup_link() to be used from code paths
that hold the graph_mutex.

Signed-off-by: Shuah Khan &lt;shuahkh@osg.samsung.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Export __media_entity_setup_link() to be used from code paths
that hold the graph_mutex.

Signed-off-by: Shuah Khan &lt;shuahkh@osg.samsung.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] uapi/media.h: Declare interface types for ALSA</title>
<updated>2016-02-27T11:14:44+00:00</updated>
<author>
<name>Shuah Khan</name>
<email>shuahkh@osg.samsung.com</email>
</author>
<published>2016-02-11T23:41:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5af557a6d2a077a8678879cf9498fbf8d5d81697'/>
<id>5af557a6d2a077a8678879cf9498fbf8d5d81697</id>
<content type='text'>
Declare the interface types to be used on alsa for
the new G_TOPOLOGY ioctl.

Signed-off-by: Shuah Khan &lt;shuahkh@osg.samsung.com&gt;
Acked-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Declare the interface types to be used on alsa for
the new G_TOPOLOGY ioctl.

Signed-off-by: Shuah Khan &lt;shuahkh@osg.samsung.com&gt;
Acked-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] media: Use all bits of an enumeration</title>
<updated>2016-02-19T13:45:03+00:00</updated>
<author>
<name>Sakari Ailus</name>
<email>sakari.ailus@iki.fi</email>
</author>
<published>2016-01-27T14:47:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f7b5dff0b59b20469b2a4889e6170c0069d37c8d'/>
<id>f7b5dff0b59b20469b2a4889e6170c0069d37c8d</id>
<content type='text'>
The allocation takes place in longs. Assign the size of the enum
accordingly.

Signed-off-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The allocation takes place in longs. Assign the size of the enum
accordingly.

Signed-off-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] media: Media Controller fix to not let stream_count go negative</title>
<updated>2016-02-01T15:32:50+00:00</updated>
<author>
<name>Shuah Khan</name>
<email>shuahkh@osg.samsung.com</email>
</author>
<published>2016-01-30T20:10:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3801bc7d1b8dd70d47a92e58d6fb5653c10b7c95'/>
<id>3801bc7d1b8dd70d47a92e58d6fb5653c10b7c95</id>
<content type='text'>
Change media_entity_pipeline_stop() to not decrement
stream_count of an inactive media pipeline. Doing so,
results in preventing starting the pipeline.

Signed-off-by: Shuah Khan &lt;shuahkh@osg.samsung.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change media_entity_pipeline_stop() to not decrement
stream_count of an inactive media pipeline. Doing so,
results in preventing starting the pipeline.

Signed-off-by: Shuah Khan &lt;shuahkh@osg.samsung.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] media-entitiy: add a function to create multiple links</title>
<updated>2016-01-11T14:19:26+00:00</updated>
<author>
<name>Mauro Carvalho Chehab</name>
<email>mchehab@osg.samsung.com</email>
</author>
<published>2015-12-30T11:45:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b01cc9ce7c13e0463575332dfa3171727f706afb'/>
<id>b01cc9ce7c13e0463575332dfa3171727f706afb</id>
<content type='text'>
Sometimes, it is desired to create 1:n and n:1 or even
n:n links between different entities with the same
function.

This is actually needed to support DVB devices that
have multiple frontends. While we could do a function
like that internally at the DVB core, such function is
generic enough to be at media-entity, and it could be
useful on some other places.

So, add such function.

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Sometimes, it is desired to create 1:n and n:1 or even
n:n links between different entities with the same
function.

This is actually needed to support DVB devices that
have multiple frontends. While we could do a function
like that internally at the DVB core, such function is
generic enough to be at media-entity, and it could be
useful on some other places.

So, add such function.

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] media-entity: increase max number of PADs</title>
<updated>2016-01-11T14:19:24+00:00</updated>
<author>
<name>Mauro Carvalho Chehab</name>
<email>mchehab@osg.samsung.com</email>
</author>
<published>2015-12-16T17:18:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=430a672c83c3e2e9a96c777a874f345c8d21f929'/>
<id>430a672c83c3e2e9a96c777a874f345c8d21f929</id>
<content type='text'>
The DVB drivers may have 257 PADs. Get the next power of two
that would accomodate that amount.

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The DVB drivers may have 257 PADs. Get the next power of two
that would accomodate that amount.

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
