Re: [PATCH v7 16/49] media: verisilicon: postproc: Fix down scale test

From: Benjamin Gaignard
Date: Wed Sep 20 2023 - 03:44:21 EST



Le 19/09/2023 à 13:16, Hans Verkuil a écrit :
On 14/09/2023 15:32, Benjamin Gaignard wrote:
Do not allow down scaling if the source buffer resolution is
smaller than destination one.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@xxxxxxxxxxxxx>
Fixes: fbb6c848dd89 ("media: destage Hantro VPU driver")
Is this really a fix? I gather that this relies on "VP9 resolution change without
doing stream off/on" support, and support for that is added by these patches.

Adding the Fixes tag would cause stable maintainers to queue this patch up for
older kernels, but I don't think that is needed here at all.

And related I also think that this really does not belong to this patch series.

As I understand it, patch 13/49 extends the verisilicon driver to support more
than 32 buffers, so that one makes sense in the context of this series.

But the other verisilicon patches appear to be unrelated and instead add a new
feature, and I don't believe it relates to this series at all.

If I am right, then please post this as a separate series, possibly mentioning
that it sits on top of this series.

Marek has send the same patch and got it merged in stage branch:
https://patchwork.kernel.org/project/linux-media/patch/20230824013935.303132-1-marex@xxxxxxx/
so I can skip it now.

The other patches are needed to enable VP9 dynamic resolution change, which is the feature
I target with this series.
2 patches fix chroma / motion vector offset issues.
1 allow to change the resolution while stream.

Regards,
Benjamin


Regards,

Hans

---
drivers/media/platform/verisilicon/hantro_postproc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/verisilicon/hantro_postproc.c b/drivers/media/platform/verisilicon/hantro_postproc.c
index e624cd98f41b..77d8ecfbe12f 100644
--- a/drivers/media/platform/verisilicon/hantro_postproc.c
+++ b/drivers/media/platform/verisilicon/hantro_postproc.c
@@ -107,7 +107,7 @@ static void hantro_postproc_g1_enable(struct hantro_ctx *ctx)
static int down_scale_factor(struct hantro_ctx *ctx)
{
- if (ctx->src_fmt.width == ctx->dst_fmt.width)
+ if (ctx->src_fmt.width <= ctx->dst_fmt.width)
return 0;
return DIV_ROUND_CLOSEST(ctx->src_fmt.width, ctx->dst_fmt.width);