From patchwork Thu Sep 14 13:32:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 139697 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp481555vqi; Thu, 14 Sep 2023 09:45:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHg2v06vPXDKZAikHmvGzkFC+NJjyckcvg2lSYFimTOqKXBOo5IZhQjKVDmZ+LM5Hlj/BXP X-Received: by 2002:a05:6a21:78a5:b0:148:656b:9a1f with SMTP id bf37-20020a056a2178a500b00148656b9a1fmr7257357pzc.20.1694709948837; Thu, 14 Sep 2023 09:45:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694709948; cv=none; d=google.com; s=arc-20160816; b=f3QXsKO4lzIcfAFQnwdXWpPFH9N9VtQexDtSWtj9EPb/hVC4uiTeAGPjq2w3m3UgzY Tlf1AgHNvNW8blKVHckvxM3qKvZtr5xfFFbGYwFV9DhWa4LAcQiMjpIu0ToYvZal+2wI LghyKVrso3Q2E5SDmcHUxBv7iihQo5sbjUm4e7KJULtIwNRf5DC036UdcP2Q7yVFQlAy Gb0GgytT3IsXl0SjN11/lS+tw+iwu1ZV6htEB2Ju++URn7nd/AYZxJmgBhPTRKFohI8F SQ+BhZ8Z4LUpRtXxN3oMfUV/5TT/WF+iYEt0BMyt9AcKHwsY6MS71Sqae2VuBvXxPbWZ wSsw== 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=+motrr8z22DTdb1iWQP1XzvpLQL/6rTJbpaD47ZsBhs=; fh=ceA81l8d2hZW6pWH7VE5TwJxtgXUzAubfWIMcikPA1M=; b=VwUTB1s6LFDbs44Eu7rRZGnUEjGoFyG/fb9437JODYRGdJeFYDyUzUlsJJJjE56Pdi GVhU4IxV7ar8aHPpUjpTyqRy+a3LGBgz5fW+bCWZl+DcHFA+XNHCaBmG8bE/gRwx+k2m F7Ip9cx7IsdrZNTzxekM9/jOa8H7vD+HiBYiT4CGxlNkfLGWJwuTuVrRfSWMRKELUtn7 zfS/v7/jQ4Te5tzWEDbf7EULKyw+T0uq1t7TIvub5h6ndTGjjqWwliOezbmK8/QdgzXI a3AQXTw7I+a/MgKghHgDYBqBaThjT6GDt7KUisN6ekiKnzeUPOQf+ZlJjIKni+BAjWlo 32CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="JzNs/qqs"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id ct24-20020a056a000f9800b0068fb4842092si1864400pfb.183.2023.09.14.09.45.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 09:45:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="JzNs/qqs"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 7C0AA823CA21; Thu, 14 Sep 2023 06:35:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239510AbjINNeU (ORCPT + 35 others); Thu, 14 Sep 2023 09:34:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239217AbjINNdx (ORCPT ); Thu, 14 Sep 2023 09:33:53 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0187C1FEC; Thu, 14 Sep 2023 06:33:41 -0700 (PDT) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:36f2:37bd:ccbb:373f]) (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 741D26607356; Thu, 14 Sep 2023 14:33:39 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1694698419; bh=jUystvUPhotVsWFQwzoEvrV6ekQradIDM/On3bu5eyU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JzNs/qqsuOQni5rFNh5FnwVhEdW6UACA0W7zv6lpXOMRQg1Zjd1cRRAJpq34lYOc3 HBwKx3EUT+Bku/VNGm5d7cI3oyJ2ymko6e5D+6mQYlsoALF715+ubY8rEz9dDvu6uI I4Kp0rZeMokBVw7fljsaXntHXQSXmvwVqKvcLhkMRk9J7PMtkCqd8x1ue/wiiWwjIn TKIVhVLQozr7frLJfPYZJyvVkG+mao4mrnKv4hmzhotqb+dRKrArJiTe5FAS0nDveN x9oVlJ1k4DtFsJV4VCLA4SWpRxqhTKKTZA+jp1fiE7aNYwj+TwYIDsMzlERoLEjZwG o6qPTSg3GjcQA== 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 v7 16/49] media: verisilicon: postproc: Fix down scale test Date: Thu, 14 Sep 2023 15:32:50 +0200 Message-Id: <20230914133323.198857-17-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230914133323.198857-1-benjamin.gaignard@collabora.com> References: <20230914133323.198857-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 14 Sep 2023 06:35:33 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777032179319917260 X-GMAIL-MSGID: 1777032179319917260 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") --- 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);