From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: unlisted-recipients:; (no To-header on input)
Cc: linuxarm@huawei.com, mauro.chehab@huawei.com,
Alan <alan@linux.intel.com>, Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Hans Verkuil <hverkuil-cisco@xs4all.nl>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
Tsuchiya Yuto <kitakar@gmail.com>,
linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
linux-staging@lists.linux.dev
Subject: Re: [PATCH 2/2] media: atomisp: set default mode
Date: Fri, 29 Oct 2021 20:27:09 +0100 [thread overview]
Message-ID: <20211029202709.755b9a6b@sal.lan> (raw)
In-Reply-To: <543e61dd07c90a7d8577b3a94696edc77953b9d8.1635497370.git.mchehab+huawei@kernel.org>
Em Fri, 29 Oct 2021 09:49:36 +0100
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> escreveu:
> Without setting a default mode at open(), applications that
> don't call VIDIOC_SET_PARM with a custom atomisp parameters
> won't work, as the pipeline won't be set:
>
> atomisp-isp2 0000:00:03.0: can't create streams
> atomisp-isp2 0000:00:03.0: __get_frame_info 1600x1200 (padded to 0) returned -22
>
> So, as an step to allow generic apps to use this driver, put
> the device's run_mode in preview after open.
>
> After this patch, using v4l2grab starts to work:
>
> $ v4l2grab -D -f 'NV12' -x 1600 -y 1200 -d /dev/video2 -u
> $ nvt/raw2pnm -x1600 -y1200 -f NV12 out017.raw out017.pnm
> $ feh out017.pnm
Added support for YUYV at v4l2grab (at contrib/test, under v4l-utils).
The above can now be just:
$ v4l2grab -f YUYV -x 1600 -y 1200 -d /dev/video2 -u
$ feh out017.pnm
(on a side note, the colorspace conversion from YUYV seems ackward,
but this can be adjusted later on at the toolset and/or at atomisp)
>
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> ---
> drivers/staging/media/atomisp/pci/atomisp_fops.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/staging/media/atomisp/pci/atomisp_fops.c b/drivers/staging/media/atomisp/pci/atomisp_fops.c
> index 72cbdce2142a..7df982c80b1a 100644
> --- a/drivers/staging/media/atomisp/pci/atomisp_fops.c
> +++ b/drivers/staging/media/atomisp/pci/atomisp_fops.c
> @@ -893,6 +893,11 @@ static int atomisp_open(struct file *file)
> else
> pipe->users++;
> rt_mutex_unlock(&isp->mutex);
> +
> + /* Ensure that a mode is set */
> + if (asd)
> + v4l2_ctrl_s_ctrl(asd->run_mode, ATOMISP_RUN_MODE_PREVIEW);
> +
> return 0;
>
> css_error:
next prev parent reply other threads:[~2021-10-29 19:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-29 8:49 [PATCH 1/2] media: atomisp: better describe get_frame_info issues Mauro Carvalho Chehab
2021-10-29 8:49 ` [PATCH 2/2] media: atomisp: set default mode Mauro Carvalho Chehab
2021-10-29 19:27 ` Mauro Carvalho Chehab [this message]
2021-10-29 9:01 ` [PATCH 1/2] media: atomisp: better describe get_frame_info issues Andy Shevchenko
2021-11-02 6:54 ` Mauro Carvalho Chehab
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=20211029202709.755b9a6b@sal.lan \
--to=mchehab+huawei@kernel.org \
--cc=alan@linux.intel.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=hverkuil-cisco@xs4all.nl \
--cc=kitakar@gmail.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=linuxarm@huawei.com \
--cc=mauro.chehab@huawei.com \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=tomi.valkeinen@ideasonboard.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