From patchwork Wed Jan 11 16:59:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 42096 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3432824wrt; Wed, 11 Jan 2023 09:03:33 -0800 (PST) X-Google-Smtp-Source: AMrXdXvo2q0cazL8YXKEdZwTmia5spb3nOnfFTfkcZhu6mx1OPz+GXtY1L24auLrZKqKYbBv3Q20 X-Received: by 2002:a17:907:7707:b0:844:c651:ce4b with SMTP id kw7-20020a170907770700b00844c651ce4bmr60111913ejc.33.1673456613497; Wed, 11 Jan 2023 09:03:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673456613; cv=none; d=google.com; s=arc-20160816; b=r9zmiMeCW5cVX9QOLUdo15OtKAedHR4KwakU0L9/oSHobFmJGIVvMMWd1iePuplQwz Q1Hd6icgya+5Ml2x6uXPl1j5IsZ1U6jNS4RxuHiaYc5zE+SO4/MjICjjdgxXlSGklxlR Dwbg52nNEt02QbVVlCOMDDZE9bOR3lbrjMuSVjc8aIjrMQIxfxw3yILJp0Owqteempog Se3w8tq7x5upAoYkM2uMkydB6M7CSHxQnMPNL/JygcGhc/Bj09juvtI53G3j+/GRMcDu vnrG12rR8ROFbbwblVm3Jfu6qSwON4rjNAKvFWrgtnB1CQEiCSglLa0dyOpUsI3Zcgds u6hA== 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=iDYA56Ar/p7LUGhnBbB9zJd2p6YeHycp75M4usyoQaUkpBWmt7v9OSVPpJsqGk+kfo 0OGLhgiPl38REPsCe12muQC1pG4DsthkFrX8CVyWcLscJG39q9u0AXZTbcpsL92HJuSp ogLswh1D+uu56nq+XYLwwazun++vjtb8h/wgDSOJYy+UjKh5ePshrimyiFXkW1+754vX dSCrMDzNSY210xsC1ppRVE4jYUDy/kP8/wgUbwZCOL5S3V+gkhz3Quqhyh6FLnreBOTJ cJ29/+3LWA6bdDyadv5j9Ig4+nXpZYSpKbrbj6l9w9ZcrzKJnvFICZDA5f4VQ0SiaJ0w H9hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=hQnUte8w; 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 wu7-20020a170906eec700b0084d34face39si11436852ejb.759.2023.01.11.09.03.05; Wed, 11 Jan 2023 09:03:33 -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=hQnUte8w; 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 S235829AbjAKRAM (ORCPT + 99 others); Wed, 11 Jan 2023 12:00:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235553AbjAKQ7p (ORCPT ); Wed, 11 Jan 2023 11:59:45 -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 938E9CC9; Wed, 11 Jan 2023 08:59:43 -0800 (PST) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:1ee3:efce:e4f6:17a3]) (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 C50DA6602DAB; Wed, 11 Jan 2023 16:59:41 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1673456382; bh=1ktFrG0nzxksnbvkGv6J+tRj37JgRFIsxn3noRzsP2s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hQnUte8wsokAo5aqNeRHfh9wHTMAUlFy8acSOQ1fBFdmHcscFGxgSmF9MUFQ0Hk6L O0CY1eYK/dMIen/3SuqQLtqOjZwXAe/OTkVsAkrcCJSO1fFr212BQ9Lf20T736GCpK cM8Nf0j32A93B1MU89Qr5u4dtiJEM9JQS7b7yS+EsKBZ+iwgqAFIIQmxzKbx27mfRs YBxjI4wC+7hENaX/B2pPJDbPdK4gLVjTVV+kQtYj1UHXf3ba5RcjRHINu2kHi/wJa2 vqEAleYWMRZGvmKxa7nGszely8tAiyTgdgv6wb6R4JH2xWMcexE0J0/MwhLJvJ1hHB dzLHNzKd4RB1Q== 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 v3 05/13] media: verisilicon: Add AV1 decoder mode and controls Date: Wed, 11 Jan 2023 17:59:23 +0100 Message-Id: <20230111165931.753763-6-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230111165931.753763-1-benjamin.gaignard@collabora.com> References: <20230111165931.753763-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?1754746441919639422?= X-GMAIL-MSGID: =?utf-8?q?1754746441919639422?= 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, + }, }, };