From: Oleksandr Andrushchenko <andr2000@gmail.com>
To: Hans Verkuil <hverkuil@xs4all.nl>,
"Oleksandr_Andrushchenko@epam.com"
<Oleksandr_Andrushchenko@epam.com>,
xen-devel@lists.xenproject.org, konrad.wilk@oracle.com,
jgross@suse.com, boris.ostrovsky@oracle.com, mchehab@kernel.org,
linux-media@vger.kernel.org, sakari.ailus@linux.intel.com,
koji.matsuoka.xm@renesas.com
Subject: Re: [PATCH 1/1] cameraif: add ABI for para-virtual camera
Date: Tue, 11 Sep 2018 11:09:24 +0300 [thread overview]
Message-ID: <e91f12e2-52d6-62a1-f23d-f06cff9292c1@gmail.com> (raw)
In-Reply-To: <c7ad3c0f-61f9-3124-f270-f87826a68700@xs4all.nl>
On 09/11/2018 10:52 AM, Hans Verkuil wrote:
> On 09/11/18 09:14, Oleksandr Andrushchenko wrote:
>> On 09/11/2018 10:04 AM, Hans Verkuil wrote:
>>> On 09/11/2018 08:52 AM, Oleksandr Andrushchenko wrote:
>>>> Hi, Hans!
>>>>
>>>> On 09/10/2018 03:26 PM, Hans Verkuil wrote:
>>>>> On 09/10/2018 01:49 PM, Oleksandr Andrushchenko wrote:
>>>>>> On 09/10/2018 02:09 PM, Hans Verkuil wrote:
>>>>>>> On 09/10/2018 11:52 AM, Oleksandr Andrushchenko wrote:
>>>>>>>> On 09/10/2018 12:04 PM, Hans Verkuil wrote:
>>>>>>>>> On 09/10/2018 10:24 AM, Oleksandr Andrushchenko wrote:
>>>>>>>>>> On 09/10/2018 10:53 AM, Hans Verkuil wrote:
>>>>>>>>>>> Hi Oleksandr,
>>>>>>>>>>>
>>>>>>>>>>> On 09/10/2018 09:16 AM, Oleksandr Andrushchenko wrote:
>>>>>>>>> <snip>
>>>>>>>>>
>>>>>>>>>>>>> I suspect that you likely will want to support such sources eventually, so
>>>>>>>>>>>>> it pays to design this with that in mind.
>>>>>>>>>>>> Again, I think that this is the backend to hide these
>>>>>>>>>>>> use-cases from the frontend.
>>>>>>>>>>> I'm not sure you can: say you are playing a bluray connected to the system
>>>>>>>>>>> with HDMI, then if there is a resolution change, what do you do? You can tear
>>>>>>>>>>> everything down and build it up again, or you can just tell frontends that
>>>>>>>>>>> something changed and that they have to look at the new vcamera configuration.
>>>>>>>>>>>
>>>>>>>>>>> The latter seems to be more sensible to me. It is really not much that you
>>>>>>>>>>> need to do: all you really need is an event signalling that something changed.
>>>>>>>>>>> In V4L2 that's the V4L2_EVENT_SOURCE_CHANGE.
>>>>>>>>>> well, this complicates things a lot as I'll have to
>>>>>>>>>> re-allocate buffers - right?
>>>>>>>>> Right. Different resolutions means different sized buffers and usually lots of
>>>>>>>>> changes throughout the whole video pipeline, which in this case can even
>>>>>>>>> go into multiple VMs.
>>>>>>>>>
>>>>>>>>> One additional thing to keep in mind for the future: V4L2_EVENT_SOURCE_CHANGE
>>>>>>>>> has a flags field that tells userspace what changed. Right now that is just the
>>>>>>>>> resolution, but in the future you can expect flags for cases where just the
>>>>>>>>> colorspace information changes, but not the resolution.
>>>>>>>>>
>>>>>>>>> Which reminds me of two important missing pieces of information in your protocol:
>>>>>>>>>
>>>>>>>>> 1) You need to communicate the colorspace data:
>>>>>>>>>
>>>>>>>>> - colorspace
>>>>>>>>> - xfer_func
>>>>>>>>> - ycbcr_enc/hsv_enc (unlikely you ever want to support HSV pixelformats, so I
>>>>>>>>> think you can ignore hsv_enc)
>>>>>>>>> - quantization
>>>>>>>>>
>>>>>>>>> See https://hverkuil.home.xs4all.nl/spec/uapi/v4l/pixfmt-v4l2.html#c.v4l2_pix_format
>>>>>>>>> and the links to the colorspace sections in the V4L2 spec for details).
>>>>>>>>>
>>>>>>>>> This information is part of the format, it is reported by the driver.
>>>>>>>> I'll take a look and think what can be put and how into the protocol,
>>>>>>>> do you think I'll have to implement all the above for
>>>>>>>> this stage?
>>>>>>> Yes. Without it VMs will have no way of knowing how to reproduce the right colors.
>>>>>>> They don't *have* to use this information, but it should be there. For cameras
>>>>>>> this isn't all that important, for SDTV/HDTV sources this becomes more relevant
>>>>>>> (esp. the quantization and ycbcr_enc information) and for sources with BT.2020/HDR
>>>>>>> formats this is critical.
>>>>>> ok, then I'll add the following to the set_config request/response:
>>>>>>
>>>>>> uint32_t colorspace;
>>>>>> uint32_t xfer_func;
>>>>>> uint32_t ycbcr_enc;
>>>>>> uint32_t quantization;
>>>> Yet another question here: are the above (color space, xfer etc.) and
>>>> display aspect ratio defined per pixel_format or per pixel_format +
>>>> resolution?
>>>>
>>>> If per pixel_format then
>>>>
>>>> .../vcamera/1/formats/YUYV/display-aspect-ratio = "59/58"
>>>>
>>>> or if per resolution
>>>>
>>>> .../vcamera/1/formats/YUYV/640x480/display-aspect-ratio = "59/58"
>>> They are totally independent of resolution or pixelformat, with the
>>> exception of ycbcr_enc which is of course ignored for RGB pixelformats.
>>>
>>> They are set by the driver, never by the application.
>>>
>>> For HDMI sources these values can change depending on what source is
>>> connected, so they are not fixed and you need to query them whenever
>>> a new source is connected. In fact, then can change midstream, but we
>>> do not have good support for that at the moment.
>> Ah, great, then I'll define colorspace, xfer_func, quantization
>> and display aspect ratio as part of virtual camera device configuration
>> (as vcamera represents a single source) and ycbcr_enc as a part
>> of pixel format configuration (one ycbcr_enc per each
>> pixel format)
>>
>> Does this sound ok?
> Uh, no :-)
>
> ycbcr_enc is not tied to specific pixel formats. The Y'CbCr encoding tells
> you how the Y'CbCr values were derived from the R'G'B' values. So this only
> makes sense if you are in fact receiving Y'CbCr pixels, otherwise you just
> ignore it.
>
> It's up to you what value to assign to ycbcr_enc in that case: V4L2 doesn't
> have any hard requirements for that AFAIK, although it will most likely be
> set to 0 (V4L2_YCBCR_ENC_DEFAULT).
Thank you for the explanation
> Regards,
>
> Hans
Thank you,
Oleksandr
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2018-09-11 8:09 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-31 9:31 [PATCH 0/1] cameraif: Add ABI for para-virtualized Oleksandr Andrushchenko
2018-07-31 9:31 ` [PATCH 1/1] cameraif: add ABI for para-virtual camera Oleksandr Andrushchenko
2018-08-14 8:30 ` Juergen Gross
2018-08-21 5:54 ` Oleksandr Andrushchenko
2018-09-03 10:16 ` Oleksandr Andrushchenko
2018-09-03 15:25 ` Hans Verkuil
2018-09-04 6:56 ` Oleksandr Andrushchenko
2018-09-09 10:42 ` Hans Verkuil
2018-09-10 5:59 ` Oleksandr Andrushchenko
2018-09-10 8:14 ` Hans Verkuil
2018-09-10 8:34 ` Oleksandr Andrushchenko
2018-09-09 10:31 ` Hans Verkuil
2018-09-10 7:16 ` Oleksandr Andrushchenko
2018-09-10 7:53 ` Hans Verkuil
2018-09-10 8:24 ` Oleksandr Andrushchenko
2018-09-10 9:04 ` Hans Verkuil
2018-09-10 9:52 ` Oleksandr Andrushchenko
2018-09-10 11:09 ` Hans Verkuil
2018-09-10 11:49 ` Oleksandr Andrushchenko
2018-09-10 12:26 ` Hans Verkuil
2018-09-10 13:16 ` Oleksandr Andrushchenko
2018-09-11 6:52 ` Oleksandr Andrushchenko
2018-09-11 7:04 ` Hans Verkuil
2018-09-11 7:14 ` Oleksandr Andrushchenko
2018-09-11 7:52 ` Hans Verkuil
2018-09-11 8:09 ` Oleksandr Andrushchenko [this message]
2018-09-10 12:48 ` [PATCH 0/1] cameraif: Add ABI for para-virtualized Laurent Pinchart
2018-09-10 13:02 ` Oleksandr Andrushchenko
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=e91f12e2-52d6-62a1-f23d-f06cff9292c1@gmail.com \
--to=andr2000@gmail.com \
--cc=Oleksandr_Andrushchenko@epam.com \
--cc=boris.ostrovsky@oracle.com \
--cc=hverkuil@xs4all.nl \
--cc=jgross@suse.com \
--cc=koji.matsuoka.xm@renesas.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=xen-devel@lists.xenproject.org \
/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).