From patchwork Wed Dec 2 17:44:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jernej_=C5=A0krabec?= X-Patchwork-Id: 11946515 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3376DC64E7B for ; Wed, 2 Dec 2020 17:39:33 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B50A4217A0 for ; Wed, 2 Dec 2020 17:39:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B50A4217A0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=siol.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=PrQvZiKqDIci8a4FWEHfbjN7HbUfiVyB///PEhXs/og=; b=QEdR/57MK5/uxkVRRTaL1wryUS e19f7XcP5boQjBiQ9gZfiNZHke3rhnlDtQAd2eBC5TVVmM2pACzw2OtICnjD0lfQP3DAqMc0x1/6a 9IQEA0gfOb5mEH71qQYMxurNa2T6yMogspQJCxyKT3nUG1ZUf6G6H1JYzpXqN68onP27dl8eaqrRP UlRrs06575fDC7DvTzhRjZ5YgCvp95KFySAnBJ/KvF+QE3KmhXVGv6Hb9G0m2San/0LVyaiWc5YB/ ODFiSKRS8MFQPR6lZhveBOGfrACMh/VLcxfWG0SdXNYcprYu23dO6AIjV27bbKZdI45KUoqJ4JKLb ZU3puagA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkW4z-0005ck-6m; Wed, 02 Dec 2020 17:38:13 +0000 Received: from mailoutvs31.siol.net ([185.57.226.222] helo=mail.siol.net) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkW4v-0005cA-Hk for linux-arm-kernel@lists.infradead.org; Wed, 02 Dec 2020 17:38:10 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.siol.net (Postfix) with ESMTP id E2BA4520BC0; Wed, 2 Dec 2020 18:38:06 +0100 (CET) X-Virus-Scanned: amavisd-new at psrvmta09.zcs-production.pri Received: from mail.siol.net ([127.0.0.1]) by localhost (psrvmta09.zcs-production.pri [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 9W8g8N5VEJ-i; Wed, 2 Dec 2020 18:38:06 +0100 (CET) Received: from mail.siol.net (localhost [127.0.0.1]) by mail.siol.net (Postfix) with ESMTPS id 6609D5208E4; Wed, 2 Dec 2020 18:38:06 +0100 (CET) Received: from kista.localdomain (cpe1-5-97.cable.triera.net [213.161.5.97]) (Authenticated sender: 031275009) by mail.siol.net (Postfix) with ESMTPSA id D8F2C520BC0; Wed, 2 Dec 2020 18:38:05 +0100 (CET) From: Jernej Skrabec To: mripard@kernel.org, hverkuil@xs4all.nl Subject: [PATCH] media: cedrus: Make VP8 codec as capability Date: Wed, 2 Dec 2020 18:44:13 +0100 Message-Id: <20201202174413.303658-1-jernej.skrabec@siol.net> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201202_123809_745490_D3D34991 X-CRM114-Status: GOOD ( 12.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, jernej.skrabec@siol.net, linux-kernel@vger.kernel.org, paul.kocialkowski@bootlin.com, wens@csie.org, mchehab@kernel.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Commit 31d9b9ef8564 ("media: cedrus: Register all codecs as capability") makes separate capability flags for each codec. However, VP8 codec was merged at the same time as mentioned patch, so there is no capability flag for it. This patch adds capability flag for VP8 and enables it for all variants except for V3s. Signed-off-by: Jernej Skrabec --- Note: this should be merged after both of these PRs: https://patchwork.linuxtv.org/project/linux-media/patch/8cf5021f-559c-5ea8-f1f0-250c00bc119d@xs4all.nl/ https://patchwork.linuxtv.org/project/linux-media/patch/5dbd468d-1d10-e0c8-43f0-ebe8f17abef8@xs4all.nl/ drivers/staging/media/sunxi/cedrus/cedrus.c | 27 ++++++++++++------- drivers/staging/media/sunxi/cedrus/cedrus.h | 1 + .../staging/media/sunxi/cedrus/cedrus_video.c | 1 + 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c b/drivers/staging/media/sunxi/cedrus/cedrus.c index dce7cbc95872..c0f226d75feb 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus.c @@ -495,26 +495,30 @@ static int cedrus_remove(struct platform_device *pdev) static const struct cedrus_variant sun4i_a10_cedrus_variant = { .capabilities = CEDRUS_CAPABILITY_MPEG2_DEC | - CEDRUS_CAPABILITY_H264_DEC, + CEDRUS_CAPABILITY_H264_DEC | + CEDRUS_CAPABILITY_VP8_DEC, .mod_rate = 320000000, }; static const struct cedrus_variant sun5i_a13_cedrus_variant = { .capabilities = CEDRUS_CAPABILITY_MPEG2_DEC | - CEDRUS_CAPABILITY_H264_DEC, + CEDRUS_CAPABILITY_H264_DEC | + CEDRUS_CAPABILITY_VP8_DEC, .mod_rate = 320000000, }; static const struct cedrus_variant sun7i_a20_cedrus_variant = { .capabilities = CEDRUS_CAPABILITY_MPEG2_DEC | - CEDRUS_CAPABILITY_H264_DEC, + CEDRUS_CAPABILITY_H264_DEC | + CEDRUS_CAPABILITY_VP8_DEC, .mod_rate = 320000000, }; static const struct cedrus_variant sun8i_a33_cedrus_variant = { .capabilities = CEDRUS_CAPABILITY_UNTILED | CEDRUS_CAPABILITY_MPEG2_DEC | - CEDRUS_CAPABILITY_H264_DEC, + CEDRUS_CAPABILITY_H264_DEC | + CEDRUS_CAPABILITY_VP8_DEC, .mod_rate = 320000000, }; @@ -522,7 +526,8 @@ static const struct cedrus_variant sun8i_h3_cedrus_variant = { .capabilities = CEDRUS_CAPABILITY_UNTILED | CEDRUS_CAPABILITY_MPEG2_DEC | CEDRUS_CAPABILITY_H264_DEC | - CEDRUS_CAPABILITY_H265_DEC, + CEDRUS_CAPABILITY_H265_DEC | + CEDRUS_CAPABILITY_VP8_DEC, .mod_rate = 402000000, }; @@ -535,7 +540,8 @@ static const struct cedrus_variant sun8i_v3s_cedrus_variant = { static const struct cedrus_variant sun8i_r40_cedrus_variant = { .capabilities = CEDRUS_CAPABILITY_UNTILED | CEDRUS_CAPABILITY_MPEG2_DEC | - CEDRUS_CAPABILITY_H264_DEC, + CEDRUS_CAPABILITY_H264_DEC | + CEDRUS_CAPABILITY_VP8_DEC, .mod_rate = 297000000, }; @@ -543,7 +549,8 @@ static const struct cedrus_variant sun50i_a64_cedrus_variant = { .capabilities = CEDRUS_CAPABILITY_UNTILED | CEDRUS_CAPABILITY_MPEG2_DEC | CEDRUS_CAPABILITY_H264_DEC | - CEDRUS_CAPABILITY_H265_DEC, + CEDRUS_CAPABILITY_H265_DEC | + CEDRUS_CAPABILITY_VP8_DEC, .mod_rate = 402000000, }; @@ -551,7 +558,8 @@ static const struct cedrus_variant sun50i_h5_cedrus_variant = { .capabilities = CEDRUS_CAPABILITY_UNTILED | CEDRUS_CAPABILITY_MPEG2_DEC | CEDRUS_CAPABILITY_H264_DEC | - CEDRUS_CAPABILITY_H265_DEC, + CEDRUS_CAPABILITY_H265_DEC | + CEDRUS_CAPABILITY_VP8_DEC, .mod_rate = 402000000, }; @@ -559,7 +567,8 @@ static const struct cedrus_variant sun50i_h6_cedrus_variant = { .capabilities = CEDRUS_CAPABILITY_UNTILED | CEDRUS_CAPABILITY_MPEG2_DEC | CEDRUS_CAPABILITY_H264_DEC | - CEDRUS_CAPABILITY_H265_DEC, + CEDRUS_CAPABILITY_H265_DEC | + CEDRUS_CAPABILITY_VP8_DEC, .quirks = CEDRUS_QUIRK_NO_DMA_OFFSET, .mod_rate = 600000000, }; diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.h b/drivers/staging/media/sunxi/cedrus/cedrus.h index 0bf1cbddac9c..e61c41853ba2 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus.h +++ b/drivers/staging/media/sunxi/cedrus/cedrus.h @@ -31,6 +31,7 @@ #define CEDRUS_CAPABILITY_H265_DEC BIT(1) #define CEDRUS_CAPABILITY_H264_DEC BIT(2) #define CEDRUS_CAPABILITY_MPEG2_DEC BIT(3) +#define CEDRUS_CAPABILITY_VP8_DEC BIT(4) #define CEDRUS_QUIRK_NO_DMA_OFFSET BIT(0) diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_video.c b/drivers/staging/media/sunxi/cedrus/cedrus_video.c index 8a01e6b9bebb..b62eb8e84057 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_video.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus_video.c @@ -53,6 +53,7 @@ static struct cedrus_format cedrus_formats[] = { { .pixelformat = V4L2_PIX_FMT_VP8_FRAME, .directions = CEDRUS_DECODE_SRC, + .capabilities = CEDRUS_CAPABILITY_VP8_DEC, }, { .pixelformat = V4L2_PIX_FMT_SUNXI_TILED_NV12,