All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Oleksandr Andrushchenko <andr2000@gmail.com>,
	"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: [Xen-devel][PATCH 1/1] cameraif: add ABI for para-virtual camera
Date: Tue, 11 Sep 2018 09:04:04 +0200	[thread overview]
Message-ID: <cb233d78-9634-749e-f6a4-6e8692ea6ddd@xs4all.nl> (raw)
In-Reply-To: <f53218ac-f704-b260-543f-72ccb33c7a1f@gmail.com>

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.

Regards,

	Hans

WARNING: multiple messages have this Message-ID (diff)
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Oleksandr Andrushchenko <andr2000@gmail.com>,
	"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 09:04:04 +0200	[thread overview]
Message-ID: <cb233d78-9634-749e-f6a4-6e8692ea6ddd@xs4all.nl> (raw)
In-Reply-To: <f53218ac-f704-b260-543f-72ccb33c7a1f@gmail.com>

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.

Regards,

	Hans

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2018-09-11 12:02 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-31  9:31 [Xen-devel][PATCH 0/1] cameraif: Add ABI for para-virtualized Oleksandr Andrushchenko
2018-07-31  9:31 ` [PATCH " Oleksandr Andrushchenko
2018-07-31  9:31 ` [Xen-devel][PATCH 1/1] cameraif: add ABI for para-virtual camera Oleksandr Andrushchenko
2018-07-31  9:31   ` [PATCH " Oleksandr Andrushchenko
2018-08-14  8:30   ` [Xen-devel][PATCH " Juergen Gross
2018-08-14  8:30     ` [PATCH " Juergen Gross
2018-08-21  5:54     ` [Xen-devel][PATCH " Oleksandr Andrushchenko
2018-08-21  5:54       ` [PATCH " Oleksandr Andrushchenko
2018-09-03 10:16       ` [Xen-devel][PATCH " Oleksandr Andrushchenko
2018-09-03 10:16         ` [PATCH " Oleksandr Andrushchenko
2018-09-03 15:25         ` [Xen-devel][PATCH " Hans Verkuil
2018-09-03 15:25           ` [PATCH " Hans Verkuil
2018-09-04  6:56           ` [Xen-devel][PATCH " Oleksandr Andrushchenko
2018-09-04  6:56             ` [PATCH " Oleksandr Andrushchenko
2018-09-09 10:42             ` [Xen-devel][PATCH " Hans Verkuil
2018-09-09 10:42               ` [PATCH " Hans Verkuil
2018-09-10  5:59               ` [Xen-devel][PATCH " Oleksandr Andrushchenko
2018-09-10  5:59                 ` [PATCH " Oleksandr Andrushchenko
2018-09-10  8:14                 ` [Xen-devel][PATCH " Hans Verkuil
2018-09-10  8:14                   ` [PATCH " Hans Verkuil
2018-09-10  8:34                   ` [Xen-devel][PATCH " Oleksandr Andrushchenko
2018-09-10  8:34                     ` [PATCH " Oleksandr Andrushchenko
2018-09-09 10:31   ` [Xen-devel][PATCH " Hans Verkuil
2018-09-09 10:31     ` [PATCH " Hans Verkuil
2018-09-10  7:16     ` [Xen-devel][PATCH " Oleksandr Andrushchenko
2018-09-10  7:16       ` [PATCH " Oleksandr Andrushchenko
2018-09-10  7:53       ` [Xen-devel][PATCH " Hans Verkuil
2018-09-10  7:53         ` [PATCH " Hans Verkuil
2018-09-10  8:24         ` [Xen-devel][PATCH " Oleksandr Andrushchenko
2018-09-10  8:24           ` [PATCH " Oleksandr Andrushchenko
2018-09-10  9:04           ` [Xen-devel][PATCH " Hans Verkuil
2018-09-10  9:04             ` [PATCH " Hans Verkuil
2018-09-10  9:52             ` [Xen-devel][PATCH " Oleksandr Andrushchenko
2018-09-10  9:52               ` [PATCH " Oleksandr Andrushchenko
2018-09-10 11:09               ` [Xen-devel][PATCH " Hans Verkuil
2018-09-10 11:09                 ` [PATCH " Hans Verkuil
2018-09-10 11:49                 ` [Xen-devel][PATCH " Oleksandr Andrushchenko
2018-09-10 11:49                   ` [PATCH " Oleksandr Andrushchenko
2018-09-10 12:26                   ` [Xen-devel][PATCH " Hans Verkuil
2018-09-10 12:26                     ` [PATCH " Hans Verkuil
2018-09-10 13:16                     ` [Xen-devel][PATCH " Oleksandr Andrushchenko
2018-09-10 13:16                       ` [PATCH " Oleksandr Andrushchenko
2018-09-11  6:52                     ` [Xen-devel][PATCH " Oleksandr Andrushchenko
2018-09-11  6:52                       ` [PATCH " Oleksandr Andrushchenko
2018-09-11  7:04                       ` Hans Verkuil [this message]
2018-09-11  7:04                         ` Hans Verkuil
2018-09-11  7:14                         ` [Xen-devel][PATCH " Oleksandr Andrushchenko
2018-09-11  7:14                           ` [PATCH " Oleksandr Andrushchenko
2018-09-11  7:52                           ` [Xen-devel][PATCH " Hans Verkuil
2018-09-11  7:52                             ` [PATCH " Hans Verkuil
2018-09-11  8:09                             ` [Xen-devel][PATCH " Oleksandr Andrushchenko
2018-09-11  8:09                               ` [PATCH " Oleksandr Andrushchenko
2018-09-10 12:48 ` [Xen-devel][PATCH 0/1] cameraif: Add ABI for para-virtualized Laurent Pinchart
2018-09-10 12:48   ` [PATCH " Laurent Pinchart
2018-09-10 13:02   ` [Xen-devel][PATCH " Oleksandr Andrushchenko
2018-09-10 13:02     ` [PATCH " 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=cb233d78-9634-749e-f6a4-6e8692ea6ddd@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=Oleksandr_Andrushchenko@epam.com \
    --cc=andr2000@gmail.com \
    --cc=boris.ostrovsky@oracle.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.