From patchwork Thu Mar 30 15:40:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 77235 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1220267vqo; Thu, 30 Mar 2023 08:42:41 -0700 (PDT) X-Google-Smtp-Source: AKy350ZHIM/MFoj2LYVF1ELtoVyhd/+0liPci/aazrpFN29i4DgcDu8PXhenSLsOHIcKfshIP62/ X-Received: by 2002:a17:907:a4c4:b0:93f:8223:221b with SMTP id vq4-20020a170907a4c400b0093f8223221bmr21889740ejc.66.1680190960987; Thu, 30 Mar 2023 08:42:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680190960; cv=none; d=google.com; s=arc-20160816; b=y2Qn07H3RYcpD2UwGZMyJBlcFOhmEiufBL5WEAXxkYte9pK+7uDm2iosM1wllW2cjn U5qEsZWmEk/0Dis2ksjzmnkRLhGJx3cUwbuyNdvhJuud7IiKoWdwlDEDsbCg/NhNOpgI w9KisRy2ZaHK6a5aIhWpd5DEVvZYADQbbsb1x3ey4oR9L4XyLJKkW9bPnlZonrnAlmMr 1eV5XG1AizIL/mTgdFDCu+nrcGACjy9zLCzbUrw2msy1oo8/2fExwNbePX7mdH2T3wKd /zr0Of4ZwaOvMPmmrmKzif2gO7hZodwRdKjj13zDCOZGjyncRBbnFUdY8yNuzB75gLP8 rrIg== 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=QHeZyhq5jK0RF7QwFwukiRf7BxTc+khdYjOdWmETLdA=; b=XkOUSj9JpAKNoCWu/r4un2Im4zOeZdRNMQ5f9oKRSoY/mpUS+bZInNj0HIaP6DzfpB zud7OmHeN7ebOuIMlAq0SvSSoUfY27ffIxcZcYbrc9zdJrobhoeNTCvFoaueAjVQuT1A Q9zBQkrkhaVcvBAdTwfDeIKFd2drWNOdAt5wdWsCxTCnBJ6OpS6Nj+tglL2BXulrczed kH9w+VK6qniO73i/5Oz0nvg5cDoS3lplGPt3p0jV7/SJ/oeKddtsh+UGtsxj8BlIa21Y PQ/hlWzxRiO/2gQsrzP1yAf6cWin0kGaRvkmmnuw8c1bBtuwzdRPIr/cOZkEbjuMfwPr jUxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=OfdxxC+P; 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=QUARANTINE sp=QUARANTINE 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 i9-20020a170906250900b008df684ab75dsi35664302ejb.595.2023.03.30.08.42.08; Thu, 30 Mar 2023 08:42:40 -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=OfdxxC+P; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233326AbjC3PlP (ORCPT + 99 others); Thu, 30 Mar 2023 11:41:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233268AbjC3PlB (ORCPT ); Thu, 30 Mar 2023 11:41:01 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 054DD10E; Thu, 30 Mar 2023 08:40:58 -0700 (PDT) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:792c:96d5:14:366a]) (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 A5303660318B; Thu, 30 Mar 2023 16:40:53 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1680190854; bh=efIIMyuWo/5TTgMlaw7lz63p4NVD+adWtS/yB46zFOY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OfdxxC+PZyphPhkUv8UEJwGHpSxjKIPN5vAOxujOJHCbcSsAfbtek04Vl7EfqDbvZ zuyrFok6ET642Av6lLoEKNatP4WMC25RXAmCYedIJd6YO9+jOAb1ymvbeVzAVeXPAl 7Ub0lv/GJNsxGYp40qBCsEiTPVnnQm+4FVZ3+oAkIyNzPtZp8ASanGmE+1mwfbAZcR PtPSl80khfwpq9FqSIxrA64D0xHDTKe0ElY0JAtexJkQhqdCGwAxMHkBp9LALI7ir7 XGvNejSFY5iAltychEIKI75ZPOck5UbtKm4SaJ+xNtg1Hb+aAWV3drQYx3VOxRqYrN 9sUoBgJFXak/A== 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-cisco@xs4all.nl, nicolas.dufresne@collabora.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 v5 05/13] media: verisilicon: Add AV1 decoder mode and controls Date: Thu, 30 Mar 2023 17:40:35 +0200 Message-Id: <20230330154043.1250736-6-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230330154043.1250736-1-benjamin.gaignard@collabora.com> References: <20230330154043.1250736-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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?1761807917155535358?= X-GMAIL-MSGID: =?utf-8?q?1761807917155535358?= 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 d20e62c025ae..74641c972f1e 100644 --- a/drivers/media/platform/verisilicon/hantro_drv.c +++ b/drivers/media/platform/verisilicon/hantro_drv.c @@ -525,6 +525,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, + }, }, };