Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3086933imw; Mon, 18 Jul 2022 01:42:15 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vlQp/p2nKSwXFwFbgw2sc5QyqTHRZdXzPKp3IVzbBEeaSXeUVDwKGRFZUWZWnzzx3AGKRf X-Received: by 2002:a17:907:75e7:b0:72b:51c6:47a2 with SMTP id jz7-20020a17090775e700b0072b51c647a2mr24643436ejc.147.1658133734817; Mon, 18 Jul 2022 01:42:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658133734; cv=none; d=google.com; s=arc-20160816; b=wcqi6rQXf0ASXdoXouI+5tgKgoHzoBHpNM4z2dYAGpEn2IHHP2IwTQg2CCxYEHlQXs 3NMsUO+Qv65TofuneLSgqmszpmMUCwWs09NfrrRyuVO9fSlij1WgaCrQMLloI8nlQsTC B0Gyj6QS48k8SNmIoMwYri2uNDKz5mx5x9K2gqcX+9qvWKTSmqXBEU5ZbUPXEBto8djG HtDh3fgbGzD7tFvjpljroJhopfB8Fe4lfJn3A+swFLBeUxPCo7R6U5IV7e7tcJ2bofr1 +VHKwha0yc57eE7sm0R73viG+fE3gDzwO/9iRaq7QXEsHDwRfu6p/ogBBbUTRC6c0jEI 9NFA== 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=BN4W1XLjx5e8pnigrlyTP5YU6/PWouce3W5XZc9odiM=; b=tiVVoJqF2y8pi8NqmGy84XwZsKcg0IECNSPKDui/SZJZ5OrCh8CaADgKWGBYo9Ccul x+t++t4LGa5xXCJZXVDkFGhuPHAFpXQ9n/+4a2YomOOXmWqCgj/f7NLzqOV0NNjZ3tNG P88QmMvFMg97uIDbIwJXfYvsf/HhnGeg8/gk3tkADdtLWhUQggo9fXfKvL/ei5NFu0CJ Dj4hSQ0HVUlBq+OsB7kyDkZmJKoMEgWXUTdSAK9FtSy6Gvgq3R7CeMZW6dYM5EwcEq0W sccfjHanMJCh6lLGyIK91QoR8qPv8bHNpygKhfPs966uVUwR+op8xED6tDjAVrr6gsRn +vYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=j2S1hCrr; 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=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y13-20020a056402440d00b0043ac5ba36easi18149177eda.419.2022.07.18.01.41.50; Mon, 18 Jul 2022 01:42:14 -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=j2S1hCrr; 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=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233962AbiGRIkJ (ORCPT + 99 others); Mon, 18 Jul 2022 04:40:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233896AbiGRIj5 (ORCPT ); Mon, 18 Jul 2022 04:39:57 -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 1E4CCDEF0; Mon, 18 Jul 2022 01:39:57 -0700 (PDT) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:4754:89ee:32c6:e620]) (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 5EA206601A3B; Mon, 18 Jul 2022 09:39:55 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1658133595; bh=H6nrAjLgpn/y5TqeB35GnAnTu40ZKr0Id6XGySDlajA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j2S1hCrrScBQVSyg8bwkhfigF2Lxw1SwBr6U/RjWvRzdEQwhMwiLHolvVRF7xcK2Y 1OUEAWLdrceH1JIbwgclCGjpaUSyA4wvIkjqLVU3qCVPe5HrErUbS10mMUWSCu9q/D dE1S+t65oGdOkdVfSFmG1BUmYuJlJivR9ywOSlv761aLLHozwvLge58Z5fXOiGkeEp DVvghtymxkYXCAp2A6XHiY98jMqIhiG6HnBbZB/c02X+cHt3Z9PNnh771B8a/PaV9A n67w3YYO69YsZvaI0sHFCEogSL8jtN5Dazkf2PYNffa0KFHk1Ee6AgF3stW5dChcO6 CJMkUXVcnpiJg== From: Benjamin Gaignard To: mchehab@kernel.org, hverkuil@xs4all.nl, ezequiel@vanguardiasur.com.ar, p.zabel@pengutronix.de, gregkh@linuxfoundation.org, mripard@kernel.org, paul.kocialkowski@bootlin.com, wens@csie.org, jernej.skrabec@gmail.com, samuel@sholland.org, nicolas.dufresne@collabora.com, andrzej.p@collabora.com Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard Subject: [PATCH v2 3/7] media: hantro: HEVC: Fix chroma offset computation Date: Mon, 18 Jul 2022 10:39:41 +0200 Message-Id: <20220718083945.200845-4-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220718083945.200845-1-benjamin.gaignard@collabora.com> References: <20220718083945.200845-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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 The chroma offset depends of the bitstream depth. Make sure that ctx->bit_depth is used to compute it. Signed-off-by: Benjamin Gaignard Reviewed-by: Ezequiel Garcia --- drivers/staging/media/hantro/hantro_g2_hevc_dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/hantro/hantro_g2_hevc_dec.c b/drivers/staging/media/hantro/hantro_g2_hevc_dec.c index 233ecd863d5f..a917079a6ed3 100644 --- a/drivers/staging/media/hantro/hantro_g2_hevc_dec.c +++ b/drivers/staging/media/hantro/hantro_g2_hevc_dec.c @@ -12,7 +12,7 @@ static size_t hantro_hevc_chroma_offset(struct hantro_ctx *ctx) { - return ctx->dst_fmt.width * ctx->dst_fmt.height; + return ctx->dst_fmt.width * ctx->dst_fmt.height * ctx->bit_depth / 8; } static size_t hantro_hevc_motion_vectors_offset(struct hantro_ctx *ctx) -- 2.32.0