diff mbox series

media: verisilicon: Fix auxiliary buffers allocation size

Message ID 20240328093439.18712-2-benjamin.gaignard@collabora.com (mailing list archive)
State New, archived
Headers show
Series media: verisilicon: Fix auxiliary buffers allocation size | expand

Commit Message

Benjamin Gaignard March 28, 2024, 9:34 a.m. UTC
Use v4l2_av1_tile_info->tile_cols to know the number of colons
in the frame. This made auxiliary buffers meory size computation
more accurate.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Fixes: 727a400686a2 ("media: verisilicon: Add Rockchip AV1 decoder")
---
 .../media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Nicolas Dufresne April 4, 2024, 6 p.m. UTC | #1
Hi,

Le jeudi 28 mars 2024 à 10:34 +0100, Benjamin Gaignard a écrit :
> Use v4l2_av1_tile_info->tile_cols to know the number of colons
> in the frame. This made auxiliary buffers meory size computation
> more accurate.

Seems like this is potentially going to impact some conformance tests. Anything
to report from fluster results ?

Nicolas

> 
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
> Fixes: 727a400686a2 ("media: verisilicon: Add Rockchip AV1 decoder")
> ---
>  .../media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c    | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c b/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
> index cc4483857489..65e8f2d07400 100644
> --- a/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
> +++ b/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
> @@ -257,7 +257,8 @@ static int rockchip_vpu981_av1_dec_tiles_reallocate(struct hantro_ctx *ctx)
>  	struct hantro_dev *vpu = ctx->dev;
>  	struct hantro_av1_dec_hw_ctx *av1_dec = &ctx->av1_dec;
>  	struct hantro_av1_dec_ctrls *ctrls = &av1_dec->ctrls;
> -	unsigned int num_tile_cols = 1 << ctrls->tile_group_entry->tile_col;
> +	const struct v4l2_av1_tile_info *tile_info = &ctrls->frame->tile_info;
> +	unsigned int num_tile_cols = tile_info->tile_cols;
>  	unsigned int height = ALIGN(ctrls->frame->frame_height_minus_1 + 1, 64);
>  	unsigned int height_in_sb = height / 64;
>  	unsigned int stripe_num = ((height + 8) + 63) / 64;
Benjamin Gaignard April 5, 2024, 8:13 a.m. UTC | #2
Le 04/04/2024 à 20:00, Nicolas Dufresne a écrit :
> Hi,
>
> Le jeudi 28 mars 2024 à 10:34 +0100, Benjamin Gaignard a écrit :
>> Use v4l2_av1_tile_info->tile_cols to know the number of colons
>> in the frame. This made auxiliary buffers meory size computation
>> more accurate.
> Seems like this is potentially going to impact some conformance tests. Anything
> to report from fluster results ?

Flusters AV1 score is the same.
Maybe we have been lucky when allocating memory until now.
That said the test stream have 8 tile columns which is unusual but admitted by AV1 specifications.

Benjamin

>
> Nicolas
>
>> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
>> Fixes: 727a400686a2 ("media: verisilicon: Add Rockchip AV1 decoder")
>> ---
>>   .../media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c    | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c b/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
>> index cc4483857489..65e8f2d07400 100644
>> --- a/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
>> +++ b/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
>> @@ -257,7 +257,8 @@ static int rockchip_vpu981_av1_dec_tiles_reallocate(struct hantro_ctx *ctx)
>>   	struct hantro_dev *vpu = ctx->dev;
>>   	struct hantro_av1_dec_hw_ctx *av1_dec = &ctx->av1_dec;
>>   	struct hantro_av1_dec_ctrls *ctrls = &av1_dec->ctrls;
>> -	unsigned int num_tile_cols = 1 << ctrls->tile_group_entry->tile_col;
>> +	const struct v4l2_av1_tile_info *tile_info = &ctrls->frame->tile_info;
>> +	unsigned int num_tile_cols = tile_info->tile_cols;
>>   	unsigned int height = ALIGN(ctrls->frame->frame_height_minus_1 + 1, 64);
>>   	unsigned int height_in_sb = height / 64;
>>   	unsigned int stripe_num = ((height + 8) + 63) / 64;
>
Benjamin Gaignard May 6, 2024, 2:38 p.m. UTC | #3
Le 05/04/2024 à 10:13, Benjamin Gaignard a écrit :
>
> Le 04/04/2024 à 20:00, Nicolas Dufresne a écrit :
>> Hi,
>>
>> Le jeudi 28 mars 2024 à 10:34 +0100, Benjamin Gaignard a écrit :
>>> Use v4l2_av1_tile_info->tile_cols to know the number of colons
>>> in the frame. This made auxiliary buffers meory size computation
>>> more accurate.
>> Seems like this is potentially going to impact some conformance 
>> tests. Anything
>> to report from fluster results ?
>
> Flusters AV1 score is the same.
> Maybe we have been lucky when allocating memory until now.
> That said the test stream have 8 tile columns which is unusual but 
> admitted by AV1 specifications.

Gentle ping,
Regards,
Benjamin

>
> Benjamin
>
>>
>> Nicolas
>>
>>> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
>>> Fixes: 727a400686a2 ("media: verisilicon: Add Rockchip AV1 decoder")
>>> ---
>>> .../media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c | 3 ++-
>>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git 
>>> a/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c 
>>> b/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
>>> index cc4483857489..65e8f2d07400 100644
>>> --- a/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
>>> +++ b/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
>>> @@ -257,7 +257,8 @@ static int 
>>> rockchip_vpu981_av1_dec_tiles_reallocate(struct hantro_ctx *ctx)
>>>       struct hantro_dev *vpu = ctx->dev;
>>>       struct hantro_av1_dec_hw_ctx *av1_dec = &ctx->av1_dec;
>>>       struct hantro_av1_dec_ctrls *ctrls = &av1_dec->ctrls;
>>> -    unsigned int num_tile_cols = 1 << 
>>> ctrls->tile_group_entry->tile_col;
>>> +    const struct v4l2_av1_tile_info *tile_info = 
>>> &ctrls->frame->tile_info;
>>> +    unsigned int num_tile_cols = tile_info->tile_cols;
>>>       unsigned int height = ALIGN(ctrls->frame->frame_height_minus_1 
>>> + 1, 64);
>>>       unsigned int height_in_sb = height / 64;
>>>       unsigned int stripe_num = ((height + 8) + 63) / 64;
>>
Nicolas Dufresne May 13, 2024, 2:52 p.m. UTC | #4
Le jeudi 28 mars 2024 à 10:34 +0100, Benjamin Gaignard a écrit :
> Use v4l2_av1_tile_info->tile_cols to know the number of colons
> in the frame. This made auxiliary buffers meory size computation
> more accurate.
> 
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
> Fixes: 727a400686a2 ("media: verisilicon: Add Rockchip AV1 decoder")

Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>

> ---
>  .../media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c    | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c b/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
> index cc4483857489..65e8f2d07400 100644
> --- a/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
> +++ b/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
> @@ -257,7 +257,8 @@ static int rockchip_vpu981_av1_dec_tiles_reallocate(struct hantro_ctx *ctx)
>  	struct hantro_dev *vpu = ctx->dev;
>  	struct hantro_av1_dec_hw_ctx *av1_dec = &ctx->av1_dec;
>  	struct hantro_av1_dec_ctrls *ctrls = &av1_dec->ctrls;
> -	unsigned int num_tile_cols = 1 << ctrls->tile_group_entry->tile_col;
> +	const struct v4l2_av1_tile_info *tile_info = &ctrls->frame->tile_info;
> +	unsigned int num_tile_cols = tile_info->tile_cols;
>  	unsigned int height = ALIGN(ctrls->frame->frame_height_minus_1 + 1, 64);
>  	unsigned int height_in_sb = height / 64;
>  	unsigned int stripe_num = ((height + 8) + 63) / 64;
diff mbox series

Patch

diff --git a/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c b/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
index cc4483857489..65e8f2d07400 100644
--- a/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
+++ b/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
@@ -257,7 +257,8 @@  static int rockchip_vpu981_av1_dec_tiles_reallocate(struct hantro_ctx *ctx)
 	struct hantro_dev *vpu = ctx->dev;
 	struct hantro_av1_dec_hw_ctx *av1_dec = &ctx->av1_dec;
 	struct hantro_av1_dec_ctrls *ctrls = &av1_dec->ctrls;
-	unsigned int num_tile_cols = 1 << ctrls->tile_group_entry->tile_col;
+	const struct v4l2_av1_tile_info *tile_info = &ctrls->frame->tile_info;
+	unsigned int num_tile_cols = tile_info->tile_cols;
 	unsigned int height = ALIGN(ctrls->frame->frame_height_minus_1 + 1, 64);
 	unsigned int height_in_sb = height / 64;
 	unsigned int stripe_num = ((height + 8) + 63) / 64;