From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.72.24 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796382723; b=ZhPxJyJp8RDVP7G49j2IqFgYeHKst9nrnZHwrsc8KaY8qOaTf64slNe+QMWUTIMebfOo Nk+Dg2hN4onGM3RMgpniNWYk+CXR9BB7+cwO1DXdDhhik1HBEbCQCP8zQOxJJZ6EbXi4+ dPKxdKIbwOj+SiRP8m5ibkFUr++x9S6D9ErNbRtJIBl7yQumbHDWeEwSNo2jWlfBebj8T 2lq8SV/NktU7VL5N3p1eBweZuNV1RZCcpBFFOWOmE7icmhTIC5zdm2AhGxEEcXKuN1JXx Jl1rWJihWjcogCfwS/evUNna4IQpnb0np6Ml3niv2h4pu4Iwv/ZPZ3P+ojMXIq8ggug== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382723; h=DMARC-Filter:DKIM-Signature:Received:Received: X-MS-Exchange-Authentication-Results:Received-SPF:Received:Received: Received:From:Date:Subject:MIME-Version:Content-Type: Content-Transfer-Encoding:Message-ID:References:In-Reply-To:To:CC: X-Mailer:X-Originating-IP:X-ClientProxiedBy:X-EOPAttributedMessage: X-MS-PublicTrafficType:X-MS-TrafficTypeDiagnostic: X-MS-Office365-Filtering-Correlation-Id:X-MS-Exchange-SenderADCheck: X-MS-Exchange-AntiSpam-Relay:X-Microsoft-Antispam: X-Microsoft-Antispam-Message-Info:X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-OriginatorOrg: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-Id: X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=GGkGpjhIrZHv5Nt/XENG6+w2JPUtMMnllgDWxg8gFbI=; b=b+XtknuK1Fx5MsJqNRuLK2Di+QyL89D+TC7YBm0n1rP5HCB2ycGu+mXkMjx6oVj3mhBo L7Qu+pIzxdxfjy+tphGuRB63R1faGZzM/a6yIj2BG/uMbJxq1G0zl+5nMPdDx/w6sXLRm UVsfnT1/WoS82+OPPxu/MXdxHjiid8L+O60yx64Re8r2MiWs3YZfzYoT3wrKwtLluhMiP UdLh3U5QJSTqFNJwzvEIjpojpko13tWN9b6qJmEslPL/R/H2z4FnYctyXrzw3kRIS1uuq /lxqDOECCIPZupgqh6YTBcWdVZkSOvm5eiG1onyh/elEc0e/IGTOlM0fK0DV1BGnaLg== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=foss.st.com; spf=pass smtp.mailfrom=foss.st.com; dkim=pass header.d=foss.st.com header.i=@foss.st.com header.a=rsa-sha256 header.s=selector2 header.b=WdsAfxtc; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.72.24 Received: from AM0PR02CU008.outbound.protection.outlook.com (mail-westeuropeazon11013024.outbound.protection.outlook.com [52.101.72.24]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9CE6B606A687; Fri, 4 Dec 2026 11:12:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9CE6B606A687 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=foss.st.com header.i=@foss.st.com header.a=rsa-sha256 header.s=selector2 header.b=WdsAfxtc ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=npCQ3BrpFBY9R7T2enJq4RBMM984Qut50qJibYSrPIt9NWVI2z/i6Esz8WxXNzBUj3QQN7ruOF1nmMqz/x1e17fcgwdkamlJb682EhbF16jsCTvvycUr4r1IaD2RRggv897pdrRH3E6po7DM49oBGTq4rgoaeb9Wg9/78tDBceiRxVzhUvkB2LnDdiUe8zkmtE1qApnW5fRK7g26QdQGPR2T3fm/QBpiCKrDy6cHvXAi/PKD4/xspvh8GiLEp5KKA20hE+wwz4pFgIdUTI9nmsvDl9IrC9zj/PamlB3UCLhhKvrGXtRRzW5Z91ddVVeu6Jr/FxbBnoBZ6bx57ilxyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GGkGpjhIrZHv5Nt/XENG6+w2JPUtMMnllgDWxg8gFbI=; b=ZpXW9Eorp6d6/yB9LpWWNs/Kls+ijCQ0RxC74VdjUtAkFECG3aBZd60tMzT94ofzrFJpY31qBI3A7gHM/S0sFzES6VR9qw44ZsNJcVZjZ7C2enY2/F3VwpwKoEHBSSCdHbJrcpR9MroqUUsEH2Xd/wBPOCOq/bV2MGKUhyzWXiPJdaczcuWVkIkXvhBFKxdSWn5u6IPXLQwTGM6ZLXThc2mWRHgSlFE8MEPrbgqdkZ+4ZWrgXXWw18hTnneiv31LagPU39r/VHqmPA2COGHrSamrMes43AYnz5G+hfaAIINSBXnFrCuifP9r7jt+S/TTJIiZrN29GABhcNfZu4QVTg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 164.130.1.60) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=foss.st.com; dmarc=fail (p=none sp=none pct=100) action=none header.from=foss.st.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GGkGpjhIrZHv5Nt/XENG6+w2JPUtMMnllgDWxg8gFbI=; b=WdsAfxtcxOw2mCEpYTMdurxRhOSEiJbjJjfDxs1YRJHCPTEl4WHC3YcM0VB4nQ1qTkcvqnevS/GFFR9Wu7Qs2P+USlsmoL+DHw+2AtmrS7j0LUHxkdH2pn3nyoJu7/zMPG/F+H58PydEdROmxpRr3+p1CUWS/jW+B/Tp36YSBmjCeUdCXOG0FVXq9IqXrydGtS9PK3zENpZl364Jhm84wlhU5p4TxAAZFecm6HDHntB//dt1G3HC1rxbTu4t2lQIY5DfaRw4lXKXFujQGnKNR9eT0cFGhPP8DO2GoJ5vx4se9YuV4b8jT5Z/UgigtVevbJHhylbxsM/Blb/UGQRxCw== Received: from VIXP296CA0027.AUTP296.PROD.OUTLOOK.COM (2603:10a6:800:36e::7) by DB9PR10MB5884.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:398::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.709.5; Fri, 4 Dec 2026 11:11:58 +0000 Received: from MI3PEPF00008485.eurprd02.prod.outlook.com (2603:10a6:800:36e:cafe::16) by VIXP296CA0027.outlook.office365.com (2603:10a6:800:36e::7) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.688.13 via Frontend Transport; Fri, 4 Dec 2026 11:11:57 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; spf=fail (sender IP is 164.130.1.60) smtp.mailfrom=foss.st.com; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=foss.st.com; Received-SPF: Fail (protection.outlook.com: domain of foss.st.com does not designate 164.130.1.60 as permitted sender) receiver=protection.outlook.com; client-ip=164.130.1.60; helo=smtpO365.st.com; Received: from smtpO365.st.com (164.130.1.60) by MI3PEPF00008485.mail.protection.outlook.com (10.167.240.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.709.6 via Frontend Transport; Fri, 4 Dec 2026 11:11:57 +0000 Received: from STKDAG1NODE2.st.com (10.75.128.133) by smtpO365.st.com (10.250.44.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.56; Fri, 4 Dec 2026 12:13:18 +0100 Received: from localhost (10.130.77.105) by STKDAG1NODE2.st.com (10.75.128.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.56; Fri, 4 Dec 2026 12:11:57 +0100 From: Alain Volmat Date: Fri, 4 Dec 2026 12:11:41 +0100 Subject: [PATCH 10/11] media: stm32: dcmipp: isp: add 2 pads to be connected to isp-params & stats X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-ID: <20261204-stm32mp-dcmipp-isp-stat-ctrls-v1-10-e809f8c193e6@foss.st.com> References: <20261204-stm32mp-dcmipp-isp-stat-ctrls-v1-0-e809f8c193e6@foss.st.com> In-Reply-To: <20261204-stm32mp-dcmipp-isp-stat-ctrls-v1-0-e809f8c193e6@foss.st.com> To: Hugues Fruchet , Mauro Carvalho Chehab , Maxime Coquelin , "Alexandre Torgue" CC: , , , , "Alain Volmat" X-Mailer: b4 0.15.2 X-ClientProxiedBy: STKCAS1NODE1.st.com (10.75.128.134) To STKDAG1NODE2.st.com (10.75.128.133) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MI3PEPF00008485:EE_|DB9PR10MB5884:EE_ X-MS-Office365-Filtering-Correlation-Id: 956e5501-e24e-4362-30f3-08df51f76967 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|376014|36860700016|23010399003|1800799024|11063799006|261009223327099003|261009221227099003|261009223027099003|261009220027099003|3023799007|261009221727099003|22082099003|18002099003|56012099006|10067099003|261102123227099003|261021121427099003|261028144727099003|261021123027099003|261022105027099003|261026140227099003; X-Microsoft-Antispam-Message-Info: PGz6NccKCVPcH74JGv5B5eIIa33hOI5f6gUMIKbQQD+mk/PVv06r9dHslXSF9G6AieO78+AibUFRBNiKbhWtS18sJHB8fRmm7h9RKgV3p9wg54iyyz8segqoHEEkVNaOPXOjinTr8805mSYcfjH534hpMegL7sR4z2HPSQPDLtzMeOdVZRKjf2lA/gKe0aHLE9KJ2KbrrMrVHh0DZxrmNHBSIisCLOgyUhkM1Jvhv4JoXfrtxcH/xmCP/vubOPRux54ThmuMUGIV6TVpXxbXikMF+UtpJhTb2VuTOj+gCwH+k4ZzRm0bTLa5OsGVaKDHU6PrbKDXfwXDqr/GJdPPF2Mv1SxSu+NTV0xeVLjHpbtGw+pWawUN1sQlg9EU8ytSsZbzz/15KZhCMi9IEF49KFw53CrY8k+XuGHGhxspm0PWqAX+pikPYZ+x8C5bGITT3xCdFb4P4YfDLleRFSBJAv4b3UGdeiq8X6kkIzAa9+3UrEHST6qHQ9sJf/chbDYgwCbfOfRK+CWNRvDdAZh0oPK57hAss7gBVqvzEdVlyQXpYbDKqyQodvTdzuuNPMTbZVIECNSH7OBv5Vm01ni20fsNEJRo8FzYlFIzEebILIW7qaxAl3CMe39bFus+hJ1xVtKSBZGm4FmII80f5EARbsRs6d+8zNqnrskRwKDyBPQ2ung4fREVzA8Wa/eUXjZgNtJnvTayyXRg2DR76HJWJw== X-Forefront-Antispam-Report: CIP:164.130.1.60;CTRY:IT;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:smtpO365.st.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(376014)(36860700016)(23010399003)(1800799024)(11063799006)(261009223327099003)(261009221227099003)(261009223027099003)(261009220027099003)(3023799007)(261009221727099003)(22082099003)(18002099003)(56012099006)(10067099003)(261102123227099003)(261021121427099003)(261028144727099003)(261021123027099003)(261022105027099003)(261026140227099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: tP821zWc6VOQPehYdKpwZ6WZ7BWS8qsiFD6iX4P0ssYW8A9li+BB0I5gav1JL1VTKswvuWffZRlS+ZCHK1iGPVZH50SpEUrp7VzxPut8papAG7H1wepZECxcjNzh48Bv6MiBu6Dpzq3KFYGWQwk4fJ7i9ivvLD3T40c+WsscqaDGQs+GUOi2Sg+3Bnp27dRVIviJjnczNoVu72r+aNzCUfIu6NK2+BMR8q8YVCWPmJFLMfJMtjnWpMv6nM9hgV5UqfNpOglrSq6AS+KPV96b9VnPa5s+NTljMhvyVrR0SczX0RNeLfVY1vU+b0D1I5FYo6e/vhKlcbg5B051A9bsawbNCLlPlOP/+AQLrirp2yWEnSaaxdPqlYkp0IQpsp8pS849YCWOAaBAo5wb1mLww6gwqbgdOQyrl87hiSTj3X6mGzJt1W8ATDxx+wEfFd/T X-OriginatorOrg: foss.st.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2026 11:11:57.6328 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 956e5501-e24e-4362-30f3-08df51f76967 X-MS-Exchange-CrossTenant-Id: 75e027c9-20d5-47d5-b82f-77d7cd041e8f X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=75e027c9-20d5-47d5-b82f-77d7cd041e8f;Ip=[164.130.1.60];Helo=[smtpO365.st.com] X-MS-Exchange-CrossTenant-AuthSource: MI3PEPF00008485.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR10MB5884 Addition of pad 3 and pad 4 into the dcmipp-isp subdevice in order to connect the isp parameter output device and isp stats capture device. Signed-off-by: Alain Volmat --- .../platform/st/stm32/stm32-dcmipp/dcmipp-isp.c | 52 ++++++++++++++++++++-- 1 file changed, 48 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-isp.c b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-isp.c index 2d941f1e867c..381a80f7c383 100644 --- a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-isp.c +++ b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-isp.c @@ -39,6 +39,7 @@ #define DCMIPP_CMSR2_P1VSYNCF BIT(18) #define DCMIPP_CMSR2_P2VSYNCF BIT(26) +#define IS_META_PAD(pad) ((pad) >= DCMIPP_ISP_PAD_SINK_PARAMS) #define ISP_MEDIA_BUS_SINK_FMT_DEFAULT MEDIA_BUS_FMT_RGB565_1X16 #define ISP_MEDIA_BUS_SRC_FMT_DEFAULT MEDIA_BUS_FMT_RGB888_1X24 @@ -48,6 +49,8 @@ enum dcmipp_isp_pad { DCMIPP_ISP_PAD_SINK_VIDEO, DCMIPP_ISP_PAD_SOURCE_VIDEO_MAIN, DCMIPP_ISP_PAD_SOURCE_VIDEO_AUX, + DCMIPP_ISP_PAD_SINK_PARAMS, + DCMIPP_ISP_PAD_SOURCE_STATS, DCMIPP_ISP_PAD_MAX }; @@ -97,9 +100,11 @@ static void dcmipp_isp_adjust_fmt(struct v4l2_mbus_framefmt *fmt, u32 pad) static int dcmipp_isp_init_state(struct v4l2_subdev *sd, struct v4l2_subdev_state *state) { - for (unsigned int i = 0; i < sd->entity.num_pads; i++) { - struct v4l2_mbus_framefmt *mf; + struct v4l2_mbus_framefmt *mf; + unsigned int i; + /* Initialize the sink & source pads of data */ + for (i = 0; i < DCMIPP_ISP_PAD_SINK_PARAMS; i++) { mf = v4l2_subdev_state_get_format(state, i); *mf = fmt_default; mf->code = IS_SRC(i) ? ISP_MEDIA_BUS_SRC_FMT_DEFAULT : @@ -118,6 +123,15 @@ static int dcmipp_isp_init_state(struct v4l2_subdev *sd, } } + /* Initialize isp params & isp stats pads */ + mf = v4l2_subdev_state_get_format(state, DCMIPP_ISP_PAD_SINK_PARAMS); + mf->width = 0; + mf->height = 0; + mf->field = V4L2_FIELD_NONE; + mf->code = MEDIA_BUS_FMT_METADATA_FIXED; + + *v4l2_subdev_state_get_format(state, DCMIPP_ISP_PAD_SOURCE_STATS) = *mf; + return 0; } @@ -125,6 +139,14 @@ static int dcmipp_isp_enum_mbus_code(struct v4l2_subdev *sd, struct v4l2_subdev_state *state, struct v4l2_subdev_mbus_code_enum *code) { + if (IS_META_PAD(code->pad)) { + if (code->index) + return -EINVAL; + + code->code = MEDIA_BUS_FMT_METADATA_FIXED; + return 0; + } + return dcmipp_pixelpipe_enum_mbus_code(DCMIPP_ISP, code); } @@ -132,6 +154,9 @@ static int dcmipp_isp_enum_frame_size(struct v4l2_subdev *sd, struct v4l2_subdev_state *state, struct v4l2_subdev_frame_size_enum *fse) { + if (IS_META_PAD(fse->pad)) + return -EINVAL; + return dcmipp_pixelpipe_enum_frame_size(DCMIPP_ISP, fse); } @@ -144,6 +169,12 @@ static int dcmipp_isp_set_fmt(struct v4l2_subdev *sd, v4l2_subdev_is_streaming(sd)) return -EBUSY; + /* Metadata pads have a fixed format */ + if (IS_META_PAD(fmt->pad)) { + fmt->format = *v4l2_subdev_state_get_format(state, fmt->pad); + return 0; + } + dcmipp_isp_adjust_fmt(&fmt->format, fmt->pad); if (IS_SINK(fmt->pad)) { @@ -260,7 +291,8 @@ static int dcmipp_isp_set_selection(struct v4l2_subdev *sd, } /* Update the source pad size */ - for (pad = 1; pad < sd->entity.num_pads; pad++) { + for (pad = DCMIPP_ISP_PAD_SOURCE_VIDEO_MAIN; + pad <= DCMIPP_ISP_PAD_SOURCE_VIDEO_AUX; pad++) { src_fmt = v4l2_subdev_state_get_format(state, pad); src_fmt->width = s->r.width; src_fmt->height = s->r.height; @@ -431,12 +463,23 @@ static int dcmipp_isp_disable_streams(struct v4l2_subdev *sd, return 0; } +static int dcmipp_isp_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, + struct v4l2_subdev_state *state, + struct v4l2_subdev_selection *s) +{ + if (IS_META_PAD(s->pad)) + return -EINVAL; + + return dcmipp_pixelpipe_get_selection(sd, ci, state, s); +} + static const struct v4l2_subdev_pad_ops dcmipp_isp_pad_ops = { .enum_mbus_code = dcmipp_isp_enum_mbus_code, .enum_frame_size = dcmipp_isp_enum_frame_size, .get_fmt = v4l2_subdev_get_fmt, .set_fmt = dcmipp_isp_set_fmt, - .get_selection = dcmipp_pixelpipe_get_selection, + .get_selection = dcmipp_isp_get_selection, .set_selection = dcmipp_isp_set_selection, .enable_streams = dcmipp_isp_enable_streams, .disable_streams = dcmipp_isp_disable_streams, @@ -493,6 +536,7 @@ struct dcmipp_ent_device *dcmipp_isp_ent_init(const char *entity_name, const unsigned long pads_flag[] = { MEDIA_PAD_FL_SINK, MEDIA_PAD_FL_SOURCE, MEDIA_PAD_FL_SOURCE, + MEDIA_PAD_FL_SINK, MEDIA_PAD_FL_SOURCE, }; int ret; -- 2.34.1