From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from osg.samsung.com ([64.30.133.232]:47721 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752750AbeDPSDs (ORCPT ); Mon, 16 Apr 2018 14:03:48 -0400 Date: Mon, 16 Apr 2018 15:03:35 -0300 From: Mauro Carvalho Chehab To: Hans Verkuil Cc: linux-media@vger.kernel.org, Hans Verkuil Subject: Re: [PATCHv2 6/9] media: add 'index' to struct media_v2_pad Message-ID: <20180416150335.66f6ab12@vento.lan> In-Reply-To: <20180416132121.46205-7-hverkuil@xs4all.nl> References: <20180416132121.46205-1-hverkuil@xs4all.nl> <20180416132121.46205-7-hverkuil@xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-media-owner@vger.kernel.org List-ID: Em Mon, 16 Apr 2018 15:21:18 +0200 Hans Verkuil escreveu: > From: Hans Verkuil > > The v2 pad structure never exposed the pad index, which made it impossible > to call the MEDIA_IOC_SETUP_LINK ioctl, which needs that information. > > It is really trivial to just expose this information, so implement this. Acked-by: Mauro Carvalho Chehab > > Signed-off-by: Hans Verkuil > --- > drivers/media/media-device.c | 1 + > include/uapi/linux/media.h | 7 ++++++- > 2 files changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c > index dca1e5a3e0f9..73ffea3e81c9 100644 > --- a/drivers/media/media-device.c > +++ b/drivers/media/media-device.c > @@ -331,6 +331,7 @@ static long media_device_get_topology(struct media_device *mdev, > kpad.id = pad->graph_obj.id; > kpad.entity_id = pad->entity->graph_obj.id; > kpad.flags = pad->flags; > + kpad.index = pad->index; > > if (copy_to_user(upad, &kpad, sizeof(kpad))) > ret = -EFAULT; > diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h > index ac08acffdb65..15f7f432f808 100644 > --- a/include/uapi/linux/media.h > +++ b/include/uapi/linux/media.h > @@ -310,11 +310,16 @@ struct media_v2_interface { > }; > } __attribute__ ((packed)); > > +/* Appeared in 4.18.0 */ > +#define MEDIA_V2_PAD_HAS_INDEX(media_version) \ > + ((media_version) >= 0x00041200) > + > struct media_v2_pad { > __u32 id; > __u32 entity_id; > __u32 flags; > - __u32 reserved[5]; > + __u32 index; > + __u32 reserved[4]; > } __attribute__ ((packed)); > > struct media_v2_link { Thanks, Mauro