From: Prabhakar Lad <prabhakar.csengg@gmail.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: linux-media <linux-media@vger.kernel.org>,
Hans Verkuil <hans.verkuil@cisco.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
LKML <linux-kernel@vger.kernel.org>,
Mauro Carvalho Chehab <m.chehab@samsung.com>
Subject: Re: [PATCH] media: v4l2-subdev.h: drop the guard CONFIG_VIDEO_V4L2_SUBDEV_API for v4l2_subdev_get_try_*()
Date: Tue, 18 Nov 2014 13:35:46 +0000 [thread overview]
Message-ID: <CA+V-a8sZ0HwnBrYcaT_i3ExDQnYe05xABckqOCeECemngDEsjQ@mail.gmail.com> (raw)
In-Reply-To: <546B13CC.6050605@xs4all.nl>
Hi Hans,
On Tue, Nov 18, 2014 at 9:39 AM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
> On 11/17/14 11:41, Lad, Prabhakar wrote:
>> this patch removes the guard CONFIG_VIDEO_V4L2_SUBDEV_API
>> for v4l2_subdev_get_try_*() functions.
>> In cases where a subdev using v4l2_subdev_get_try_*() calls
>> internally and the bridge using subdev pad ops which is
>> not MC aware forces to select MEDIA_CONTROLLER, as
>> VIDEO_V4L2_SUBDEV_API is dependent on it.
>>
>> Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
>> ---
>> include/media/v4l2-subdev.h | 2 --
>> 1 file changed, 2 deletions(-)
>>
>> diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
>> index 5860292..076ca11 100644
>> --- a/include/media/v4l2-subdev.h
>> +++ b/include/media/v4l2-subdev.h
>> @@ -642,7 +642,6 @@ struct v4l2_subdev_fh {
>> #define to_v4l2_subdev_fh(fh) \
>> container_of(fh, struct v4l2_subdev_fh, vfh)
>>
>> -#if defined(CONFIG_VIDEO_V4L2_SUBDEV_API)
>> #define __V4L2_SUBDEV_MK_GET_TRY(rtype, fun_name, field_name) \
>> static inline struct rtype * \
>> v4l2_subdev_get_try_##fun_name(struct v4l2_subdev_fh *fh, \
>> @@ -656,7 +655,6 @@ struct v4l2_subdev_fh {
>> __V4L2_SUBDEV_MK_GET_TRY(v4l2_mbus_framefmt, format, try_fmt)
>> __V4L2_SUBDEV_MK_GET_TRY(v4l2_rect, crop, try_crop)
>> __V4L2_SUBDEV_MK_GET_TRY(v4l2_rect, compose, try_compose)
>> -#endif
>>
>> extern const struct v4l2_file_operations v4l2_subdev_fops;
>>
>>
>
> The problem is that v4l2_subdev_get_try_*() needs a v4l2_subdev_fh which
> you don't have if CONFIG_VIDEO_V4L2_SUBDEV_API is not defined. So I don't
> see how removing the guards help with that.
>
Yes
> What can be done is that if CONFIG_VIDEO_V4L2_SUBDEV_API is not defined,
> then these functions return NULL.
>
exactly.
> BTW, one patch I will very happily accept is one where the __V4L2_SUBDEV_MK_GET_TRY
> is removed and these three try functions are just written as proper
> static inlines. I find it very obfuscated code.
>
the functions were initially inline itself which were changes into
macro's later.
> In addition, because it is a macro you won't find the function definitions
> if you grep on the function name.
>
> But any functional changes here need to be Acked by Laurent first.
>
Yes, ill probably wait until Laurent is back from his holidays.
Thanks,
--Prabhakar Lad
next prev parent reply other threads:[~2014-11-18 13:36 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-17 10:41 [PATCH] media: v4l2-subdev.h: drop the guard CONFIG_VIDEO_V4L2_SUBDEV_API for v4l2_subdev_get_try_*() Lad, Prabhakar
2014-11-17 10:53 ` Sakari Ailus
2014-11-17 10:56 ` Prabhakar Lad
2014-11-18 9:39 ` Hans Verkuil
2014-11-18 13:35 ` Prabhakar Lad [this message]
2014-11-18 18:07 ` Sakari Ailus
2014-11-29 18:30 ` Prabhakar Lad
2014-11-29 19:12 ` Laurent Pinchart
2014-11-30 21:05 ` Prabhakar Lad
2014-11-30 21:16 ` Laurent Pinchart
2014-11-30 21:30 ` Prabhakar Lad
2014-12-01 23:26 ` Laurent Pinchart
2014-12-02 7:45 ` Hans Verkuil
2014-12-02 12:53 ` Hans Verkuil
2014-12-02 12:59 ` Laurent Pinchart
2014-12-02 19:34 ` Hans Verkuil
2014-12-02 20:56 ` Laurent Pinchart
2014-12-02 7:51 ` Prabhakar Lad
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CA+V-a8sZ0HwnBrYcaT_i3ExDQnYe05xABckqOCeECemngDEsjQ@mail.gmail.com \
--to=prabhakar.csengg@gmail.com \
--cc=hans.verkuil@cisco.com \
--cc=hverkuil@xs4all.nl \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=m.chehab@samsung.com \
--cc=sakari.ailus@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).