Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3018332rwb; Mon, 15 Aug 2022 16:15:07 -0700 (PDT) X-Google-Smtp-Source: AA6agR6JfttoYRVsWV9c6ACmlMLij4/ieCGkuVWvVuUGMwwU2Z+i0srYAYhp6Sg+y2C93mPKUdKH X-Received: by 2002:a05:6402:1e8a:b0:43e:93ab:5ab8 with SMTP id f10-20020a0564021e8a00b0043e93ab5ab8mr16515904edf.211.1660605307174; Mon, 15 Aug 2022 16:15:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605307; cv=none; d=google.com; s=arc-20160816; b=jl62B+x7VIqWVaImJEVGd0FHck4nAI2ido16jy950mTi3+bZHYaQB8ADn8JqcAJQnW Rapc4ekytYCyKviMhlUWjXLMO/Nllz6NX0fAT6G33vPZ5WLyDW4AJ+IlESUT3yOFG7Fd EIhPevcX5OQ6Xackt/N6/bBt7ABbvwlZGDBJvuvdO2XCLXzCMdkCowV8jXt18rB9qc9t sHObPih7AusmpvpIuj89lC9mqg/zFw+/13qdg2ct1uUqtIpRnR9BS2bjzmZZcv5DpI8H 7Ix308KSRMrdAdgTub0iiEZQv5MqclF46HyO9a8QTtaeZgqnOKpPcqacd0oDyOup/aVj aYjQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=onk16QRGU4dQLbLoFMIsVtkpwF+gDfBQQCsBc9Tq2lM=; b=tZ7EtxurwcQTz8cgv+m/qPdTGCZJ/hZVGxBUlv7Yzmu+vt4BS8r4SgkeuzgR1YoUDe GePvLa5xpS9P3YfxM4BBep+DtnjJ9baOazrBh08TB3T0zYlu2Nap22nTnG0pZVgXmWau 74j2qtuZHte/t1rJlUfJpBd9JI9iODwynlbKOJnqvAXJnLkTVOkjiEQsk4cLVHyeBACK OBYB/CGX5QDmbB4Ykrj6IirLqMEDmxCtLRxn9zPVaLrxh8enVB7J4Q5FAe6V4wL4tW6Q N5CmDQ26G++ehE3rb1dteGQbUeJ3rEr1CWFfUEkbTHn3Vha46eIilqs2x9nJV753oVgP FfTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="oVZyy4w/"; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ds4-20020a170907724400b007331436454esi8943165ejc.603.2022.08.15.16.14.18; Mon, 15 Aug 2022 16:15:07 -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=@linuxfoundation.org header.s=korg header.b="oVZyy4w/"; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244347AbiHOVQZ (ORCPT + 99 others); Mon, 15 Aug 2022 17:16:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348016AbiHOVH4 (ORCPT ); Mon, 15 Aug 2022 17:07:56 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D123E3C8C6; Mon, 15 Aug 2022 12:17:44 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7EB0CB810A3; Mon, 15 Aug 2022 19:17:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6816C433C1; Mon, 15 Aug 2022 19:17:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660591062; bh=Mx87WYwyT1wEKTM8f5AUem/0iBZPW2/lVxXm8BygN5g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oVZyy4w/4vVj+o2W3LJN+uXJ7dWogqNsQH7C/zpAhVjyUdZYrotlGH1AA7ZF/HOpw U3vo6dZmINL2o5n4XmRX1JllEQANCMSoAEPBGVirBLZ1IFF8SnYafZnzlxRaS09vOT VLLLTGRpjsA5oTrWu9bfVwpDzaUTfUfBqAEONA0s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Piotr Oniszczuk , Ezequiel Garcia , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.18 0432/1095] media: hantro: Add support for Hantro G1 on RK356x Date: Mon, 15 Aug 2022 19:57:11 +0200 Message-Id: <20220815180447.563742677@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Piotr Oniszczuk [ Upstream commit 5f6bfab6da6531238e899fdf29efd6d0185adc3e ] RK356x has Hantro G1 video decoder capable to decode MPEG2/H.264/VP8 video formats. This patch adds support for RK356x family in existing Hantro video decoder kernel driver. Tested on [1] with FFmpeg v4l2_request code taken from [2] with MPEG2, H.642 and VP8 samples with results [3]. [1] https://github.com/warpme/minimyth2 [2] https://github.com/LibreELEC/LibreELEC.tv/blob/master/packages/multimedia/ffmpeg/patches/v4l2-request/ffmpeg-001-v4l2-request.patch [3] https://github.com/warpme/minimyth2/blob/master/video-test-summary.txt Signed-off-by: Piotr Oniszczuk Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/staging/media/hantro/hantro_drv.c | 1 + drivers/staging/media/hantro/hantro_hw.h | 1 + drivers/staging/media/hantro/rockchip_vpu_hw.c | 14 ++++++++++++++ 3 files changed, 16 insertions(+) diff --git a/drivers/staging/media/hantro/hantro_drv.c b/drivers/staging/media/hantro/hantro_drv.c index bd7d11032c94..ac232b5f7825 100644 --- a/drivers/staging/media/hantro/hantro_drv.c +++ b/drivers/staging/media/hantro/hantro_drv.c @@ -638,6 +638,7 @@ static const struct of_device_id of_hantro_match[] = { { .compatible = "rockchip,rk3288-vpu", .data = &rk3288_vpu_variant, }, { .compatible = "rockchip,rk3328-vpu", .data = &rk3328_vpu_variant, }, { .compatible = "rockchip,rk3399-vpu", .data = &rk3399_vpu_variant, }, + { .compatible = "rockchip,rk3568-vpu", .data = &rk3568_vpu_variant, }, #endif #ifdef CONFIG_VIDEO_HANTRO_IMX8M { .compatible = "nxp,imx8mm-vpu-g1", .data = &imx8mm_vpu_g1_variant, }, diff --git a/drivers/staging/media/hantro/hantro_hw.h b/drivers/staging/media/hantro/hantro_hw.h index ed018e293ba0..c5dc77125fb7 100644 --- a/drivers/staging/media/hantro/hantro_hw.h +++ b/drivers/staging/media/hantro/hantro_hw.h @@ -300,6 +300,7 @@ extern const struct hantro_variant rk3066_vpu_variant; extern const struct hantro_variant rk3288_vpu_variant; extern const struct hantro_variant rk3328_vpu_variant; extern const struct hantro_variant rk3399_vpu_variant; +extern const struct hantro_variant rk3568_vpu_variant; extern const struct hantro_variant sama5d4_vdec_variant; extern const struct hantro_variant sunxi_vpu_variant; diff --git a/drivers/staging/media/hantro/rockchip_vpu_hw.c b/drivers/staging/media/hantro/rockchip_vpu_hw.c index 163cf92eafca..fc96501f3bc8 100644 --- a/drivers/staging/media/hantro/rockchip_vpu_hw.c +++ b/drivers/staging/media/hantro/rockchip_vpu_hw.c @@ -545,6 +545,20 @@ const struct hantro_variant rk3399_vpu_variant = { .num_clocks = ARRAY_SIZE(rockchip_vpu_clk_names) }; +const struct hantro_variant rk3568_vpu_variant = { + .dec_offset = 0x400, + .dec_fmts = rk3399_vpu_dec_fmts, + .num_dec_fmts = ARRAY_SIZE(rk3399_vpu_dec_fmts), + .codec = HANTRO_MPEG2_DECODER | + HANTRO_VP8_DECODER | HANTRO_H264_DECODER, + .codec_ops = rk3399_vpu_codec_ops, + .irqs = rockchip_vdpu2_irqs, + .num_irqs = ARRAY_SIZE(rockchip_vdpu2_irqs), + .init = rockchip_vpu_hw_init, + .clk_names = rockchip_vpu_clk_names, + .num_clocks = ARRAY_SIZE(rockchip_vpu_clk_names) +}; + const struct hantro_variant px30_vpu_variant = { .enc_offset = 0x0, .enc_fmts = rockchip_vpu_enc_fmts, -- 2.35.1