[libcamera-devel,1/5] media: media.h: Add new media link type
diff mbox series

Message ID 20211213232849.40071-2-djrscally@gmail.com
State Not Applicable
Headers show
Series
  • Introduce ancillary links
Related show

Commit Message

Daniel Scally Dec. 13, 2021, 11:28 p.m. UTC
To describe in the kernel the connection between devices and their
supporting peripherals (for example, a camera sensor and the vcm
driving the focusing lens for it), add a new type of media link
to introduce the concept of these ancillary links.

Signed-off-by: Daniel Scally <djrscally@gmail.com>
---
changes since the rfc:

	- Split out into its own patch (mostly so it can be followed by patch
	#3, which corrects some media-core code that is otherwise broken by the
	new links)

 include/uapi/linux/media.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Laurent Pinchart Dec. 14, 2021, 9:50 p.m. UTC | #1
Hi Daniel,

Thank you for the patch.

On Mon, Dec 13, 2021 at 11:28:45PM +0000, Daniel Scally wrote:
> To describe in the kernel the connection between devices and their
> supporting peripherals (for example, a camera sensor and the vcm
> driving the focusing lens for it), add a new type of media link
> to introduce the concept of these ancillary links.
> 
> Signed-off-by: Daniel Scally <djrscally@gmail.com>
> ---
> changes since the rfc:
> 
> 	- Split out into its own patch (mostly so it can be followed by patch
> 	#3, which corrects some media-core code that is otherwise broken by the
> 	new links)
> 
>  include/uapi/linux/media.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h
> index 200fa8462b90..afbae7213d35 100644
> --- a/include/uapi/linux/media.h
> +++ b/include/uapi/linux/media.h
> @@ -226,6 +226,7 @@ struct media_pad_desc {
>  #define MEDIA_LNK_FL_LINK_TYPE			(0xf << 28)
>  #  define MEDIA_LNK_FL_DATA_LINK		(0 << 28)
>  #  define MEDIA_LNK_FL_INTERFACE_LINK		(1 << 28)
> +#  define MEDIA_LNK_FL_ANCILLARY_LINK		(2 << 28)

This needs documentation in
Documentation/userspace-api/media/mediactl/media-types.rst and in
media-controller-model.rst. The latter should probably be a bit more
detailed to explain the use cases with at least one example.

>  
>  struct media_link_desc {
>  	struct media_pad_desc source;
Daniel Scally Dec. 14, 2021, 9:52 p.m. UTC | #2
Hi Laurent

On 14/12/2021 21:50, Laurent Pinchart wrote:
> Hi Daniel,
>
> Thank you for the patch.
>
> On Mon, Dec 13, 2021 at 11:28:45PM +0000, Daniel Scally wrote:
>> To describe in the kernel the connection between devices and their
>> supporting peripherals (for example, a camera sensor and the vcm
>> driving the focusing lens for it), add a new type of media link
>> to introduce the concept of these ancillary links.
>>
>> Signed-off-by: Daniel Scally <djrscally@gmail.com>
>> ---
>> changes since the rfc:
>>
>> 	- Split out into its own patch (mostly so it can be followed by patch
>> 	#3, which corrects some media-core code that is otherwise broken by the
>> 	new links)
>>
>>  include/uapi/linux/media.h | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h
>> index 200fa8462b90..afbae7213d35 100644
>> --- a/include/uapi/linux/media.h
>> +++ b/include/uapi/linux/media.h
>> @@ -226,6 +226,7 @@ struct media_pad_desc {
>>  #define MEDIA_LNK_FL_LINK_TYPE			(0xf << 28)
>>  #  define MEDIA_LNK_FL_DATA_LINK		(0 << 28)
>>  #  define MEDIA_LNK_FL_INTERFACE_LINK		(1 << 28)
>> +#  define MEDIA_LNK_FL_ANCILLARY_LINK		(2 << 28)
> This needs documentation in
> Documentation/userspace-api/media/mediactl/media-types.rst and in
> media-controller-model.rst. The latter should probably be a bit more
> detailed to explain the use cases with at least one example.


Agreed - I'll add some for the v2

>
>>  
>>  struct media_link_desc {
>>  	struct media_pad_desc source;

Patch
diff mbox series

diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h
index 200fa8462b90..afbae7213d35 100644
--- a/include/uapi/linux/media.h
+++ b/include/uapi/linux/media.h
@@ -226,6 +226,7 @@  struct media_pad_desc {
 #define MEDIA_LNK_FL_LINK_TYPE			(0xf << 28)
 #  define MEDIA_LNK_FL_DATA_LINK		(0 << 28)
 #  define MEDIA_LNK_FL_INTERFACE_LINK		(1 << 28)
+#  define MEDIA_LNK_FL_ANCILLARY_LINK		(2 << 28)
 
 struct media_link_desc {
 	struct media_pad_desc source;