diff mbox series

[1/4] media: atomisp: add missing wait_prepare/finish ops

Message ID 9f401f3732dd728e3d2ca508002c97b80a2eae30.1725265884.git.hverkuil-cisco@xs4all.nl (mailing list archive)
State New
Headers show
Series media: add missing wait_prepare/finish ops | expand

Commit Message

Hans Verkuil Sept. 2, 2024, 8:31 a.m. UTC
Without these ops the v4l2-compliance blocking wait test will fail.
These ops are required to ensure that when VIDIOC_DQBUF has to
wait for buffers to arrive, the queue lock is correctly released
and retaken. Otherwise the wait for a buffer would block all other
queue ioctls.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Hans de Goede <hdegoede@redhat.com>
---
 drivers/staging/media/atomisp/pci/atomisp_fops.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Hans de Goede Sept. 2, 2024, 10:39 a.m. UTC | #1
Hi Hans,

On 9/2/24 10:31 AM, Hans Verkuil wrote:
> Without these ops the v4l2-compliance blocking wait test will fail.
> These ops are required to ensure that when VIDIOC_DQBUF has to
> wait for buffers to arrive, the queue lock is correctly released
> and retaken. Otherwise the wait for a buffer would block all other
> queue ioctls.
> 
> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
> Cc: Hans de Goede <hdegoede@redhat.com>

Thank you for this patch.

I have merged this in my media-atomisp branch:
https://git.kernel.org/pub/scm/linux/kernel/git/hansg/linux.git/log/?h=media-atomisp

I'll run some tests when I'm back home tonight (with access to
atomisp2 hw) before included this in my upcoming atomisp pull-request
for 6.12.

Regards,

Hans


> ---
>  drivers/staging/media/atomisp/pci/atomisp_fops.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/staging/media/atomisp/pci/atomisp_fops.c b/drivers/staging/media/atomisp/pci/atomisp_fops.c
> index 50c4123ba006..b180fcbea9b1 100644
> --- a/drivers/staging/media/atomisp/pci/atomisp_fops.c
> +++ b/drivers/staging/media/atomisp/pci/atomisp_fops.c
> @@ -441,6 +441,8 @@ const struct vb2_ops atomisp_vb2_ops = {
>  	.buf_queue		= atomisp_buf_queue,
>  	.start_streaming	= atomisp_start_streaming,
>  	.stop_streaming		= atomisp_stop_streaming,
> +	.wait_prepare		= vb2_ops_wait_prepare,
> +	.wait_finish		= vb2_ops_wait_finish,
>  };
>  
>  static void atomisp_dev_init_struct(struct atomisp_device *isp)
Hans Verkuil Sept. 3, 2024, 7:59 a.m. UTC | #2
Hi Hans,

On 02/09/2024 12:39, Hans de Goede wrote:
> Hi Hans,
> 
> On 9/2/24 10:31 AM, Hans Verkuil wrote:
>> Without these ops the v4l2-compliance blocking wait test will fail.
>> These ops are required to ensure that when VIDIOC_DQBUF has to
>> wait for buffers to arrive, the queue lock is correctly released
>> and retaken. Otherwise the wait for a buffer would block all other
>> queue ioctls.
>>
>> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
>> Cc: Hans de Goede <hdegoede@redhat.com>
> 
> Thank you for this patch.
> 
> I have merged this in my media-atomisp branch:
> https://git.kernel.org/pub/scm/linux/kernel/git/hansg/linux.git/log/?h=media-atomisp
> 
> I'll run some tests when I'm back home tonight (with access to
> atomisp2 hw) before included this in my upcoming atomisp pull-request
> for 6.12.

Would you be able to post a PR today? We want to switch over to our new gitlab
tree (https://gitlab.freedesktop.org/linux-media/media-staging), but we'd like
to get all PRs for 6.12 merged first.

Regards,

	Hans

> 
> Regards,
> 
> Hans
> 
> 
>> ---
>>  drivers/staging/media/atomisp/pci/atomisp_fops.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/staging/media/atomisp/pci/atomisp_fops.c b/drivers/staging/media/atomisp/pci/atomisp_fops.c
>> index 50c4123ba006..b180fcbea9b1 100644
>> --- a/drivers/staging/media/atomisp/pci/atomisp_fops.c
>> +++ b/drivers/staging/media/atomisp/pci/atomisp_fops.c
>> @@ -441,6 +441,8 @@ const struct vb2_ops atomisp_vb2_ops = {
>>  	.buf_queue		= atomisp_buf_queue,
>>  	.start_streaming	= atomisp_start_streaming,
>>  	.stop_streaming		= atomisp_stop_streaming,
>> +	.wait_prepare		= vb2_ops_wait_prepare,
>> +	.wait_finish		= vb2_ops_wait_finish,
>>  };
>>  
>>  static void atomisp_dev_init_struct(struct atomisp_device *isp)
> 
>
Hans de Goede Sept. 3, 2024, 8:11 a.m. UTC | #3
Hi,

On 9/3/24 9:59 AM, Hans Verkuil wrote:
> Hi Hans,
> 
> On 02/09/2024 12:39, Hans de Goede wrote:
>> Hi Hans,
>>
>> On 9/2/24 10:31 AM, Hans Verkuil wrote:
>>> Without these ops the v4l2-compliance blocking wait test will fail.
>>> These ops are required to ensure that when VIDIOC_DQBUF has to
>>> wait for buffers to arrive, the queue lock is correctly released
>>> and retaken. Otherwise the wait for a buffer would block all other
>>> queue ioctls.
>>>
>>> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
>>> Cc: Hans de Goede <hdegoede@redhat.com>
>>
>> Thank you for this patch.
>>
>> I have merged this in my media-atomisp branch:
>> https://git.kernel.org/pub/scm/linux/kernel/git/hansg/linux.git/log/?h=media-atomisp
>>
>> I'll run some tests when I'm back home tonight (with access to
>> atomisp2 hw) before included this in my upcoming atomisp pull-request
>> for 6.12.
> 
> Would you be able to post a PR today? We want to switch over to our new gitlab
> tree (https://gitlab.freedesktop.org/linux-media/media-staging), but we'd like
> to get all PRs for 6.12 merged first.

Yes I already reviewed + merged all the pending atomisp stuff yesterday.

I just need to merge your "media: staging: atomisp: set lock before
calling vb2_queue_init()" and run a quick test and then I'll send out
the PR today.

Regards,
 
Hans
diff mbox series

Patch

diff --git a/drivers/staging/media/atomisp/pci/atomisp_fops.c b/drivers/staging/media/atomisp/pci/atomisp_fops.c
index 50c4123ba006..b180fcbea9b1 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_fops.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_fops.c
@@ -441,6 +441,8 @@  const struct vb2_ops atomisp_vb2_ops = {
 	.buf_queue		= atomisp_buf_queue,
 	.start_streaming	= atomisp_start_streaming,
 	.stop_streaming		= atomisp_stop_streaming,
+	.wait_prepare		= vb2_ops_wait_prepare,
+	.wait_finish		= vb2_ops_wait_finish,
 };
 
 static void atomisp_dev_init_struct(struct atomisp_device *isp)