From patchwork Tue Feb 14 14:05: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: 56995 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2993408wrn; Tue, 14 Feb 2023 06:08:52 -0800 (PST) X-Google-Smtp-Source: AK7set/d7p3Dbh01OARSCa3tz+3OYwtpjVSl9OwUI2yVPyDtZ3mqiqamL2MBpb05lcli0K7Ct6aq X-Received: by 2002:a17:902:dccc:b0:19a:8cbf:c6cb with SMTP id t12-20020a170902dccc00b0019a8cbfc6cbmr2371747pll.30.1676383732575; Tue, 14 Feb 2023 06:08:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676383732; cv=none; d=google.com; s=arc-20160816; b=NMzG9Us7WurimThcDsNqfy+KX+bq6WMoFCX1IdonCCuW8oGWMZfHOvgrcXLoM5PMi0 0LRS+pheghV/yrv56IukHNoKAsd9EePpb9bCnr/oAGBSLU/S0igXg9jxR8i0+TCjh1qw UMkAxFk77qgCqqJln0AYxzF+0lgBJgFG6eqzz3jTVIO8zjCC3k9L4Ft8fwdbUlCzP8z9 +64Cl7ayAjfjGH2zqZzv6QmuoqyzjK4DnU0lyides7OtQEL1bciJKY53yx1CV9qkPO3j 5mvHFjGK5V6PYyHAttsr1bkLZ3GcggbKxn5AvK1lNLwl9YNrjv9QOr60xz+JOy21NfVU zL3Q== 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=1Cl4SDmCYNL6hwBwtNRbqwupu0pjCOm+V3aTfnJa4Io=; b=KWxDLyz4q7zkzeouwgqszO3r9XP1HgMeO+iNwmPchLNjMK+NWQ/t9lsaHykQn+ZCt8 pZdHHdD67ark7YuQXVmr/WAicshEk1d8ueyYfzYv7cD6jMlS/TRWNPZ89uMh058RSTVn emv7w2mCpnZpn3CnmArZioxw1X1MGh1wpcHn4Zr5aMkf4YBsbBmP2m88SNza4RXetLp2 VGw8V1WhJrjkjugmVxR0deKiOTkU+kjRRiq91mqyJWEMiPd+m/RTCiE4/Z3tuMfV1gQt +Kyhyg6WlhJnlIT6Sa2wBBEOYV5gIiFWE51caunptMUOq53WzMwIhJS10haI3LLYypr2 z9VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=F4I0T8L1; 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=REJECT sp=REJECT 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 h8-20020a170902748800b0019a940178casi7524170pll.309.2023.02.14.06.08.40; Tue, 14 Feb 2023 06:08:52 -0800 (PST) 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=F4I0T8L1; 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=REJECT sp=REJECT dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233226AbjBNOGj (ORCPT + 99 others); Tue, 14 Feb 2023 09:06:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232508AbjBNOGN (ORCPT ); Tue, 14 Feb 2023 09:06:13 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D74981D91B; Tue, 14 Feb 2023 06:06:11 -0800 (PST) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:37c0:9b2b:ec16:1f37]) (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 BD7256602176; Tue, 14 Feb 2023 14:06:06 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1676383567; bh=1J6gaKNxcimhdWSFcWstzO2+uNE/ZcIodiO3cvBPmQA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F4I0T8L1LDF3wByEw0kvP3jgFzwYqf1LjzntNSpMNf1iPv5d3mKkQrtysf5gefwmW C21Xg/mCAvo6yBl6jnwV2Gzg4wq7ZhMgty8PRPj9AwRNMbg5GrkeHTntSDb5ciVY58 coi7HQS9gaPdJdmuXRa4r4y+34vr/f5u9IkfVdPMdf4uhh9U94M2ZIE1DE3+npgEyy cTfjYK2M29Chkz5QKnkIE1Tgxt0DlDmDC9j6+dkdBe4rTANVhExI3tp1V/NzXQSpQh KtRK8sIimPLWNACA5BwgRuU9YesDL5kfgaZ4bEESCjs+YFGu0qinWBf4LvfpFbTsiT ghfbMZC2FXOhg== From: Benjamin Gaignard To: ezequiel@vanguardiasur.com.ar, p.zabel@pengutronix.de, mchehab@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, heiko@sntech.de, hverkuil@xs4all.nl, nicolas.dufresne@collabora.com, jernej.skrabec@gmail.com Cc: linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@collabora.com, Benjamin Gaignard Subject: [PATCH v4 05/12] media: verisilicon: Add AV1 decoder mode and controls Date: Tue, 14 Feb 2023 15:05:50 +0100 Message-Id: <20230214140557.537984-6-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230214140557.537984-1-benjamin.gaignard@collabora.com> References: <20230214140557.537984-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 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?1757815748554452262?= X-GMAIL-MSGID: =?utf-8?q?1757815748554452262?= Add AV1 decoder as new decoder mode to Hantro driver. Register needed AV1 controls for the decoder. Signed-off-by: Benjamin Gaignard Reviewed-by: Nicolas Dufresne --- drivers/media/platform/verisilicon/hantro.h | 3 +++ .../media/platform/verisilicon/hantro_drv.c | 21 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/drivers/media/platform/verisilicon/hantro.h b/drivers/media/platform/verisilicon/hantro.h index 2989ebc631cc..61480825b856 100644 --- a/drivers/media/platform/verisilicon/hantro.h +++ b/drivers/media/platform/verisilicon/hantro.h @@ -38,6 +38,7 @@ struct hantro_postproc_ops; #define HANTRO_H264_DECODER BIT(18) #define HANTRO_HEVC_DECODER BIT(19) #define HANTRO_VP9_DECODER BIT(20) +#define HANTRO_AV1_DECODER BIT(21) #define HANTRO_DECODERS 0xffff0000 /** @@ -111,6 +112,7 @@ struct hantro_variant { * @HANTRO_MODE_VP8_DEC: VP8 decoder. * @HANTRO_MODE_HEVC_DEC: HEVC decoder. * @HANTRO_MODE_VP9_DEC: VP9 decoder. + * @HANTRO_MODE_AV1_DEC: AV1 decoder */ enum hantro_codec_mode { HANTRO_MODE_NONE = -1, @@ -120,6 +122,7 @@ enum hantro_codec_mode { HANTRO_MODE_VP8_DEC, HANTRO_MODE_HEVC_DEC, HANTRO_MODE_VP9_DEC, + HANTRO_MODE_AV1_DEC, }; /* diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c index 1c4b90c905ea..bc1a85456142 100644 --- a/drivers/media/platform/verisilicon/hantro_drv.c +++ b/drivers/media/platform/verisilicon/hantro_drv.c @@ -527,6 +527,27 @@ static const struct hantro_ctrl controls[] = { .cfg = { .id = V4L2_CID_STATELESS_VP9_COMPRESSED_HDR, }, + }, { + .codec = HANTRO_AV1_DECODER, + .cfg = { + .id = V4L2_CID_STATELESS_AV1_FRAME, + }, + }, { + .codec = HANTRO_AV1_DECODER, + .cfg = { + .id = V4L2_CID_STATELESS_AV1_TILE_GROUP_ENTRY, + .dims = { V4L2_AV1_MAX_TILE_COUNT }, + }, + }, { + .codec = HANTRO_AV1_DECODER, + .cfg = { + .id = V4L2_CID_STATELESS_AV1_SEQUENCE, + }, + }, { + .codec = HANTRO_AV1_DECODER, + .cfg = { + .id = V4L2_CID_STATELESS_AV1_FILM_GRAIN, + }, }, };