From patchwork Wed Jan 10 10:46:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugues Fruchet X-Patchwork-Id: 18904 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2411:b0:101:2151:f287 with SMTP id m17csp708131dyi; Wed, 10 Jan 2024 02:47:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IEKGrJz/bnvncVl0ybvYUoYNvLttC9rpWvhAUGTHRUnuneEYEi/K3q+XDS4go8TOgnCX89/ X-Received: by 2002:a17:906:fa13:b0:a29:a2d6:4e6d with SMTP id lo19-20020a170906fa1300b00a29a2d64e6dmr416896ejb.79.1704883669135; Wed, 10 Jan 2024 02:47:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704883669; cv=none; d=google.com; s=arc-20160816; b=HZpNrRqjfoU0J9tlvHSyj/jnOAl5nxpjY5aD19csgDV/hKP1nrj30blQM0Czd7yW3A sH2t/K8XOdv+rSwnWHzlDUj98J0W/zZYgZOMYHZrTCETsHz5tClriEUovi4XskelBQ7Q 2skF50RFzBjdBMObMPn7rXaZGCTn5KxSm5yBSrdwm05fEaHxo3vjoFmH8ZD3fHPsv1JK DsM3Fsy6MvRS0SOyO5emPIHAvc8Q0YeUTst24Ltmoq7jXqkEgQj1cLzTrOkf9kZnxi6o Noqr4EOfx9O0BhuxETJMSEV5neZ4zEFrcf8aLYVNmxCpxtAgPNjMf/ptTEI58P92YRv+ zHow== 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=kGiOxvOpWczIlSq7Cssihsblr91Ysp+Vipm6Fn7JKx8=; fh=ErwLDw9+98Mb4Q3i5RoHr7UOS7Ns3CK5YbB+qheGbUs=; b=zzMwGrf8vpQN3UMNn0XY8wXyBj7BHpYUPolXRq/Z3ZxYeF2WchTpOtxoD720Tt25tQ fWw3RLh6rGl7XJAMKtfi7fKHEcb2fRpg8vsS3SGswzuOH48EuoweOh/YSDR6YLi/iM2D +7T/3HWeABgAFiV/U88br5pp8dKi43fpqeDDQ2Qbr0qAfow6uRYSQRHfqcHrKVct0DaS u0O6wObAP61Q5ggweXWB3yqBjkYxvr8aNB15NyvS4p30FvmR934c8t28mP0VOQbLBxYN Y825VItUzLUFwpcS/+ihVritYjP4CrOlDFIOFXwY27IAWYTOJUSoW+CNOYZ1lr/P3B8A swlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=4HG38UcG; spf=pass (google.com: domain of linux-kernel+bounces-22008-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22008-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id l10-20020a1709062a8a00b00a2808b990bfsi1669242eje.887.2024.01.10.02.47.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 02:47:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-22008-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=4HG38UcG; spf=pass (google.com: domain of linux-kernel+bounces-22008-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22008-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 91D5F1F2581B for ; Wed, 10 Jan 2024 10:47:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E42DD41779; Wed, 10 Jan 2024 10:47:28 +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="4HG38UcG" 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 7498447762; Wed, 10 Jan 2024 10:47:23 +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 (m0369458.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40A97aJA025702; Wed, 10 Jan 2024 11:47:02 +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=kGiOxvO pWczIlSq7Cssihsblr91Ysp+Vipm6Fn7JKx8=; b=4HG38UcGmjmrYSZJ4ekVSGU qGUnaA0LAip8b2emO++6Yy06ScoiIlvaNZhJNcnCy0HtgmFu2OEBA4Mcdx0RYc3m Se+Q21j7PGUEpST2cTC6g0NHQLiwuvJ0s6zGFnMo/3MTaLd+wyipgHJBlO0OThGO DQBWeJoxDdXeJFeGPE6/36lMZJrbPvzMt3WA8PFUboT9g6DgVdod3ezw/uEbgIvg Rj9AaJhqKvTkL7oFp7gxDSezYGn0mM7hj1SNHddTniILc2ATvOhBnauimEvp/Jq5 NqfPG+S0P4o42hiFcgmDVonPAFHX0dX1WSbZP2vOFah3BvuGKErDL5crEJ4HHfQ= = 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 3vfha4p29n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jan 2024 11:47:02 +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 C570A100049; Wed, 10 Jan 2024 11:47:00 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id B255226C046; Wed, 10 Jan 2024 11:47:00 +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; Wed, 10 Jan 2024 11:47:00 +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 , , Rob Herring , Krzysztof Kozlowski , Conor Dooley , , , , CC: Hugues Fruchet , Marco Felsch , Adam Ford Subject: [RESEND PATCH v6 0/5] Add support for video hardware codec of STMicroelectronics STM32 SoC series Date: Wed, 10 Jan 2024 11:46:37 +0100 Message-ID: <20240110104642.532011-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: 1787700098194074447 X-GMAIL-MSGID: 1787700098194074447 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 | 49 +++++ 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, 284 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