From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from perceval.ideasonboard.com ([213.167.242.64]:34824 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754459AbeGIM6D (ORCPT ); Mon, 9 Jul 2018 08:58:03 -0400 From: Laurent Pinchart To: Hans Verkuil Cc: linux-media@vger.kernel.org, Hans Verkuil Subject: Re: [PATCHv5 03/12] media: add flags field to struct media_v2_entity Date: Mon, 09 Jul 2018 15:58:36 +0300 Message-ID: <3483538.nDrvv2cyf4@avalon> In-Reply-To: <20180629114331.7617-4-hverkuil@xs4all.nl> References: <20180629114331.7617-1-hverkuil@xs4all.nl> <20180629114331.7617-4-hverkuil@xs4all.nl> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-media-owner@vger.kernel.org List-ID: Hi Hans, Thank you for the patch. On Friday, 29 June 2018 14:43:22 EEST Hans Verkuil wrote: > From: Hans Verkuil > > The v2 entity structure never exposed the entity flags, which made it > impossible to detect connector or default entities. > > It is really trivial to just expose this information, so implement this. > > Signed-off-by: Hans Verkuil > Acked-by: Sakari Ailus > --- > drivers/media/media-device.c | 1 + > include/uapi/linux/media.h | 12 +++++++++++- > 2 files changed, 12 insertions(+), 1 deletion(-) > > diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c > index 047d38372a27..14959b19a342 100644 > --- a/drivers/media/media-device.c > +++ b/drivers/media/media-device.c > @@ -266,6 +266,7 @@ static long media_device_get_topology(struct > media_device *mdev, void *arg) memset(&kentity, 0, sizeof(kentity)); > kentity.id = entity->graph_obj.id; > kentity.function = entity->function; > + kentity.flags = entity->flags; > strlcpy(kentity.name, entity->name, > sizeof(kentity.name)); > > diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h > index f6338bd57929..ebd2cda67833 100644 > --- a/include/uapi/linux/media.h > +++ b/include/uapi/linux/media.h > @@ -280,11 +280,21 @@ struct media_links_enum { > * MC next gen API definitions > */ > > +/* > + * Appeared in 4.19.0. > + * > + * The media_version argument comes from the media_version field in > + * struct media_device_info. > + */ > +#define MEDIA_V2_ENTITY_HAS_FLAGS(media_version) \ > + ((media_version) >= ((4 << 16) | (19 << 8) | 0)) Same comment here as for patch 01/12. It also applies to patch 04/12. > struct media_v2_entity { > __u32 id; > char name[64]; > __u32 function; /* Main function of the entity */ > - __u32 reserved[6]; > + __u32 flags; > + __u32 reserved[5]; > } __attribute__ ((packed)); > > /* Should match the specific fields at media_intf_devnode */ -- Regards, Laurent Pinchart