diff mbox series

[v5,03/23] cedrus: set requires_requests

Message ID 20190306211343.15302-4-dafna3@gmail.com (mailing list archive)
State New, archived
Headers show
Series support for stateless decoder | expand

Commit Message

Dafna Hirschfeld March 6, 2019, 9:13 p.m. UTC
From: Hans Verkuil <hverkuil-cisco@xs4all.nl>

The cedrus stateless decoder requires the use of request, so
indicate this by setting requires_requests to 1.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
---
 drivers/staging/media/sunxi/cedrus/cedrus_video.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Paul Kocialkowski March 12, 2019, 3:32 p.m. UTC | #1
Hi,

On Wed, 2019-03-06 at 13:13 -0800, Dafna Hirschfeld wrote:
> From: Hans Verkuil <hverkuil-cisco@xs4all.nl>
> 
> The cedrus stateless decoder requires the use of request, so
> indicate this by setting requires_requests to 1.
> 
> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

Note that this is true for now, but we might need to get rid of the
flag when adding support for decoding JPEG, which may not require the
request API.

Acked-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>

Cheers,

Paul

> ---
>  drivers/staging/media/sunxi/cedrus/cedrus_video.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_video.c b/drivers/staging/media/sunxi/cedrus/cedrus_video.c
> index b47854b3bce4..9673874ece10 100644
> --- a/drivers/staging/media/sunxi/cedrus/cedrus_video.c
> +++ b/drivers/staging/media/sunxi/cedrus/cedrus_video.c
> @@ -536,6 +536,7 @@ int cedrus_queue_init(void *priv, struct vb2_queue *src_vq,
>  	src_vq->lock = &ctx->dev->dev_mutex;
>  	src_vq->dev = ctx->dev->dev;
>  	src_vq->supports_requests = true;
> +	src_vq->requires_requests = true;
>  
>  	ret = vb2_queue_init(src_vq);
>  	if (ret)
Hans Verkuil March 13, 2019, 2:59 p.m. UTC | #2
On 3/12/19 4:32 PM, Paul Kocialkowski wrote:
> Hi,
> 
> On Wed, 2019-03-06 at 13:13 -0800, Dafna Hirschfeld wrote:
>> From: Hans Verkuil <hverkuil-cisco@xs4all.nl>
>>
>> The cedrus stateless decoder requires the use of request, so
>> indicate this by setting requires_requests to 1.
>>
>> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
> 
> Note that this is true for now, but we might need to get rid of the
> flag when adding support for decoding JPEG, which may not require the
> request API.

I thought about this some more, and the flag can just be set or cleared
whenever a new format is set. I.e. when JPEG is selected, then both the
supports_requests and requires_requests flags can be set to false, and
set to true again when a non-JPEG format is set.

Regards,

	Hans

> 
> Acked-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
> 
> Cheers,
> 
> Paul
> 
>> ---
>>  drivers/staging/media/sunxi/cedrus/cedrus_video.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_video.c b/drivers/staging/media/sunxi/cedrus/cedrus_video.c
>> index b47854b3bce4..9673874ece10 100644
>> --- a/drivers/staging/media/sunxi/cedrus/cedrus_video.c
>> +++ b/drivers/staging/media/sunxi/cedrus/cedrus_video.c
>> @@ -536,6 +536,7 @@ int cedrus_queue_init(void *priv, struct vb2_queue *src_vq,
>>  	src_vq->lock = &ctx->dev->dev_mutex;
>>  	src_vq->dev = ctx->dev->dev;
>>  	src_vq->supports_requests = true;
>> +	src_vq->requires_requests = true;
>>  
>>  	ret = vb2_queue_init(src_vq);
>>  	if (ret)
diff mbox series

Patch

diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_video.c b/drivers/staging/media/sunxi/cedrus/cedrus_video.c
index b47854b3bce4..9673874ece10 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus_video.c
+++ b/drivers/staging/media/sunxi/cedrus/cedrus_video.c
@@ -536,6 +536,7 @@  int cedrus_queue_init(void *priv, struct vb2_queue *src_vq,
 	src_vq->lock = &ctx->dev->dev_mutex;
 	src_vq->dev = ctx->dev->dev;
 	src_vq->supports_requests = true;
+	src_vq->requires_requests = true;
 
 	ret = vb2_queue_init(src_vq);
 	if (ret)