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 v5 1/1] cameraif: add ABI for para-virtual camera
Date: Tue, 12 Mar 2019 11:09:03 +0100	[thread overview]
Message-ID: <2689ce24-0ac0-206f-bd5a-64dddb0a6b10@xs4all.nl> (raw)
In-Reply-To: <e5c8e820-8867-c77a-8902-9e0ea9275082@gmail.com>

On 3/12/19 10:35 AM, Oleksandr Andrushchenko wrote:
> On 3/12/19 11:30 AM, Hans Verkuil wrote:
>> On 3/12/19 10:08 AM, Oleksandr Andrushchenko wrote:
>>> On 3/12/19 10:58 AM, Hans Verkuil wrote:
>>>> Hi Oleksandr,
>>>>
>>>> Just one comment:
>>>>
>>>> On 3/12/19 9:20 AM, Oleksandr Andrushchenko wrote:
>>>>> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
>>>>>
>>>>> This is the ABI for the two halves of a para-virtualized
>>>>> camera driver which extends Xen's reach multimedia capabilities even
>>>>> farther enabling it for video conferencing, In-Vehicle Infotainment,
>>>>> high definition maps etc.
>>>>>
>>>>> The initial goal is to support most needed functionality with the
>>>>> final idea to make it possible to extend the protocol if need be:
>>>>>
>>>>> 1. Provide means for base virtual device configuration:
>>>>>    - pixel formats
>>>>>    - resolutions
>>>>>    - frame rates
>>>>> 2. Support basic camera controls:
>>>>>    - contrast
>>>>>    - brightness
>>>>>    - hue
>>>>>    - saturation
>>>>> 3. Support streaming control
>>>>>
>>>>> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
>>>>> ---
>>>>>    xen/include/public/io/cameraif.h | 1370 ++++++++++++++++++++++++++++++
>>>>>    1 file changed, 1370 insertions(+)
>>>>>    create mode 100644 xen/include/public/io/cameraif.h
>>>>>
>>>>> diff --git a/xen/include/public/io/cameraif.h b/xen/include/public/io/cameraif.h
>>>>> new file mode 100644
>>>>> index 000000000000..1ae4c51ea758
>>>>> --- /dev/null
>>>>> +++ b/xen/include/public/io/cameraif.h
>>>>> @@ -0,0 +1,1370 @@
>>>> <snip>
>>>>
>>>>> +/*
>>>>> + * Request camera buffer's layout:
>>>>> + *         0                1                 2               3        octet
>>>>> + * +----------------+----------------+----------------+----------------+
>>>>> + * |               id                | _BUF_GET_LAYOUT|   reserved     | 4
>>>>> + * +----------------+----------------+----------------+----------------+
>>>>> + * |                             reserved                              | 8
>>>>> + * +----------------+----------------+----------------+----------------+
>>>>> + * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
>>>>> + * +----------------+----------------+----------------+----------------+
>>>>> + * |                             reserved                              | 64
>>>>> + * +----------------+----------------+----------------+----------------+
>>>>> + *
>>>>> + * See response format for this request.
>>>>> + *
>>>>> + *
>>>>> + * Request number of buffers to be used:
>>>>> + *         0                1                 2               3        octet
>>>>> + * +----------------+----------------+----------------+----------------+
>>>>> + * |               id                | _OP_BUF_REQUEST|   reserved     | 4
>>>>> + * +----------------+----------------+----------------+----------------+
>>>>> + * |                             reserved                              | 8
>>>>> + * +----------------+----------------+----------------+----------------+
>>>>> + * |    num_bufs    |                     reserved                     | 12
>>>>> + * +----------------+----------------+----------------+----------------+
>>>>> + * |                             reserved                              | 16
>>>>> + * +----------------+----------------+----------------+----------------+
>>>>> + * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
>>>>> + * +----------------+----------------+----------------+----------------+
>>>>> + * |                             reserved                              | 64
>>>>> + * +----------------+----------------+----------------+----------------+
>>>>> + *
>>>>> + * num_bufs - uint8_t, desired number of buffers to be used.
>>>>> + *
>>>>> + * If num_bufs is not zero then the backend validates the requested number of
>>>>> + * buffers and responds with the number of buffers allowed for this frontend.
>>>>> + * Frontend is responsible for checking the corresponding response in order to
>>>>> + * see if the values reported back by the backend do match the desired ones
>>>>> + * and can be accepted.
>>>>> + * Frontend is allowed to send multiple XENCAMERA_OP_BUF_REQUEST requests
>>>>> + * before sending XENCAMERA_OP_STREAM_START request to update or tune the
>>>>> + * final configuration.
>>>>> + * Frontend is not allowed to change the number of buffers and/or camera
>>>>> + * configuration after the streaming has started.
>>>> This last sentence isn't quite right, and I missed that when reviewing the
>>>> proposed text during the v4 discussions.
>>>>
>>>> The bit about not being allowed to change the number of buffers when streaming
>>>> has started is correct.
>>>>
>>>> But the camera configuration is more strict: you can't change the camera
>>>> configuration after this request unless you call this again with num_bufs = 0.
>>>>
>>>> The camera configuration changes the buffer size, so once the buffers are
>>>> allocated you can no longer change the camera config. It is unrelated to streaming.
>>> Can you please give me a hint of what would be the right thing to put in?
>> How about this:
>>
>> Frontend is not allowed to change the camera configuration after this call with
>> a non-zero value of num_bufs. If camera reconfiguration is required then this
>> request must be sent with num_bufs set to zero and any created buffers must be
>> destroyed first.
>>
>> Frontend is not allowed to change the number of buffers after the streaming has started.
> Sounds great, so I'll replace:
> 
> "Frontend is not allowed to change the number of buffers and/or camera
>   configuration after the streaming has started."
> 
> with:
> 
> "Frontend is not allowed to change the camera configuration after this 
> call with
>   a non-zero value of num_bufs. If camera reconfiguration is required 
> then this
>   request must be sent with num_bufs set to zero and any created buffers 
> must be
>   destroyed first.
> 
>   Frontend is not allowed to change the number of buffers after the 
> streaming has started.
> "
> 
> Are these all the changes you see at the moment?

Also this change below...

>>>>> + *
>>>>> + * If num_bufs is 0 and streaming has not started yet, then the backend will
>>>>> + * free all previously allocated buffers (if any).
>>>>> + * Trying to call this if streaming is in progress will result in an error.
>>>>> + *
>>>>> + * If camera reconfiguration is required then the streaming must be stopped
>>>>> + * and this request must be sent with num_bufs set to zero and finally
>>>>> + * buffers destroyed.
>> I would rewrite the last part as well:
>>
>> ...set to zero and any created buffers must be destroyed.

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

And note my note below :-)

>>
>>
>> Note that "any created buffers must be destroyed" is something that you need to
>> check for in your code if I am not mistaken.

^^^^^^^^^^^^^^^^^

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 v5 1/1] cameraif: add ABI for para-virtual camera
Date: Tue, 12 Mar 2019 11:09:03 +0100	[thread overview]
Message-ID: <2689ce24-0ac0-206f-bd5a-64dddb0a6b10@xs4all.nl> (raw)
In-Reply-To: <e5c8e820-8867-c77a-8902-9e0ea9275082@gmail.com>

On 3/12/19 10:35 AM, Oleksandr Andrushchenko wrote:
> On 3/12/19 11:30 AM, Hans Verkuil wrote:
>> On 3/12/19 10:08 AM, Oleksandr Andrushchenko wrote:
>>> On 3/12/19 10:58 AM, Hans Verkuil wrote:
>>>> Hi Oleksandr,
>>>>
>>>> Just one comment:
>>>>
>>>> On 3/12/19 9:20 AM, Oleksandr Andrushchenko wrote:
>>>>> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
>>>>>
>>>>> This is the ABI for the two halves of a para-virtualized
>>>>> camera driver which extends Xen's reach multimedia capabilities even
>>>>> farther enabling it for video conferencing, In-Vehicle Infotainment,
>>>>> high definition maps etc.
>>>>>
>>>>> The initial goal is to support most needed functionality with the
>>>>> final idea to make it possible to extend the protocol if need be:
>>>>>
>>>>> 1. Provide means for base virtual device configuration:
>>>>>    - pixel formats
>>>>>    - resolutions
>>>>>    - frame rates
>>>>> 2. Support basic camera controls:
>>>>>    - contrast
>>>>>    - brightness
>>>>>    - hue
>>>>>    - saturation
>>>>> 3. Support streaming control
>>>>>
>>>>> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
>>>>> ---
>>>>>    xen/include/public/io/cameraif.h | 1370 ++++++++++++++++++++++++++++++
>>>>>    1 file changed, 1370 insertions(+)
>>>>>    create mode 100644 xen/include/public/io/cameraif.h
>>>>>
>>>>> diff --git a/xen/include/public/io/cameraif.h b/xen/include/public/io/cameraif.h
>>>>> new file mode 100644
>>>>> index 000000000000..1ae4c51ea758
>>>>> --- /dev/null
>>>>> +++ b/xen/include/public/io/cameraif.h
>>>>> @@ -0,0 +1,1370 @@
>>>> <snip>
>>>>
>>>>> +/*
>>>>> + * Request camera buffer's layout:
>>>>> + *         0                1                 2               3        octet
>>>>> + * +----------------+----------------+----------------+----------------+
>>>>> + * |               id                | _BUF_GET_LAYOUT|   reserved     | 4
>>>>> + * +----------------+----------------+----------------+----------------+
>>>>> + * |                             reserved                              | 8
>>>>> + * +----------------+----------------+----------------+----------------+
>>>>> + * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
>>>>> + * +----------------+----------------+----------------+----------------+
>>>>> + * |                             reserved                              | 64
>>>>> + * +----------------+----------------+----------------+----------------+
>>>>> + *
>>>>> + * See response format for this request.
>>>>> + *
>>>>> + *
>>>>> + * Request number of buffers to be used:
>>>>> + *         0                1                 2               3        octet
>>>>> + * +----------------+----------------+----------------+----------------+
>>>>> + * |               id                | _OP_BUF_REQUEST|   reserved     | 4
>>>>> + * +----------------+----------------+----------------+----------------+
>>>>> + * |                             reserved                              | 8
>>>>> + * +----------------+----------------+----------------+----------------+
>>>>> + * |    num_bufs    |                     reserved                     | 12
>>>>> + * +----------------+----------------+----------------+----------------+
>>>>> + * |                             reserved                              | 16
>>>>> + * +----------------+----------------+----------------+----------------+
>>>>> + * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
>>>>> + * +----------------+----------------+----------------+----------------+
>>>>> + * |                             reserved                              | 64
>>>>> + * +----------------+----------------+----------------+----------------+
>>>>> + *
>>>>> + * num_bufs - uint8_t, desired number of buffers to be used.
>>>>> + *
>>>>> + * If num_bufs is not zero then the backend validates the requested number of
>>>>> + * buffers and responds with the number of buffers allowed for this frontend.
>>>>> + * Frontend is responsible for checking the corresponding response in order to
>>>>> + * see if the values reported back by the backend do match the desired ones
>>>>> + * and can be accepted.
>>>>> + * Frontend is allowed to send multiple XENCAMERA_OP_BUF_REQUEST requests
>>>>> + * before sending XENCAMERA_OP_STREAM_START request to update or tune the
>>>>> + * final configuration.
>>>>> + * Frontend is not allowed to change the number of buffers and/or camera
>>>>> + * configuration after the streaming has started.
>>>> This last sentence isn't quite right, and I missed that when reviewing the
>>>> proposed text during the v4 discussions.
>>>>
>>>> The bit about not being allowed to change the number of buffers when streaming
>>>> has started is correct.
>>>>
>>>> But the camera configuration is more strict: you can't change the camera
>>>> configuration after this request unless you call this again with num_bufs = 0.
>>>>
>>>> The camera configuration changes the buffer size, so once the buffers are
>>>> allocated you can no longer change the camera config. It is unrelated to streaming.
>>> Can you please give me a hint of what would be the right thing to put in?
>> How about this:
>>
>> Frontend is not allowed to change the camera configuration after this call with
>> a non-zero value of num_bufs. If camera reconfiguration is required then this
>> request must be sent with num_bufs set to zero and any created buffers must be
>> destroyed first.
>>
>> Frontend is not allowed to change the number of buffers after the streaming has started.
> Sounds great, so I'll replace:
> 
> "Frontend is not allowed to change the number of buffers and/or camera
>   configuration after the streaming has started."
> 
> with:
> 
> "Frontend is not allowed to change the camera configuration after this 
> call with
>   a non-zero value of num_bufs. If camera reconfiguration is required 
> then this
>   request must be sent with num_bufs set to zero and any created buffers 
> must be
>   destroyed first.
> 
>   Frontend is not allowed to change the number of buffers after the 
> streaming has started.
> "
> 
> Are these all the changes you see at the moment?

Also this change below...

>>>>> + *
>>>>> + * If num_bufs is 0 and streaming has not started yet, then the backend will
>>>>> + * free all previously allocated buffers (if any).
>>>>> + * Trying to call this if streaming is in progress will result in an error.
>>>>> + *
>>>>> + * If camera reconfiguration is required then the streaming must be stopped
>>>>> + * and this request must be sent with num_bufs set to zero and finally
>>>>> + * buffers destroyed.
>> I would rewrite the last part as well:
>>
>> ...set to zero and any created buffers must be destroyed.

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

And note my note below :-)

>>
>>
>> Note that "any created buffers must be destroyed" is something that you need to
>> check for in your code if I am not mistaken.

^^^^^^^^^^^^^^^^^

Regards,

	Hans

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

  reply	other threads:[~2019-03-12 10:09 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-12  8:19 [Xen-devel][PATCH v5 0/1] cameraif: add ABI for para-virtual camera Oleksandr Andrushchenko
2019-03-12  8:19 ` [PATCH " Oleksandr Andrushchenko
2019-03-12  8:20 ` [Xen-devel][PATCH v5 1/1] " Oleksandr Andrushchenko
2019-03-12  8:20   ` [PATCH " Oleksandr Andrushchenko
2019-03-12  8:38   ` [Xen-devel][PATCH " Juergen Gross
2019-03-12  8:38     ` [PATCH " Juergen Gross
2019-03-13  8:46     ` [Xen-devel][PATCH " Oleksandr Andrushchenko
2019-03-13  8:46       ` [PATCH " Oleksandr Andrushchenko
2019-03-12  8:58   ` [Xen-devel][PATCH " Hans Verkuil
2019-03-12  8:58     ` [PATCH " Hans Verkuil
2019-03-12  9:08     ` [Xen-devel][PATCH " Oleksandr Andrushchenko
2019-03-12  9:08       ` [PATCH " Oleksandr Andrushchenko
2019-03-12  9:30       ` [Xen-devel][PATCH " Hans Verkuil
2019-03-12  9:30         ` [PATCH " Hans Verkuil
2019-03-12  9:35         ` [Xen-devel][PATCH " Oleksandr Andrushchenko
2019-03-12  9:35           ` [PATCH " Oleksandr Andrushchenko
2019-03-12 10:09           ` Hans Verkuil [this message]
2019-03-12 10:09             ` Hans Verkuil
2019-03-12 10:11             ` [Xen-devel][PATCH " Oleksandr Andrushchenko
2019-03-12 10:11               ` [PATCH " Oleksandr Andrushchenko
2019-03-12  8:38 ` [Xen-devel][PATCH v5 0/1] " Oleksandr Andrushchenko
2019-03-12  8:38   ` [PATCH " Oleksandr Andrushchenko
2019-03-12  8:48 ` Juergen Gross
2019-03-12  9:07   ` Jan Beulich
2019-03-12  9:13     ` Oleksandr Andrushchenko
2019-03-12  9:23       ` Jan Beulich
2019-03-12 10:43     ` George Dunlap
2019-03-12 11:41       ` Jan Beulich
     [not found]   ` <5C8776B8020000780021D8B5@suse.com>
2019-03-12  9:15     ` Juergen Gross
2019-03-12  9:24       ` Jan Beulich
2019-03-12 12:07       ` Wei Liu

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=2689ce24-0ac0-206f-bd5a-64dddb0a6b10@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.