From patchwork Thu Oct 5 13:37:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugues FRUCHET X-Patchwork-Id: 13410024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5C6BAE9370E for ; Thu, 5 Oct 2023 13:38:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :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=5fEQOZf1ezLVR5mmUFCOOvnryJLz2S+2efeimQ35g6g=; b=fPrW6pnXYRndZN m+HAFE2vLs79XHCdNX4bxuMUBFTd/bD4ZrrDg6lo/mcxEbxRwrn/aYqg4IrbidthJjtrjY1eZwPfs gs0jD2Et/mRDXa+JEXL7rlGebTBtqQ5A9p4Dw3E5Si44WEBRgl61AbW9tVVm3etCUV9gatLUQkxBy dwHOWjxJqTcnzJwvYsLXYM4PmNMqH3Wdno0UpnLJX5FacbF05r0CUSo1dsim9ZKC6iHzeiJbOOjd4 d8c4Cv5l2OXsq57A5kGJFippIQFydv0KHNLEKyVky288S+X8ob+aafUpmGxiS+jID5Nmb1eW9c0iQ eA0dmdqi9hFzHh+b4gmQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qoOY5-003UbG-1E; Thu, 05 Oct 2023 13:37:53 +0000 Received: from mx07-00178001.pphosted.com ([185.132.182.106]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qoOY1-003UV4-1n for linux-arm-kernel@lists.infradead.org; Thu, 05 Oct 2023 13:37:51 +0000 Received: from pps.filterd (m0241204.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 3959PGld025910; Thu, 5 Oct 2023 15:37:32 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:content-type; s=selector1; bh=WCUI4Zm GxriT+Ga2/swGoeDwu7aaDGkwS0/rm9KN1Jg=; b=5/0r7HqXG/B8ahJhNoT0LH0 oEFVY/3+ZcCk0k1F7lb2Gc67t8PX4E0QgiqPf3drmZ1ALdhD/aUI+Q7qQtm9RDrF ruItWC2D/GCWBcrASPfsnK2iG3mkHEipcdLC5EXt0tgL6/hn4gvUUPc8Gwx8QAUT Svz1Ig8XGVM9ZltyJuOHu+/vcG3rnWg4U/lSZWy122nDK3ofSTVA0hRnZF8JViyd Z1Xri+nQOt9zUs+lMoSHkWjVl05ko02Fji2GINS0EzarvWO9/uROu73dml5v4+2W aKX0jkCRALpJUVZBN8p19Vf1eoaiDP8WAiEUFdm6ixv7t/8ciHEKypxnZ5LxKLg= = Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3thtg7h2df-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 05 Oct 2023 15:37:32 +0200 (MEST) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 2814110005C; Thu, 5 Oct 2023 15:37:31 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 1BE63260278; Thu, 5 Oct 2023 15:37:31 +0200 (CEST) Received: from localhost (10.201.20.120) by SHFDAG1NODE1.st.com (10.75.129.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 5 Oct 2023 15:37:30 +0200 From: Hugues Fruchet To: Ezequiel Garcia , Philipp Zabel , Andrzej Pietrasiewicz , Nicolas Dufresne , Sakari Ailus , Benjamin Gaignard , Laurent Pinchart , Daniel Almeida , Benjamin Mugnier , Heiko Stuebner , Mauro Carvalho Chehab , Hans Verkuil , , , CC: Hugues Fruchet , Marco Felsch , Adam Ford Subject: [RFC v2 0/6] VP8 H1 stateless encoding Date: Thu, 5 Oct 2023 15:37:04 +0200 Message-ID: <20231005133710.3589080-1-hugues.fruchet@foss.st.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.201.20.120] X-ClientProxiedBy: SHFCAS1NODE1.st.com (10.75.129.72) To SHFDAG1NODE1.st.com (10.75.129.69) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-05_08,2023-10-05_01,2023-05-22_02 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231005_063749_965168_BBDD65CE X-CRM114-Status: GOOD ( 13.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi all, Here is an RFC to support VP8 encoding using Hantro H1 hardware of STM32MP25 SoCs (Verisilicon VC8000NanoE IP). This work is derived from work done to support Rockchip RK3399 VPU2 in RFC [1] with a reshuffling of registers to match H1 register set. This has been tested on STM32MP257F-EV1 evaluation board using GStreamer userspace [2]: gst-launch-1.0 videotestsrc num-buffers=500 ! video/x-raw,width=640,height=480 \ ! v4l2slvp8enc ! queue ! matroskamux ! filesink location=test_vp8.mkv For the sake of simplicity I have embedded here the RFC [1] before the changes related to this exact RFC, all rebased on v6.6 + STM32MP25 hardware codecs support [3]. [1] https://lwn.net/ml/linux-media/20230309125651.23911-1-andrzej.p@collabora.com/ [2] https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3736 [3] https://patchwork.kernel.org/project/linux-media/list/?series=789861 Best regards, Hugues. =========== = history = =========== version 2: - Fix send-mail recipients version 1: - Initial submission Andrzej Pietrasiewicz (2): media: uapi: Add VP8 stateless encoder controls media: hantro: add VP8 encode support for Rockchip RK3399 VPU2 Hugues Fruchet (4): media: hantro: add h1 vp8 encode support media: hantro: add VP8 encode support for STM32MP25 VENC media: hantro: h1: NV12 single-plane support media: hantro: add NV12 single-plane support for STM32MP25 VENC drivers/media/platform/verisilicon/Makefile | 3 + drivers/media/platform/verisilicon/hantro.h | 10 + .../platform/verisilicon/hantro_boolenc.c | 69 + .../platform/verisilicon/hantro_boolenc.h | 21 + .../media/platform/verisilicon/hantro_drv.c | 15 +- .../platform/verisilicon/hantro_h1_jpeg_enc.c | 42 +- .../platform/verisilicon/hantro_h1_regs.h | 71 +- .../platform/verisilicon/hantro_h1_vp8_enc.c | 1589 +++++++++++++++++ .../media/platform/verisilicon/hantro_hw.h | 93 + .../media/platform/verisilicon/hantro_v4l2.c | 5 +- .../media/platform/verisilicon/hantro_vp8.c | 118 ++ .../verisilicon/rockchip_vpu2_hw_vp8_enc.c | 1574 ++++++++++++++++ .../platform/verisilicon/rockchip_vpu2_regs.h | 1 + .../platform/verisilicon/rockchip_vpu_hw.c | 23 +- .../platform/verisilicon/stm32mp25_venc_hw.c | 35 +- drivers/media/v4l2-core/v4l2-ctrls-core.c | 13 + drivers/media/v4l2-core/v4l2-ctrls-defs.c | 5 + include/media/v4l2-ctrls.h | 2 + include/uapi/linux/v4l2-controls.h | 91 + include/uapi/linux/videodev2.h | 3 + 20 files changed, 3755 insertions(+), 28 deletions(-) create mode 100644 drivers/media/platform/verisilicon/hantro_boolenc.c create mode 100644 drivers/media/platform/verisilicon/hantro_boolenc.h create mode 100644 drivers/media/platform/verisilicon/hantro_h1_vp8_enc.c create mode 100644 drivers/media/platform/verisilicon/rockchip_vpu2_hw_vp8_enc.c