From patchwork Tue Jan 9 08:51:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugues Fruchet X-Patchwork-Id: 18853 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:37c1:b0:101:2151:f287 with SMTP id y1csp1521905dyq; Tue, 9 Jan 2024 00:53:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IFam0xPGQps6VeIQCO4+jRXNExQ4EjItgxBde9bVrGmO+DM/WvPZ35YhXF38mqgW1HswvBb X-Received: by 2002:a62:b513:0:b0:6d9:c784:9c8f with SMTP id y19-20020a62b513000000b006d9c7849c8fmr5111302pfe.36.1704790407415; Tue, 09 Jan 2024 00:53:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704790407; cv=none; d=google.com; s=arc-20160816; b=z6GkK3Vw+wuTi3HuUPY/Wd03l4h7CAXJv7AADPxcYbxrxHD59VT6J9QrAWSqHhpjRS YjSHZJC+Q9JYS2kqdPhjR6V6/iRqKJuxqmTP6zp2m+fNwKj7g/rMCitbNEIlhDI+KQMR RmEpm0BXEz2dhwlDFqZIAe1bjUiHwz5q1v53AojCIxjo1EJSFkeuOuHnOSqPh5Yh8KMm jumjA44at+1BZR4fkMYbGMaL5CqJNxpPw/2BT5V26L+NeMBS85sWCD6YJcddBxSg52R7 HWQ/MSgB8VKaxn6w4pUmRGGAOX5JFakMxA5t+BEdpfJ8ecpA10FLbRlqaApQCIUb1NfD 1DFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=mEkudfnbPoeAGsN0k1FwZZxBRhXTdPPOdbTjUnhj2ac=; fh=d3+8QaZL5Q12BYNNjvgOop8BJQqBBykIHDvrQ47QtiM=; b=TSqyczLPVGL29eCM/e1PBmYudIXNjb7wqt13ppc7wLWQt+KXUP69HqJGfBIYBj8fda 3+5OTEq+5wIfasivWT5IGNvIvkE7mREzBMYpxkOCb2+x0xLMhfAjBwr7WDKSPOzSBlrM k/krfcYZJYaX8iB3ZK9uUMDig6oPHste8xamJlorSqRPsPIQUUSfilUScTdUnSwGhAcP NiFnl75j/gHlejZ+2NArrByqFaC7k2kDep2Fvbu7VtvU+trcGo92LHOUBkUy9UHRSMtm xiWFxOdcaoEWpG7rFtz2XdlmWzbneAPbE1Zqs5mEm6NTdnu8HCgxbHFrNXRZh3Wd1q5Y jhow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=uEKeNxaU; spf=pass (google.com: domain of linux-kernel+bounces-20616-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20616-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id a30-20020a62d41e000000b006dafe3d7330si1154140pfh.377.2024.01.09.00.53.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 00:53:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-20616-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=uEKeNxaU; spf=pass (google.com: domain of linux-kernel+bounces-20616-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20616-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 4411C28600D for ; Tue, 9 Jan 2024 08:53:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 208CB35EEF; Tue, 9 Jan 2024 08:52:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=foss.st.com header.i=@foss.st.com header.b="uEKeNxaU" Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF3712E636; Tue, 9 Jan 2024 08:52:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=foss.st.com Received: from pps.filterd (m0241204.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 409343pj004773; Tue, 9 Jan 2024 09:52:04 +0100 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=mEkudfn bPoeAGsN0k1FwZZxBRhXTdPPOdbTjUnhj2ac=; b=uEKeNxaUxpDuWX9I9PBRmTg 7usMLb5ibtMCzRX1/81ZCLaXYDEwAoYL+ld2Ay3EFsq+X7fDpG+xqtR9QU++ypKj NO9A4LEfAEq67s5zc05IbWY7AniR3uzKgdTWdQBOi1R1PlVQ/2vmZXOPNanFBmTB AOyZ+1hUUeKNLpeonOWqQyrLD+L9zbNOXf3yZcdHAicwLWhPysshMWaeeh2GPQiP CvLoaCJpuTBp8nbLsc/KaqZsJ1l4maqgO/GF7sPTvXpqxVOoqFmCXQTfo580REyh MspEwkURmFYh+YuI8qsFi2mHY9oc4pdIyUhc0uUjy2dkvojvFWURABawLGaONBA= = 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 3vey30jr8m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 09 Jan 2024 09:52:04 +0100 (CET) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id DC1C710002A; Tue, 9 Jan 2024 09:51:59 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id C852E22FA2D; Tue, 9 Jan 2024 09:51:59 +0100 (CET) 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; Tue, 9 Jan 2024 09:51:59 +0100 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 , , Maxime Coquelin , Alexandre Torgue , , , , CC: Hugues Fruchet , Marco Felsch , Adam Ford Subject: [PATCH v6 0/5] Add support for video hardware codec of STMicroelectronics STM32 SoC series Date: Tue, 9 Jan 2024 09:51:50 +0100 Message-ID: <20240109085155.252358-1-hugues.fruchet@foss.st.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-05_08,2024-01-05_01,2023-05-22_02 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787602306220493255 X-GMAIL-MSGID: 1787602306220493255 This patchset introduces support for VDEC video hardware decoder and VENC video hardware encoder of STMicroelectronics STM32MP25 SoC series. This initial support implements H264 decoding, VP8 decoding and JPEG encoding. This has been tested on STM32MP257F-EV1 evaluation board. =========== = history = =========== version 6: - Use a single file for VDEC and VENC variants as suggested by Alex Bee - Fix some typos raised by Sebastian Fricke - Add Krzysztof Kozlowski Reviewed-by version 5: - Precise that video decoding as been successfully tested up to full HD - Add Nicolas Dufresne Reviewed-by version 4: - Fix comments from Nicolas about dropping encoder raw steps version 3: - Fix remarks from Krzysztof Kozlowski: - drop "items", we keep simple enum in such case - drop second example - it is the same as the first - Drop unused node labels as suggested by Conor Dooley - Revisit min/max resolutions as suggested by Nicolas Dufresne version 2: - Fix remarks from Krzysztof Kozlowski on v1: - single video-codec binding for both VDEC/VENC - get rid of "-names" - use of generic node name "video-codec" version 1: - Initial submission Hugues Fruchet (5): dt-bindings: media: Document STM32MP25 VDEC & VENC video codecs media: hantro: add support for STM32MP25 VDEC media: hantro: add support for STM32MP25 VENC arm64: dts: st: add video decoder support to stm32mp255 arm64: dts: st: add video encoder support to stm32mp255 .../media/st,stm32mp25-video-codec.yaml | 50 +++++ arch/arm64/boot/dts/st/stm32mp251.dtsi | 12 ++ arch/arm64/boot/dts/st/stm32mp255.dtsi | 17 ++ drivers/media/platform/verisilicon/Kconfig | 14 +- drivers/media/platform/verisilicon/Makefile | 3 + .../media/platform/verisilicon/hantro_drv.c | 4 + .../media/platform/verisilicon/hantro_hw.h | 2 + .../platform/verisilicon/stm32mp25_vpu_hw.c | 186 ++++++++++++++++++ 8 files changed, 285 insertions(+), 3 deletions(-) create mode 100644 Documentation/devicetree/bindings/media/st,stm32mp25-video-codec.yaml create mode 100644 drivers/media/platform/verisilicon/stm32mp25_vpu_hw.c