mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Benjamin Gaignard <benjamin.gaignard@collabora.com>
To: Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	tfiga@chromium.org, m.szyprowski@samsung.com, mchehab@kernel.org
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel@collabora.com
Subject: Re: [PATCH] media: media videobuf2: Stop direct calls to queue num_buffers field
Date: Tue, 16 Jan 2024 10:32:00 +0100	[thread overview]
Message-ID: <521a2a44-9ec1-4898-aca7-721d07e12643@collabora.com> (raw)
In-Reply-To: <c832da45-c818-420d-aaf8-05c15c1e5426@xs4all.nl>


Le 16/01/2024 à 10:21, Hans Verkuil a écrit :
> On 15/01/2024 18:08, Benjamin Gaignard wrote:
>> Use vb2_get_num_buffers() to avoid using queue num_buffers field directly.
>> This allows us to change how the number of buffers is computed in the
>> future.
>>
>> Fixes: c838530d230b ("media: media videobuf2: Be more flexible on the number of queue stored buffers")
>> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
>> ---
>>   drivers/media/common/videobuf2/videobuf2-core.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobuf2/videobuf2-core.c
>> index 41a832dd1426..b6bf8f232f48 100644
>> --- a/drivers/media/common/videobuf2/videobuf2-core.c
>> +++ b/drivers/media/common/videobuf2/videobuf2-core.c
>> @@ -989,7 +989,7 @@ int vb2_core_create_bufs(struct vb2_queue *q, enum vb2_memory memory,
>>   	bool no_previous_buffers = !q_num_bufs;
>>   	int ret = 0;
>>   
>> -	if (q->num_buffers == q->max_num_buffers) {
>> +	if (q_num_bufs == q->max_num_buffers) {
>>   		dprintk(q, 1, "maximum number of buffers already allocated\n");
>>   		return -ENOBUFS;
>>   	}
> There is another case in vb2_ioctl_create_bufs() where num_buffers is accessed directly.
> Can you fix that one as well?

It is removed by the patch I have send just after this one:
"media: core: Refactor vb2_ioctl_create_bufs() to always set capabilities flags"

Regards,
Benjamin

>
> Regards,
>
> 	Hans
>

  reply	other threads:[~2024-01-16  9:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-15 17:08 [PATCH] media: core: Refactor vb2_ioctl_create_bufs() to always set capabilities flags Benjamin Gaignard
2024-01-15 17:08 ` [PATCH] media: media videobuf2: Stop direct calls to queue num_buffers field Benjamin Gaignard
2024-01-16  9:21   ` Hans Verkuil
2024-01-16  9:32     ` Benjamin Gaignard [this message]
2024-01-18 11:22       ` Tomasz Figa
2024-01-18 11:50         ` Hans Verkuil
2024-01-16 14:03 ` [PATCH] media: core: Refactor vb2_ioctl_create_bufs() to always set capabilities flags Hans Verkuil

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=521a2a44-9ec1-4898-aca7-721d07e12643@collabora.com \
    --to=benjamin.gaignard@collabora.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=kernel@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mchehab@kernel.org \
    --cc=tfiga@chromium.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

all inboxes | Powered by JetHome®