Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp248884rdg; Thu, 12 Oct 2023 04:50:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEf26vfa7Z+CKj2E9HViFs7MnNkNdcUejuJ8rSCeBpLUDw3SxUwdGIrPXCQmMjOi5Mo7NDF X-Received: by 2002:a05:6871:314e:b0:1e9:8e2d:1576 with SMTP id lu14-20020a056871314e00b001e98e2d1576mr5395936oac.51.1697111438906; Thu, 12 Oct 2023 04:50:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697111438; cv=none; d=google.com; s=arc-20160816; b=ZLvGql7CUjvE54NftGqNrVqQ1fsDDooZSh1uZVyBKgGBdSJj2btOuc3z5raFL4aima 38nPVFNrcd0wacDX0p4qBjh3cr3Z4H79lf+6NTOAcy1ADN/vPLgQVHxSe6xIiDY8ES/C zLtvZ+FqBBb820+SPBzab9f4Pyw7ZH0BSdUleDnyw9vIO2QmoKgJ4gfA/ng5yhmaF1+w BBYMvOEbDxFTL9cDRaVN9sZQxf3KXujDDDjOH9K0+JcaJEtCoLbyjQ6I5g3PCkF/4TFt aqT0RfceR4sxQyjJzI2ysFXwlwFFDf3/iue3pHLyc4GPmEV0r73F9ABvj9HEBzqCFtYF yR8w== 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=hQaDgVchBvfZHzmenfrSC7XPkayVYBFGO4QaGIVF8jA=; fh=ceA81l8d2hZW6pWH7VE5TwJxtgXUzAubfWIMcikPA1M=; b=g8Jip2N2IaJKTgau677oYCVjekrdnd53yNqr85i0ksiEsSjVQVbBiXx7qITlBUu2ql 3piqDNkXkBdi0ry31+f1zp1Q6yV5DAwOxzcUxyv9EtZWrKUQqUmJn/olYXcC2tquGx7/ Xu1yIjO5zBKq+kbkx6QFoUxMIn2dsu11bGJI4w6YcfGPYb/eJ5dxu3xgu70AJG4YKA5B Arlc5wxdeAFq6rNQ5FuOJFLzTiyPNwxJ80o5KPUtBtSC1r6D/NCK9pSQ6/idW73KNV2r diIpxtLTARHEFoNtLB06dnlYJGekMLMhcttI6PBcRzCU9ftf0GWxcn+oSrvgBcmYOEQC b/Vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=LxskuFoi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id g123-20020a636b81000000b0058bc1c85714si1999382pgc.467.2023.10.12.04.50.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 04:50:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=LxskuFoi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 0632E822CDF2; Thu, 12 Oct 2023 04:50:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379435AbjJLLuH (ORCPT + 99 others); Thu, 12 Oct 2023 07:50:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379202AbjJLLrv (ORCPT ); Thu, 12 Oct 2023 07:47:51 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F969D52; Thu, 12 Oct 2023 04:47:17 -0700 (PDT) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:7ae7:b86d:c19a:877e]) (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 F16D46607352; Thu, 12 Oct 2023 12:47:14 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1697111235; bh=deJM8nlQ4g4jiYxn4KEycstS3ftyfWcamvuNgnfVl08=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LxskuFoiyHlg/yOqclV5V57RMsK3xXFmov06o3eNQk2ctAaG7dL//VDkBlyVSJ3s8 wlqWAeLMjBHNu4qYLoW5wDUEiSbiM/ZQcz1aM6HbF7puac3rL+FfMIGowfyooptOiu 3g8cPd+dapon69H20xSmcKf1Y98xqkOolYxQYgPW8nvscV56mgqYExWut0IXC9gCrU h1mXfBMWgIX9POmqbyEO/phHn/B2alGqbYFIHWr+x6f9d4tN1x3IHfmqLGaMFXJ37J A+KjbJ/CneOaSvJuI/T+nel8D4PETWChkq5pMDZNwK2tgJoBKgEkU86FAHPl5VeoTe pSf5poroqlsVQ== 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 v11 48/56] media: verisilicon: Store chroma and motion vectors offset Date: Thu, 12 Oct 2023 13:46:34 +0200 Message-Id: <20231012114642.19040-49-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231012114642.19040-1-benjamin.gaignard@collabora.com> References: <20231012114642.19040-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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 12 Oct 2023 04:50:38 -0700 (PDT) Store computed values of chroma and motion vectors offset because they depends on width and height values which change if the resolution change. Signed-off-by: Benjamin Gaignard CC: Ezequiel Garcia CC: Philipp Zabel --- drivers/media/platform/verisilicon/hantro.h | 2 ++ drivers/media/platform/verisilicon/hantro_g2_vp9_dec.c | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/verisilicon/hantro.h b/drivers/media/platform/verisilicon/hantro.h index 0948b04a9f8d..6f5eb975d0e3 100644 --- a/drivers/media/platform/verisilicon/hantro.h +++ b/drivers/media/platform/verisilicon/hantro.h @@ -328,6 +328,8 @@ struct hantro_vp9_decoded_buffer_info { /* Info needed when the decoded frame serves as a reference frame. */ unsigned short width; unsigned short height; + size_t chroma_offset; + size_t mv_offset; u32 bit_depth : 4; }; diff --git a/drivers/media/platform/verisilicon/hantro_g2_vp9_dec.c b/drivers/media/platform/verisilicon/hantro_g2_vp9_dec.c index 6fc4b555517f..6db1c32fce4d 100644 --- a/drivers/media/platform/verisilicon/hantro_g2_vp9_dec.c +++ b/drivers/media/platform/verisilicon/hantro_g2_vp9_dec.c @@ -158,9 +158,11 @@ static void config_output(struct hantro_ctx *ctx, chroma_addr = luma_addr + chroma_offset(ctx, dec_params); hantro_write_addr(ctx->dev, G2_OUT_CHROMA_ADDR, chroma_addr); + dst->vp9.chroma_offset = chroma_offset(ctx, dec_params); mv_addr = luma_addr + mv_offset(ctx, dec_params); hantro_write_addr(ctx->dev, G2_OUT_MV_ADDR, mv_addr); + dst->vp9.mv_offset = mv_offset(ctx, dec_params); } struct hantro_vp9_ref_reg { @@ -195,7 +197,7 @@ static void config_ref(struct hantro_ctx *ctx, luma_addr = hantro_get_dec_buf_addr(ctx, &buf->base.vb.vb2_buf); hantro_write_addr(ctx->dev, ref_reg->y_base, luma_addr); - chroma_addr = luma_addr + chroma_offset(ctx, dec_params); + chroma_addr = luma_addr + buf->vp9.chroma_offset; hantro_write_addr(ctx->dev, ref_reg->c_base, chroma_addr); } @@ -238,7 +240,7 @@ static void config_ref_registers(struct hantro_ctx *ctx, config_ref(ctx, dst, &ref_regs[2], dec_params, dec_params->alt_frame_ts); mv_addr = hantro_get_dec_buf_addr(ctx, &mv_ref->base.vb.vb2_buf) + - mv_offset(ctx, dec_params); + mv_ref->vp9.mv_offset; hantro_write_addr(ctx->dev, G2_REF_MV_ADDR(0), mv_addr); hantro_reg_write(ctx->dev, &vp9_last_sign_bias, -- 2.39.2