From patchwork Tue Jan 3 17:00: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: 38549 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp4723668wrt; Tue, 3 Jan 2023 09:07:04 -0800 (PST) X-Google-Smtp-Source: AMrXdXvw2a9ZEkcD0x2Zwz81UO71Tp3lAjhQPM2uHjELgcK4oEPp6QVSprYi9YgOmHGLhpNEBO6b X-Received: by 2002:a05:6402:33a:b0:461:608f:f3e0 with SMTP id q26-20020a056402033a00b00461608ff3e0mr37770309edw.28.1672765624009; Tue, 03 Jan 2023 09:07:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672765623; cv=none; d=google.com; s=arc-20160816; b=EwLCwGG/Orhpa+1Hbu1bqpPOZ0u5ZbbsZYEDJzVD25b54SULxYVK8DWhMCvj+XaFe7 40ZrkJdf3RO1bf1Wc0OQNQqhbiDB45uVXfnWA6sKbpT57zgw/+F2ViFKPcs8mRl0NVzg Zbk5RPI7fMdqPVdEpb5CWmoBVjeswRrfB9BXLfjCpjQyk0nXFoZM9xHStA5yrf0vLs7D xPlJdnSyv/XSRgztmUix/cvZ8W3UFRSjMyxJaDtUk4DcpqxOal882PcWaU5whRKf9dS5 OpO7Jy+/2zGUYnNGPrY+3R6lCy65u0VyDFWLJpHHDbgtwzD0fh3XJ5Hpz+ZTxhOPXjiR 2lTQ== 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=h1EydOxnua82XLz9mMEKOVRdB7sjvqEuyzotFyFwIUg=; b=S12x66Qe7+x3K9vwt97db5vWg0j6/N68nU5gxjUJV7GWjDsxTrdO2Q23aON5etnusm wvIORFgJjDn7c6vYy+zy6upPeEErt5nIgBdoPPzCq9IA0EAnE+YfHwrXqBZohNsxGeHV u3hj/ZQ4xkZpDRTpm5txtYWgovR/CWJ2LAZh0iN1ZLDe7ZvZNS/WQCjcZQUJTfZUC7XT INWFjgGCgturMligJS9X7ibPfjATpj9+r/IwWCLoyZbxwCVpyZfcBWud4eHLqfDcw8tm Nhy2XLfPuj/8Vo9Oobaa6uwXzCMz8nX7yEGX9c+fxQK6tbMaNWsDkZEBcXhncZeosL1/ wYIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=JBJvQ7xL; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l7-20020aa7d947000000b00489df0e67aasi11790695eds.549.2023.01.03.09.06.40; Tue, 03 Jan 2023 09:07:03 -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=JBJvQ7xL; 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 S238515AbjACRF1 (ORCPT + 99 others); Tue, 3 Jan 2023 12:05:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238394AbjACRE3 (ORCPT ); Tue, 3 Jan 2023 12:04:29 -0500 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 8F1C813F38; Tue, 3 Jan 2023 09:01:26 -0800 (PST) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:abfa:cf23:1e4e:2b14]) (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 AE66C6602CF9; Tue, 3 Jan 2023 17:01:11 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1672765272; bh=1ktFrG0nzxksnbvkGv6J+tRj37JgRFIsxn3noRzsP2s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JBJvQ7xLkim/PUnRbZJmxq6xt5xj0uzkz4vI2eLs9kN2ZFnii9fcPaCYsxj37f9z3 PpjovAX+CHStNWAT166oZTUezPJGjJ5cSyZW5oj4Zzsn5Q3Yi7+WgZvRXAoqu5J4C5 /fBkECyl/v5F+XV4Y2DFclZu4SK9d+KtOY1WKiCgTGSSXw0bYlq0Yf+f95Cfi3jN4T zzdDRixRDGTCyt6I3JrXnbplEbS2m5J2OVUVNcZFkDxiDg624A7Qq+/QMQYBYLauZ2 AhS00u/sZ7cBh9GRNNsKwsTNDK+ehrTq1Gz4vIY1LaK/41eoJi4NZ/OWgLDnNaOEXy H9Owzmc0tinrw== 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, daniel.almeida@collabora.com, nicolas.dufresne@collabora.co.uk 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 , Nicolas Dufresne Subject: [PATCH v2 05/13] media: verisilicon: Add AV1 decoder mode and controls Date: Tue, 3 Jan 2023 18:00:50 +0100 Message-Id: <20230103170058.810597-6-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230103170058.810597-1-benjamin.gaignard@collabora.com> References: <20230103170058.810597-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?1754021886806522002?= X-GMAIL-MSGID: =?utf-8?q?1754021886806522002?= 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 8cb4a68c9119..4500e1fc0f2c 100644 --- a/drivers/media/platform/verisilicon/hantro_drv.c +++ b/drivers/media/platform/verisilicon/hantro_drv.c @@ -498,6 +498,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, + }, }, };