Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1546947

Re: [RFC/PATCH] media: Add video bus switch

From Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Newsgroups linux.kernel
Subject Re: [RFC/PATCH] media: Add video bus switch
Date 2016-12-23 20:00 +0100
Message-ID <sRDep-2c3-5@gated-at.bofh.it> (permalink)
References (4 earlier) <sRbLc-1E8-15@gated-at.bofh.it> <sRcHf-2c2-1@gated-at.bofh.it> <sRklr-6Xd-7@gated-at.bofh.it> <sRlhv-7zC-9@gated-at.bofh.it> <sRwwi-6lS-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi,

On 23.12.2016 13:42, Pavel Machek wrote:
> Hi!
>
>>> [...]
>>>
>>>  static int isp_subdev_notifier_bound(struct v4l2_async_notifier *async,
>>> diff --git a/drivers/media/platform/video-bus-switch.c b/drivers/media/platform/video-bus-switch.c
>>> index 1a5d944..3a2d442 100644
>>> --- a/drivers/media/platform/video-bus-switch.c
>>> +++ b/drivers/media/platform/video-bus-switch.c
>>> @@ -247,12 +247,21 @@ static int vbs_s_stream(struct v4l2_subdev *sd, int enable)
>>>  {
>>>  	struct v4l2_subdev *subdev = vbs_get_remote_subdev(sd);
>>>
>>> +	/* FIXME: we need to set the GPIO here */
>>> +
>>
>> The gpio is set when the pad is selected, so no need to do it again.
>> The gpio selection actually works with your branch (assuming its
>> based on Ivo's).
>
> Yes. I did not notice... is there actually some interface to select
> the camera from userland?
>

When you construct the pipeline, you enable the port you need in vbs, so 
the camera is selected.

I used (similar to)this by the time I played with cameras:

front:

export LD_LIBRARY_PATH=./
./media-ctl -r
./media-ctl -l '"vs6555 binner 2-0010":1 -> "video-bus-switch":2 [1]'
./media-ctl -l '"video-bus-switch":0 -> "OMAP3 ISP CCP2":0 [1]'
./media-ctl -l '"OMAP3 ISP CCP2":1 -> "OMAP3 ISP CCDC":0 [1]'
./media-ctl -l '"OMAP3 ISP CCDC":2 -> "OMAP3 ISP preview":0 [1]'
./media-ctl -l '"OMAP3 ISP preview":1 -> "OMAP3 ISP resizer":0 [1]'
./media-ctl -l '"OMAP3 ISP resizer":1 -> "OMAP3 ISP resizer output":0 [1]'
./media-ctl -V '"vs6555 pixel array 2-0010":0 [SGRBG10/648x488 
(0,0)/648x488 (0,0)/648x488]'
./media-ctl -V '"vs6555 binner 2-0010":1 [SGRBG10/648x488 (0,0)/648x488 
(0,0)/648x488]'
./media-ctl -V '"OMAP3 ISP CCP2":0 [SGRBG10 648x488]'
./media-ctl -V '"OMAP3 ISP CCP2":1 [SGRBG10 648x488]'
./media-ctl -V '"OMAP3 ISP CCDC":2 [SGRBG10 648x488]'
./media-ctl -V '"OMAP3 ISP preview":1 [UYVY 648x488]'
./media-ctl -V '"OMAP3 ISP resizer":1 [UYVY 656x488]'


mplayer -tv 
driver=v4l2:width=656:height=488:outfmt=uyvy:device=/dev/video6 -vo xv 
-vf screenshot tv://

back:

export LD_LIBRARY_PATH=./
./media-ctl -r
./media-ctl -l '"et8ek8 3-003e":0 -> "video-bus-switch":1 [1]'
./media-ctl -l '"video-bus-switch":0 -> "OMAP3 ISP CCP2":0 [1]'
./media-ctl -l '"OMAP3 ISP CCP2":1 -> "OMAP3 ISP CCDC":0 [1]'
./media-ctl -l '"OMAP3 ISP CCDC":2 -> "OMAP3 ISP preview":0 [1]'
./media-ctl -l '"OMAP3 ISP preview":1 -> "OMAP3 ISP resizer":0 [1]'
./media-ctl -l '"OMAP3 ISP resizer":1 -> "OMAP3 ISP resizer output":0 [1]'

./media-ctl -V '"et8ek8 3-003e":0 [SGRBG10 864x656]'
./media-ctl -V '"OMAP3 ISP CCP2":0 [SGRBG10 864x656]'
./media-ctl -V '"OMAP3 ISP CCP2":1 [SGRBG10 864x656]'
./media-ctl -V '"OMAP3 ISP CCDC":2 [SGRBG10 864x656]'
./media-ctl -V '"OMAP3 ISP preview":1 [UYVY 864x656]'
./media-ctl -V '"OMAP3 ISP resizer":1 [UYVY 800x480]'

mplayer -tv 
driver=v4l2:width=800:height=480:outfmt=uyvy:device=/dev/video6 -vo xv 
-vf screenshot tv://


or IOW:

./media-ctl -l '"vs6555 binner 2-0010":1 -> "video-bus-switch":2 [1]' 
switches GPIO to use front camera

and
./media-ctl -l '"video-bus-switch":0 -> "OMAP3 ISP CCP2":0 [1]'

for back camera


Ivo

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC/PATCH] media: Add video bus switch Pavel Machek <pavel@ucw.cz> - 2016-12-22 14:40 +0100
  Re: [RFC/PATCH] media: Add video bus switch Sebastian Reichel <sre@kernel.org> - 2016-12-22 15:40 +0100
    Re: [RFC/PATCH] media: Add video bus switch Pavel Machek <pavel@ucw.cz> - 2016-12-22 22:00 +0100
      Re: [RFC/PATCH] media: Add video bus switch Sebastian Reichel <sre@kernel.org> - 2016-12-23 00:20 +0100
    Re: [RFC/PATCH] media: Add video bus switch Pavel Machek <pavel@ucw.cz> - 2016-12-22 23:50 +0100
      Re: [RFC/PATCH] media: Add video bus switch Sebastian Reichel <sre@kernel.org> - 2016-12-23 00:50 +0100
        Re: [RFC/PATCH] media: Add video bus switch Pavel Machek <pavel@ucw.cz> - 2016-12-23 12:50 +0100
          Re: [RFC/PATCH] media: Add video bus switch Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com> - 2016-12-23 20:00 +0100
        Re: [RFC/PATCH] media: Add video bus switch Pavel Machek <pavel@ucw.cz> - 2016-12-23 22:00 +0100
        Re: [RFC/PATCH] media: Add video bus switch Pavel Machek <pavel@ucw.cz> - 2016-12-24 15:40 +0100
          Re: [RFC/PATCH] media: Add video bus switch Pavel Machek <pavel@ucw.cz> - 2016-12-24 15:50 +0100
  [PATCH] media: Add video bus switch Pavel Machek <pavel@ucw.cz> - 2016-12-24 16:30 +0100
    Re: [PATCH] media: Add video bus switch kbuild test robot <lkp@intel.com> - 2016-12-24 19:40 +0100

csiph-web