From patchwork Wed Jul 5 12:10:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 116098 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp1822500vqx; Wed, 5 Jul 2023 05:14:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5O27sk0KdTtEVWtu8Rf4ASJiZMhqm/2/7a/yk0ju+Iv6nW1gylIA5+k2O+sMNyrLNYd4wL X-Received: by 2002:a05:6808:1781:b0:39e:b4d3:283f with SMTP id bg1-20020a056808178100b0039eb4d3283fmr18115475oib.7.1688559294299; Wed, 05 Jul 2023 05:14:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688559294; cv=none; d=google.com; s=arc-20160816; b=pWA39DPl29Ud2dPFX2eChDrfaVAALPXeQpDntvhexQjQFr8ugBi/xXXuti7TNcbpWx FMDM0CpffwFym3px/WYuDuSHX069PBkYfboL7Pm02JVcKziF32/xbFOylJPzVW+HEtNa BoGFDlZQiN+Nc98yaN4hT4hYxCF2dRnS10md6Gm3dtni6rVP33H+kKfoUdhxsIfSebf5 itCqHLkDNF7QA5Aj1HAIAtqpAcs743muLSq/LYcfx+kbNCT8CHzfwKsOosKcgn9DRBXn Ueo5ORlpIvlcwGdamreaGZEr79jXh7qy95jyG9M3Kmdm8l5q4MfAA8oq9XpGeKRZQf/y Y8rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bB/3hLtohdB802uCi52FVq0AL+y6QYpMc7PKnsKwbN0=; fh=ceA81l8d2hZW6pWH7VE5TwJxtgXUzAubfWIMcikPA1M=; b=uTHYwna+jrNbOzxsG2cChE9EptLMgsACfcR/Pkx/KrYLGhPgBkqcx27RDaXd7FCxpc p2Meexe5wj+8d4UajfMlwqf3JeDioXU6UO+yefCh7Xd/zPlokbPtk2WfrQ+swshvMco8 xFfcWpukkYM/drYGxPOBgPCMizRvtR1OpWkd6gvOx1IVKYyYreiX0ufIk59iLIxjzqAx 12WItKpDsoE/K9Y/xFvs9yHtt+xNnza63gFjpY1dUwwQUaiHFslVrh6tEpQepMzOmB2V r9eUMa1BINQeNZSm2Y04gRudIHHn7mSmBgl08NvjoOSu+E36JqN4qglCLPxyEzlGETKf wz+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=By8WxvmR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a7-20020a634d07000000b005533cf1fdbfsi24123179pgb.629.2023.07.05.05.14.41; Wed, 05 Jul 2023 05:14:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=By8WxvmR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232095AbjGEMLZ (ORCPT + 99 others); Wed, 5 Jul 2023 08:11:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231825AbjGEMLJ (ORCPT ); Wed, 5 Jul 2023 08:11:09 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAF61CE; Wed, 5 Jul 2023 05:11:08 -0700 (PDT) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:cbfb:e358:222c:d8c1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: benjamin.gaignard) by madras.collabora.co.uk (Postfix) with ESMTPSA id DC0276606FBE; Wed, 5 Jul 2023 13:11:06 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1688559067; bh=6n9YDENO5tS9E5wXFuEEJQVmAp+420F/j+1xBut9kDg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=By8WxvmRq50dxMjr2/Qp1PvcwEYlsrV3YglpBY1hUNNS87Lw+SrJeGbsuZSqJxTbO ci2cphotQ+JxWPgnJ82DzDr6E8A0Et8Pd1EiVw7TG+JXs8/isxXVul8VqV9nn099v0 I6rAvuOpK+ZpVr/Kia8cxeiVh+VcAnvBvA94VsKwS4LsffbM77NgsvfoyxxFixSStD f9LBWSvk1wPcJRQwquS+PVl9CkwRI8ggaHAiSQkWgGm/WmpQzJmMVEeBn23vcqUn8h LOU1docdsKMHpfr+nRqg/EEEhWdLgi4FDrlHuL64ZyhurDNXISqpz8OOX8rZtfrj4x ynicCG9VnoQhw== From: Benjamin Gaignard To: mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, ming.qian@nxp.com, ezequiel@vanguardiasur.com.ar, p.zabel@pengutronix.de, gregkh@linuxfoundation.org, hverkuil-cisco@xs4all.nl, nicolas.dufresne@collabora.com Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard Subject: [PATCH v4 07/10] media: verisilicon: postproc: Fix down scale test Date: Wed, 5 Jul 2023 14:10:53 +0200 Message-Id: <20230705121056.37017-8-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230705121056.37017-1-benjamin.gaignard@collabora.com> References: <20230705121056.37017-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770582750401689599?= X-GMAIL-MSGID: =?utf-8?q?1770582750401689599?= Do not allow down scaling if the source buffer resolution is smaller than destination one. Signed-off-by: Benjamin Gaignard Fixes: fbb6c848dd89 ("media: destage Hantro VPU driver") --- version 4: - Add Fixes tag 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 9dfe3141a398..38e812089514 100644 --- a/drivers/media/platform/verisilicon/hantro_postproc.c +++ b/drivers/media/platform/verisilicon/hantro_postproc.c @@ -103,7 +103,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);