From nobody Fri Sep 25 14:32:37 2026 Received: from MA0PR01CU009.outbound.protection.outlook.com (mail-southindiaazon11020140.outbound.protection.outlook.com [52.101.227.140]) (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 5C61F4B0489; Tue, 15 Sep 2026 12:15:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.227.140 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789474553; cv=fail; b=qqeshmHQrTOLndlaNmgJlscGnWXbeoX39WRDorsb6T1xlcwcymuXr1vculHly0UU0sAYql0eblxY5r29sIcY/z2VnV/fTI4eoI9xu9rJkC1ShJp9E3vH49OGscvj3vMM/vNopjclrXGXstnmWb4mYxX7mYBfreldlkVtRJtlkVk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789474553; c=relaxed/simple; bh=Q0fgMV3v/wwQ9jHi7chIPHtwhLT9VYQFHm3hF825WHo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=sAXyrNiBtBixiYUUnsvAIGmiOpw+/cVc8Rk8xeYQAsyMLpSods2ZndtDbDaHLEApqWL7zYBLy9Va2WA8Jq5XSDUVz8r+F/Zivvcj12s1ejMfoGuaTJiC/M/R4GlKtdjDNDqHVr3morquhEjAjH2WzFwCg2Yn1Tgv05d/T0RgNfI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ebytelogic.com; spf=pass smtp.mailfrom=ebytelogic.com; arc=fail smtp.client-ip=52.101.227.140 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ebytelogic.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ebytelogic.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=sCWicXOtc250Fab53L5gHAV7wonCtk5wW8HmEY+ZYV++1ZuAgj4Wj+LaVJz9qN3bN9Y3p7uekBkjkqKQXozA4mAunEKRbjOaqsEB6RZFPsop/hGSgfg3FGVXFOrb5Oye1GmLt5AxTjSplsWVnrdoTlU5Tlybg5FppyhLgUDTzfQVE1scfU6GplWYj2YUw4WW6QmkysD8U9FBlBGhKAQ+lv6VQey7mhtGiUJlkgh7BkzlDGG/F0tPW60vDUkzfEbUU7gwlf5xWuOhl8YbHFfnhQYkcIGBqhmg+lV7PqdWiUYlKE6AWn9YJeyZw7zvruLCelQSCkL3zQzZJZ6ojxfJxQ== 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=nqleGqbuZo9PEhL/Sbn9c667T8NsEgvfXwrfJq7ssWw=; b=w5D/LIdGunOpekh2vvegMoHP6FplPKJV6FEnt9C0tGnU3ppM0WQf6xj+HvZTW4Nf7NtWpnHGWhHHYp+1I+cS0a2zvtKzh/wWjQLVLX9kyMcDNC7bgZNURox4qGGOBR+sjRlultvVmauFRsc0z1X2pFtHONc4Kx0hT4o95ihTlGN3RY6ejJwXWqBYIj/5ng3SbNtURmLbLoVyRHKtTtHyb7K7LSsG0UZatLMhM5QS6qegZbzyCijUrvMLXpFQT3Xk4trYFXWrmVUXvasDR0THqF6JO3MowEEag4tWph0VosydJN7NQRqdtajgv2L+aaqE2P5dDMcJQZSGOGgWQFOCnA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ebytelogic.com; dmarc=pass action=none header.from=ebytelogic.com; dkim=pass header.d=ebytelogic.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=ebytelogic.com; Received: from PN3PPF28092842E.INDP287.PROD.OUTLOOK.COM (2603:1096:c04:1::97) by MAUP287MB4525.INDP287.PROD.OUTLOOK.COM (2603:1096:a01:18c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.406.13; Tue, 15 Sep 2026 12:15:46 +0000 Received: from PN3PPF28092842E.INDP287.PROD.OUTLOOK.COM ([fe80::df75:6e8c:7def:a08e]) by PN3PPF28092842E.INDP287.PROD.OUTLOOK.COM ([fe80::df75:6e8c:7def:a08e%6]) with mapi id 15.21.0406.012; Tue, 15 Sep 2026 12:15:46 +0000 From: Hitesh Patel To: Gjorgji Rosikopulos Cc: Bryan O'Donoghue , Vladimir Zapolskiy , Loic Poulain , Mauro Carvalho Chehab , Dmitry Baryshkov , Atanas Filipov , Jigarkumar Zala , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, ravi@ebytelogic.com, Hitesh Patel Subject: [PATCH 1/2] media: qcom: camss: Do not link CSID source pads the CSID does not have Date: Tue, 15 Sep 2026 17:45:35 +0530 Message-ID: <20260915121536.19207-1-hitesh@ebytelogic.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260911062213.195007-1-gjorgji.rosikopulos@oss.qualcomm.com> References: <20260911062213.195007-1-gjorgji.rosikopulos@oss.qualcomm.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: PN3PR01CA0048.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:98::23) To PN3PPF28092842E.INDP287.PROD.OUTLOOK.COM (2603:1096:c04:1::97) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PN3PPF28092842E:EE_|MAUP287MB4525:EE_ X-MS-Office365-Filtering-Correlation-Id: 4a503dbf-caae-47c2-963d-08df1323128c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|23010399003|366016|10070799003|376014|52116014|1800799024|56012099006|10067099003|18002099003|22082099003; X-Microsoft-Antispam-Message-Info: SxjsLcXITvwAHs3GYJi/ANkFiuixKYA8yXwfW2+tTjbuPdVsWDTVFtZAoP+7bsqpdpBFjABrvc1C+++6L1W8jxL8+8xr6yQcNVCvOUpRQD7PYbeXj4HUAJJ6XomSNq7nya5pj7AufPvXfzmc7WbguHaMxMCQyI9wgIQAk4L0Bd51OMhXZYFg0O+jYT36oTLNvg4Tgwf26FPIM4au61jJaiqq7AzJnVeOEDh+wXlhm4ImzquPOMfvApSDOi6z3Yu/Y//M/pCIJw4G9Rbzk+nS7KJRTTK6JoNMOpHfMaR/hSbACnhPS2mWLnBuoj5aaUqqJjyDID5lFXnD5OBPaWzmxP37QC2DVALrD9tMOD7ptT28iLUpv+pzQTlwaU5S9IuvTeYf9IoewxisAD7wEv0Y/Oez4pJpvp9Hen+/JJEZB8K4gLJcryYBUZOtLZxD143I7hSyQbhnMOvXfka/DtN5UR7G9tdac/7PxqvrdDNXGwFuNui8y1lVhETGPX3nLTlZVcjLmESJUhkVfqMzQ3O/2CLQI8N3EM1+W7TRL0LB8QskyH0pI0zt3UAFay/Laoj7vO8Fh5eqYzNtaSdCw4TCrgxvxWAS58B7y/XuV47pJ7lPTeC0Fsuux2sWaPIFThYwk1aEYb7zP1DBySuDEmuBIi6oXLDy9rjQ2qGVL4CuT6Y= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PN3PPF28092842E.INDP287.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(7416014)(23010399003)(366016)(10070799003)(376014)(52116014)(1800799024)(56012099006)(10067099003)(18002099003)(22082099003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?AHXsgUVNM8E1SZnqa0XGAhfT0ZIAo7rjRZdnMGN80dX2J/meXrleHt4mKcYx?= =?us-ascii?Q?GzvJZd7uyRTPeBOrMmJM8EokEsAqvZsoIQHBfXmxuKnWBKwZiNO2+3K2Vz5q?= =?us-ascii?Q?lzWzuZMszqZ7vhCmGITPu3YKdkWL9Nt2LntK1YzGhzq2G0v2pL+DpTKqeJcj?= =?us-ascii?Q?d85/nycdmOJuUCpU8RSycGQZqx0A2Kgd5VDLbt7Ju/bpEmn3qwGqq8wXaNLX?= =?us-ascii?Q?50ezIs4SXefxa5nZvhTbzE5uCncdVpLu7QbQuAkVNzRlLHkQ07NC8hkwzN+9?= =?us-ascii?Q?kaZeS68laUTk1n4DIN1S0X8jl0232k+nF3fWVpPia8uBZQYy6a22/1TWhkuM?= =?us-ascii?Q?msPNOU26RgGNkgs6pWglVYaqmZp0ZDhkW1Z3gOUxLthhEIi9d9l0ETMI3+5d?= =?us-ascii?Q?2jQbN4PtRWiqIpl64nJCGU2xMbtmGGcDd+lsu8yT3QYNScFRMOQxrPN+AHnr?= =?us-ascii?Q?tBggbVLU4KdMnYr9jnNRkX7P92sj2O79xKpJQYDVkNHOn4nHTpR9vItR9iWY?= =?us-ascii?Q?tZSpl6IPFDMWyhVLQP+VOwG2MAD7KeWCAnMoa3g+GXJUivWSxbMcPb+z0bnX?= =?us-ascii?Q?/w5Ptkcx1JYjr6fwO/mzvm6ahZ7rjasDnzp6FR3lPI/oN/cSoe6fWg8IdYcB?= =?us-ascii?Q?Diz1nCsoptwyqQw6IEhFYOf9Ewy0qSLG2OCev+piUDyfpRrQ8s5/AkNXnDYY?= =?us-ascii?Q?V+G3m6YZp1umv2jKWqHyBCXE2LUXDol0kDYJLpiC3sYpIg1GWvFZJJPP08k2?= =?us-ascii?Q?+AyMoVrJnppcIDocGl2s9IhZ4woHwbO+Lo1EoKDA2owBj6frQpZZYPlWgU92?= =?us-ascii?Q?WIyem8inMUjAu0cCk3b/br5b53PIKzT1K/N2h/QwZPPNj5d+O+RupvGSLG2J?= =?us-ascii?Q?Nm5aipEf5AmjHhHIrZAU+vZLBSsPmTMnMfdt6+5K4dlZ6sbCy2617vDn28MQ?= =?us-ascii?Q?N7mNVvGkyElajrv//o/tSPtouoxnjD+E64vH34NzhPZdm2VNpvroKONqxWtc?= =?us-ascii?Q?klQ/6s8ADoJPMXBxeOXGaICGJzbURJCti1DMO4ARWRRmxKI2xxF0TeNxYcl5?= =?us-ascii?Q?AsaHJWqAFSw0lN05NkKoLNAm94ha106QeEY7UQpIKl7loKKLWMdLoMfQOzc+?= =?us-ascii?Q?jTXnzCP/byUW1N0zaJGrM6ShZpo2gdgRWcjgaJjvcEw1BZxZB0jlvb3hyxgh?= =?us-ascii?Q?QbCq8WQd2Z8PBuqWa9PNc/LLFQNniZ37UAfhDdH0vkIW8+EfTWdgGx+5ZTDq?= =?us-ascii?Q?hETDyU7vLNlLuovYPu67sBKSb4WF611ylrdbozQ/G/kS/c4r67NygtfFSuda?= =?us-ascii?Q?cACRJhRIKn2GWSsWVEnjtCHA9Sa6fkmpigZvEeyueqlb58IUg4hAM+bO+MkZ?= =?us-ascii?Q?azMnVdFB6xF5/84yMYQVnggo3y9C6198SOXvttXlB4ZnlFzuzcRJ0wfYBlac?= =?us-ascii?Q?JlVhe+A6ZJ0ETubxCapb+RZvWHVbq4NI1q0+x5WLMSUb591olrrjBkVOaxZG?= =?us-ascii?Q?zlBrbt0r0W9qTSl5HBb8Q6WgHc7amPJQzbDWaoDyYHLWzExA25xYXQ3LnlDL?= =?us-ascii?Q?TSCVh6E2Khhgdkizm3ybUPB39qmWfJpX3Jh8LKWYKt4aZmp+3dSQV3Y1LN9g?= =?us-ascii?Q?3woOUF6N+mKHuv4n1CsRrAKpwMtk1ZISwHOjAywT3qIB/aiD+sHd5R13/qss?= =?us-ascii?Q?DxSjjXhNyFfr7KSFj0ijx7fkm6yGwGGN5Bx6LSTHOTLkumZFnUXCHR83hjLr?= =?us-ascii?Q?rPfX54nHViPZPenAiVIZpvqPDzd9yfY9tsDqpNpNBxhgdpl3cnaz7JRLQ+7r?= X-MS-Exchange-AntiSpam-MessageData-1: zihgFQSQDfxD2Q== X-OriginatorOrg: ebytelogic.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4a503dbf-caae-47c2-963d-08df1323128c X-MS-Exchange-CrossTenant-AuthSource: PN3PPF28092842E.INDP287.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2026 12:15:46.7679 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 13bdb17c-4ae8-490c-90c1-ec8121ef96ee X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: PjotZeTgd0Hok1JydCSHCKFS+PRazeDfwdbOxFi1MH55kMKi0/u12JUp1zg0TnXJzvGUell2L++4u2oSVrnzYQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MAUP287MB4525 Content-Type: text/plain; charset="utf-8" With the streams API a non-lite CSID registers MSM_CSID_PADS_NUM - 1 pads, one source pad per RDI0..2, while a lite CSID keeps all MSM_CSID_PADS_NUM pads. camss_link_entities() still links source pad MSM_CSID_PAD_FIRST_SRC + j of every CSID to line j of every VFE. On SC7280 the non-lite csid0 is linked to vfe_lite0, which has four lines, so the loop asks for csid0 source pad 4: WARNING: drivers/media/mc/mc-entity.c:1150 media_create_pad_link qcom-camss acb3000.isp: Failed to link msm_csid0->msm_vfe3_rdi3 entities:= -22 qcom-camss acb3000.isp: probe with driver qcom-camss failed with error -22 SM8250 does not hit this because csid_vfe_fixed_pairing only links csid[i] to vfe[i]. Every other platform that links all CSIDs to all VFEs fails to probe as soon as streams_enable is set on a non-lite CSID. Skip the VFE lines for which the CSID has no source pad. Signed-off-by: Hitesh Patel Tested-by: Hitesh Patel --- drivers/media/platform/qcom/camss/camss.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/plat= form/qcom/camss/camss.c index 9bfb02903..0201debd4 100644 --- a/drivers/media/platform/qcom/camss/camss.c +++ b/drivers/media/platform/qcom/camss/camss.c @@ -5022,6 +5022,9 @@ static int camss_link_entities(struct camss *camss) struct v4l2_subdev *csid =3D &camss->csid[i].subdev; struct v4l2_subdev *vfe =3D &camss->vfe[k].line[j].subdev; =20 + if (MSM_CSID_PAD_FIRST_SRC + j >=3D csid->entity.num_pads) + continue; + ret =3D media_create_pad_link(&csid->entity, MSM_CSID_PAD_FIRST_SRC + j, &vfe->entity, --=20 2.43.0 From nobody Fri Sep 25 14:32:37 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 57F043F1678 for ; Fri, 11 Sep 2026 06:22:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789107744; cv=none; b=jcVn5hWq8txbymoyJMZTeqoN+sljJmGx+Gq8OCA9/yj/Jt9G0bwLgf8ClGm5HEqIpEAaWnVRykJATbQurFXvob651kI7FNCrG9tdUVB1AB2zWW0klshvGtzuW47I1SeK4tDyWKQMJ21BJEijs8fMAFddlK4sCLTw6w92QxOI14s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789107744; c=relaxed/simple; bh=S3lR9rQgmm0/QsXj3FBN+DiGLxuDTgYGdn5BOLkmuLk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=kIAB4Ira8lq1EQyExMI7FiibbByQi341c9URgCoLX6zaSGiZlCQQMCXdJiBf1Pdrlav6W8icZwQ4JkZOBxqmfP5Vz8c8FlrEkN5RcuQZK+b3ZQjqo1ji3pVP7KAM1Bz5s98fdXkp+s1HUxM5CQiM/coLcvqQ00A0YSuKs59AnVY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=fail (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=JKD1j0al reason="signature verification failed"; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="JKD1j0al" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68B4vUHC3464089 for ; Fri, 11 Sep 2026 06:22:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=ocWGOz0+jm3 gelKC1Kmsak+XBwyOJFIdVh6cOArcDS0=; b=JKD1j0aln1ZDhpzYN9FSeTJB1Dj ke8CgZXeUi7sYxSBoKVL6RKErFA4trpVW3fFewr7TwfOFzShPfBZ9jse5/24LUvQ DTJ7euyVVoYPeqsHiUY+xp0jToeWgyPxg6KZycmDqJVXWzFaq5QnuUrmEkHLyhC3 LA0CgGOQc2rm+ERmgz405DjA4zTsUg/jvL8/iNfPKW8QY4+SlOpC7G+ADVvsN4bz b+HBAs2C3Oo+3UqalNtAlE5Pn8aEBkFR4J6xyga9c25xosyFmdghea4ypXWDSDKZ IG7iXLkEvR330NIyvqe2vtS/FmF9xarU66vRgSy8TcOA9O5NcgVGLqw2KAw== Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gm5q41dud-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 11 Sep 2026 06:22:20 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-939d6c515deso90495085a.3 for ; Thu, 10 Sep 2026 23:22:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789107740; x=1789712540; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=ocWGOz0+jm3gelKC1Kmsak+XBwyOJFIdVh6cOArcDS0=; b=D3reW7uUlkq9TqtUXtJMcQ2W65hF8aet19Kzh5qRWdMERlyynbhIo59OOVfmAA0a2e f39xRnOyXJ/MBWY0iKRt8rZI5lk4MLbyzZgEvNSQFVLeaySYPIvACmVDuOttqpXCEA1G eA4qSjOzQKh/rBtrv5foQKcNilcTeA+O8eTKe+bmjEw80aDjQFHvNSDspGl6beQ5r+AX nOUy2sAi5bqXGHNaAy96uPgyuZINtHt72WLBLumR6WxN2EteelcdMD+hhKArGBA8svws HEdTCyBaR0rBCOTbb2q7toAFf2EchHahqN/XkhgWZT45eo8+FSEM2zWsktghGfPYLNEZ 16ag== X-Forwarded-Encrypted: i=1; AKwUvBzQi+KQ5PNl8g7i4FAX6HZe9ximsc1Zo6haB05wakBVMDginTCUfTZZ/QH9ndVJB9zGAn4QjDKMqecglJU=@vger.kernel.org X-Gm-Message-State: AFuF++kNZPk+vWBfelGlHyWl2uNs4GexgNlWOZFpZuqJ/PxpmrEGxXAL onuHaR9rFpryY3EbWOFsc5LOZZ3w4xsAHIqNaG6hpSZVMVyC1ZD6nZzW7f+ICYzE6EEU/6Q5H/j XA9OT9MS+8RvamfImIpKt5DTHtOOoVtDlQv2b2GJ0Hnq6LxQ1TIlS5SxZR9K+dYMief4= X-Gm-Gg: AYBFou2jyWqs6nNg8UFx2HNP3bM48vd0NtGGqy3HqgrirxInHxj2lXYsnABIRZGyKhm q/9eDLXaUpmryO18/vjQ68n0eBeS51dHz1/JHGVBnZeUycJqe9ptNOxEgrIDUv2jF7MQLg6eEvy YkvRGNgp8Tzdwn2Joa6obQrcpurVz0SmMlJ8SbcbUE5k9hSQrgQUw2z4FtY1oeMZlZyrQvQcXmQ aClVchh1AIhhQRJyKsDGBE4S6g9Ft9LdEWac8a7iF0MuRVPxoALcFWOclH3CYrQFCd4DBhyVDN7 FXLixN+SoUhCDlm/5MRrNTmqw+gGIcCMq+e022YJ/pWojfZ6m1HEulXAHFk= X-Received: by 2002:a05:620a:1a29:b0:939:197f:345e with SMTP id af79cd13be357-939ea0ad175mr346075785a.22.1789107740234; Thu, 10 Sep 2026 23:22:20 -0700 (PDT) X-Received: by 2002:a05:620a:1a29:b0:939:197f:345e with SMTP id af79cd13be357-939ea0ad175mr346070085a.22.1789107739331; Thu, 10 Sep 2026 23:22:19 -0700 (PDT) Received: from lin-0843.qualcomm.com ([212.136.9.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-486eb33ea60sm3681969f8f.17.2026.09.10.23.22.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2026 23:22:18 -0700 (PDT) From: Gjorgji.Rosikopulos.gjorgji.rosikopulos@oss.qualcomm.com To: Bryan O'Donoghue , Mauro Carvalho Chehab Cc: Vladimir Zapolskiy , Loic Poulain , Dmitry Baryshkov , Atanas Filipov , Jigarkumar Zala , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Gjorgji Rosikopulos Subject: [PATCH 1/8] media: qcom: camss: Add streams API support for CSIPHY Date: Fri, 11 Sep 2026 09:22:06 +0300 Message-Id: <20260911062213.195007-2-gjorgji.rosikopulos@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260911062213.195007-1-gjorgji.rosikopulos@oss.qualcomm.com> References: <20260911062213.195007-1-gjorgji.rosikopulos@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: btqXFTCPWf4DvNJJUDvPvZ-2uGqp7lH5 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTExMDA4NiBTYWx0ZWRfX/iRTvkrtYShs iWaPqLXjKlnFQ3bG/0v51JzuNwdTQGvoeLhCG+vCNA9qhQrLk3uRYpmIWSYjjEMPrQY9qsvWm32 N51jQgkNfAIW3WDU1e6t37fECdzfmpk= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTExMDA4NiBTYWx0ZWRfXzSpytMAC4/zK PR+DuD5WM05a7WhhEPw4cP+85zWdxkiQF0m3i/mfB3LnAlzhCH1zyX3Sz9sn6TOH9pZ/soQJ5NK bEHjCUl1tRcQWE69+iLWN+n78hTWxJ0mGw/yWvesYXAs6bBATikGgCXgM9KLjzjMVgAUKyGGSkS ErNZSYW50QlTATh+PapwRswp3aRrAnWqC38B4I1ho0uGbLtZLFLFGnIjEffxXs30BOnIsXSp5YV S4GkHKwPQXXgZ1aAe5ZoPDyRvz6DCiWaOFgItLnp8xQd768Wrn4HYNcW8goZS3seGaBmgrqJDDf tI2PAoPBCwDwA01gjcqFKGQnznZbocJdpezqbS4lm7TZXkADykf2BH8k+sGNDBU9+H6R/hP7s7G W5AWxkJOKvAeCg/gS5FRtmwdnbTJKV2BE/5Gk1h4Ts1lB6cMO/Ba7eEn3gSZG34aAhEQzAyIZOu DxLnaI66QkLYsbnH91A== X-Proofpoint-ORIG-GUID: btqXFTCPWf4DvNJJUDvPvZ-2uGqp7lH5 X-Authority-Analysis: v=2.4 cv=Wsa+otfv c=1 sm=1 tr=0 ts=6aa39e1c cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=dNlqnMcrdpbb+gQrTujlOQ==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=OdbYh2hxJzrqstplNr4A:9 a=NFOGd7dJGGMPyQGDc5-O:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-11_02,2026-09-09_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 lowpriorityscore=0 priorityscore=1501 suspectscore=0 spamscore=0 bulkscore=0 impostorscore=0 clxscore=1015 adultscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609110086 Content-Type: text/plain; charset="utf-8" From: Gjorgji Rosikopulos Add the V4L2 subdev streams API to the CSIPHY driver: a passthrough routing table (one VC per stream) and NO_STREAM_MIX routing validation. enable/disable_streams pad ops track active streams per pad via a per-pad enabled_streams[] bitmask, so that multiple source-pad consumers can share a single propagated sink stream without redundant or colliding propagation to the sensor. The shared D-PHY lanes are enabled once, on the transition from no active streams to at least one, and disabled once all streams have gone idle. This is opt-in per CSIPHY instance via the new streams_enable resource flag; no platform sets it yet, so CSIPHYs continue to use the legacy non-streams subdev ops unchanged. Signed-off-by: Gjorgji Rosikopulos Tested-by: Hitesh Patel --- .../media/platform/qcom/camss/camss-csiphy.c | 223 +++++++++++++++++- .../media/platform/qcom/camss/camss-csiphy.h | 2 + 2 files changed, 222 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss-csiphy.c b/drivers/med= ia/platform/qcom/camss/camss-csiphy.c index 539ac4888b60..7e9748e92ab8 100644 --- a/drivers/media/platform/qcom/camss/camss-csiphy.c +++ b/drivers/media/platform/qcom/camss/camss-csiphy.c @@ -332,6 +332,112 @@ static int csiphy_set_stream(struct v4l2_subdev *sd, = int enable) return ret; } =20 +/* + * csiphy_pad_enable_streams - Enable one or more streams on the source pad + * @sd: CSIPHY V4L2 subdevice + * @state: V4L2 subdevice state + * @pad: Pad number + * @streams_mask: Bitmask of streams to enable + * + * The shared D-PHY lanes are enabled once, on the transition from no acti= ve + * sink streams to at least one. The sink stream(s) are propagated upstrea= m to + * the sensor only for the subset that isn't already active, so a stream + * that's already running is never redundantly re-propagated. + * + * CSIPHY is only ever linked to a single entity on its source pad, and th= at + * entity is responsible for only enabling a stream on this pad while it + * itself still needs it, so no cross-consumer refcounting is needed here. + * + * Return 0 on success or a negative error code otherwise + */ +static int csiphy_pad_enable_streams(struct v4l2_subdev *sd, + struct v4l2_subdev_state *state, + u32 pad, u64 streams_mask) +{ + struct csiphy_device *csiphy =3D v4l2_get_subdevdata(sd); + struct media_pad *remote_pad =3D + media_pad_remote_pad_first(&csiphy->pads[MSM_CSIPHY_PAD_SINK]); + bool first_arrival =3D !csiphy->enabled_streams[MSM_CSIPHY_PAD_SINK]; + u64 sink_streams, propagate_mask; + int ret; + + sink_streams =3D v4l2_subdev_state_xlate_streams(state, pad, MSM_CSIPHY_P= AD_SINK, + &streams_mask); + + propagate_mask =3D sink_streams & ~csiphy->enabled_streams[MSM_CSIPHY_PAD= _SINK]; + + if (first_arrival) { + ret =3D csiphy_set_stream(sd, 1); + if (ret) + return ret; + } + + csiphy->enabled_streams[MSM_CSIPHY_PAD_SINK] |=3D sink_streams; + csiphy->enabled_streams[pad] |=3D streams_mask; + + if (propagate_mask && remote_pad) { + ret =3D v4l2_subdev_enable_streams(media_entity_to_v4l2_subdev(remote_pa= d->entity), + remote_pad->index, propagate_mask); + if (ret) { + csiphy->enabled_streams[MSM_CSIPHY_PAD_SINK] &=3D ~propagate_mask; + csiphy->enabled_streams[pad] &=3D ~streams_mask; + + if (first_arrival) + csiphy_set_stream(sd, 0); + + return ret; + } + } + + return 0; +} + +/* + * csiphy_pad_disable_streams - Disable one or more streams on the source = pad + * @sd: CSIPHY V4L2 subdevice + * @state: V4L2 subdevice state + * @pad: Pad number + * @streams_mask: Bitmask of streams to disable + * + * The shared D-PHY lanes, and the propagation to the sensor, are only torn + * down once no sink stream is referenced by any source pad any more. + * + * CSIPHY is only ever linked to a single entity on its source pad, and th= at + * entity is responsible for only disabling a stream on this pad once it no + * longer needs it, so no cross-consumer refcounting is needed here. + * + * Return 0 on success or a negative error code otherwise + */ +static int csiphy_pad_disable_streams(struct v4l2_subdev *sd, + struct v4l2_subdev_state *state, + u32 pad, u64 streams_mask) +{ + struct csiphy_device *csiphy =3D v4l2_get_subdevdata(sd); + struct media_pad *remote_pad =3D + media_pad_remote_pad_first(&csiphy->pads[MSM_CSIPHY_PAD_SINK]); + u64 sink_streams; + int ret =3D 0; + + sink_streams =3D v4l2_subdev_state_xlate_streams(state, pad, MSM_CSIPHY_P= AD_SINK, + &streams_mask); + + csiphy->enabled_streams[pad] &=3D ~streams_mask; + csiphy->enabled_streams[MSM_CSIPHY_PAD_SINK] &=3D ~sink_streams; + + if (sink_streams && remote_pad) + ret =3D v4l2_subdev_disable_streams(media_entity_to_v4l2_subdev(remote_p= ad->entity), + remote_pad->index, sink_streams); + + if (!csiphy->enabled_streams[MSM_CSIPHY_PAD_SINK]) { + int stream_ret =3D csiphy_set_stream(sd, 0); + + if (!ret) + ret =3D stream_ret; + } + + return ret; +} + /* * __csiphy_get_format - Get pointer to format structure * @csiphy: CSIPHY device @@ -743,6 +849,71 @@ static int csiphy_link_setup(struct media_entity *enti= ty, return 0; } =20 +static int csiphy_init_state(struct v4l2_subdev *sd, + struct v4l2_subdev_state *state) +{ + struct v4l2_subdev_route routes[] =3D { + { + .sink_pad =3D MSM_CSIPHY_PAD_SINK, + .sink_stream =3D 0, + .source_pad =3D MSM_CSIPHY_PAD_SRC, + .source_stream =3D 0, + .flags =3D V4L2_SUBDEV_ROUTE_FL_ACTIVE, + }, + }; + struct v4l2_subdev_krouting routing =3D { + .num_routes =3D ARRAY_SIZE(routes), + .routes =3D routes, + }; + + /* + * CSIPHY is a transparent D-PHY with no per-VC demux, so every sink + * stream (VC) a multi-stream sensor may drive must pass straight + * through as the same source stream, or downstream link validation + * (e.g. against CSID's multi-pad sink) will flag it as dangling. A + * multi-VC sensor is supported by userspace adding further routes via + * .set_routing; this default covers the common single-VC case. + */ + return v4l2_subdev_set_routing(sd, state, &routing); +} + +/* + * csiphy_set_routing - Set routing for the CSIPHY subdev + * @sd: CSIPHY V4L2 subdevice + * @state: V4L2 subdevice state + * @which: Type of format state (V4L2_SUBDEV_FORMAT_ACTIVE or TRY) + * @routing: Routing table to set + * + * CSIPHY is a transparent D-PHY with no per-VC demux, so every route must + * pass a sink stream straight through as the same source stream. + * + * Return 0 on success or a negative error code otherwise + */ +static int csiphy_set_routing(struct v4l2_subdev *sd, + struct v4l2_subdev_state *state, + enum v4l2_subdev_format_whence which, + struct v4l2_subdev_krouting *routing) +{ + struct csiphy_device *csiphy =3D v4l2_get_subdevdata(sd); + unsigned int i; + int ret; + + if (which =3D=3D V4L2_SUBDEV_FORMAT_ACTIVE && csiphy->enabled_streams[MSM= _CSIPHY_PAD_SINK]) + return -EBUSY; + + for (i =3D 0; i < routing->num_routes; i++) + if (routing->routes[i].sink_stream !=3D routing->routes[i].source_stream) + return -EINVAL; + + ret =3D v4l2_subdev_routing_validate(sd, routing, + V4L2_SUBDEV_ROUTING_NO_STREAM_MIX | + V4L2_SUBDEV_ROUTING_NO_N_TO_1); + if (ret) + return ret; + + return v4l2_subdev_set_routing(sd, state, routing); +} + static const struct v4l2_subdev_core_ops csiphy_core_ops =3D { .s_power =3D csiphy_set_power, }; @@ -764,10 +935,35 @@ static const struct v4l2_subdev_ops csiphy_v4l2_ops = =3D { .pad =3D &csiphy_pad_ops, }; =20 +static const struct v4l2_subdev_pad_ops csiphy_streams_pad_ops =3D { + .enum_mbus_code =3D csiphy_enum_mbus_code, + .enum_frame_size =3D csiphy_enum_frame_size, + .get_fmt =3D csiphy_get_format, + .set_fmt =3D csiphy_set_format, + .get_frame_desc =3D v4l2_subdev_get_frame_desc_passthrough, + .set_routing =3D csiphy_set_routing, + .enable_streams =3D csiphy_pad_enable_streams, + .disable_streams =3D csiphy_pad_disable_streams, +}; + +static const struct v4l2_subdev_video_ops csiphy_streams_video_ops =3D { + .s_stream =3D v4l2_subdev_s_stream_helper, +}; + +static const struct v4l2_subdev_ops csiphy_streams_v4l2_ops =3D { + .core =3D &csiphy_core_ops, + .pad =3D &csiphy_streams_pad_ops, + .video =3D &csiphy_streams_video_ops, +}; + static const struct v4l2_subdev_internal_ops csiphy_v4l2_internal_ops =3D { .open =3D csiphy_init_formats, }; =20 +static const struct v4l2_subdev_internal_ops csiphy_streams_internal_ops = =3D { + .init_state =3D csiphy_init_state, +}; + static const struct media_entity_operations csiphy_media_ops =3D { .link_setup =3D csiphy_link_setup, .link_validate =3D v4l2_subdev_link_validate, @@ -786,11 +982,16 @@ int msm_csiphy_register_entity(struct csiphy_device *= csiphy, struct v4l2_subdev *sd =3D &csiphy->subdev; struct media_pad *pads =3D csiphy->pads; struct device *dev =3D csiphy->camss->dev; + bool streams_api =3D csiphy->res->streams_enable; int ret; =20 - v4l2_subdev_init(sd, &csiphy_v4l2_ops); - sd->internal_ops =3D &csiphy_v4l2_internal_ops; + v4l2_subdev_init(sd, streams_api ? &csiphy_streams_v4l2_ops + : &csiphy_v4l2_ops); + sd->internal_ops =3D streams_api ? &csiphy_streams_internal_ops + : &csiphy_v4l2_internal_ops; sd->flags |=3D V4L2_SUBDEV_FL_HAS_DEVNODE; + if (streams_api) + sd->flags |=3D V4L2_SUBDEV_FL_STREAMS; snprintf(sd->name, ARRAY_SIZE(sd->name), "%s%d", MSM_CSIPHY_NAME, csiphy->id); sd->grp_id =3D CSIPHY_GRP_ID; @@ -813,12 +1014,27 @@ int msm_csiphy_register_entity(struct csiphy_device = *csiphy, return ret; } =20 + if (streams_api) { + ret =3D v4l2_subdev_init_finalize(sd); + if (ret) { + dev_err(dev, "Failed to finalize subdev: %d\n", ret); + goto err_media_entity_cleanup; + } + } + ret =3D v4l2_device_register_subdev(v4l2_dev, sd); if (ret < 0) { dev_err(dev, "Failed to register subdev: %d\n", ret); - media_entity_cleanup(&sd->entity); + goto err_v4l2_subdev_cleanup; } =20 + return 0; + +err_v4l2_subdev_cleanup: + v4l2_subdev_cleanup(sd); +err_media_entity_cleanup: + media_entity_cleanup(&sd->entity); + return ret; } =20 @@ -829,5 +1045,6 @@ int msm_csiphy_register_entity(struct csiphy_device *c= siphy, void msm_csiphy_unregister_entity(struct csiphy_device *csiphy) { v4l2_device_unregister_subdev(&csiphy->subdev); + v4l2_subdev_cleanup(&csiphy->subdev); media_entity_cleanup(&csiphy->subdev.entity); } diff --git a/drivers/media/platform/qcom/camss/camss-csiphy.h b/drivers/med= ia/platform/qcom/camss/camss-csiphy.h index 9d9657b82f74..e55c098dbe67 100644 --- a/drivers/media/platform/qcom/camss/camss-csiphy.h +++ b/drivers/media/platform/qcom/camss/camss-csiphy.h @@ -84,6 +84,7 @@ struct csiphy_hw_ops { =20 struct csiphy_subdev_resources { u8 id; + bool streams_enable; const struct csiphy_hw_ops *hw_ops; const struct csiphy_formats *formats; }; @@ -114,6 +115,7 @@ struct csiphy_device { struct v4l2_mbus_framefmt fmt[MSM_CSIPHY_PADS_NUM]; const struct csiphy_subdev_resources *res; struct csiphy_device_regs *regs; + u64 enabled_streams[MSM_CSIPHY_PADS_NUM]; }; =20 struct camss_subdev_resources; --=20 2.34.1 From nobody Fri Sep 25 14:32:37 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 41BE4233134 for ; Fri, 11 Sep 2026 06:22:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789107746; cv=none; b=ZdlNsyrrp97F/ahanPcYciq04AxLH32wI94aVcRoUA5hDW5VtGoIhFngNoNbPxs/cZHZGEiGdNcaDsZEuvJd5a3Us5PeMK6lm/SP17oyflhpGqE59YQVIXawPV+SMfP+L/0z7J8gv7JkjqkejnOmWcM/f+MqkTUaX1I+RJ4zEVo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789107746; c=relaxed/simple; bh=UoS5f2EBhTJcgyOtezRR0LMksrdBR09WIq1yMgN96kw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=TJr7z68rcfd4fhrTcaEmG7KecNSK15pDOuL21e1ousJBGut1zB8//Jdspey8T3ei31egskPJRHYrUB1CBXy7FAP9joVIZ1LtAbTsO039ppMuHxLBWr3M3B2Sjr6Q7B497rsA0EX4HjxfByH24Zi1LBZQqRJ9MVg6vkufcVy1yL8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=fail (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=Q/O2d/Y2 reason="signature verification failed"; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="Q/O2d/Y2" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68B4vSqH3665102 for ; Fri, 11 Sep 2026 06:22:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=amy1Wyx/W47 khn1kptgW1d87ONaJebqc8PBAbdLfWj8=; b=Q/O2d/Y2D3PsDLJdK1S6/oAb8Ub wmKvkAUrsG5iyoxQQ4mxNYq2SwEaRT2KEBwZp3/4QTsGgUeOD2yH10uIHwqXXpKU DYYhqi7I++I9S1oH0Q1phayXekBPtctUGyeq6Oy90/X8s5H52oQyKLU60twSOpNp wtS2CGS4nLauq1Rv4VyTdQymR2AtsS3MITpP0fY69Qzbjv8vZvUqEUS35cG3SUwN xjwyeuvo+MLo7D58sbBk61PygCRPXMQoyRB4Q76z6hDD/s6x6YQFoYNNVcS9mHbc l+yskj2x8WhiEdCaPCWwLsJ+cfX1ehbb54DNwfuiPqf2RH3SOrMB05mYPYw== Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gm2q1221p-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 11 Sep 2026 06:22:22 +0000 (GMT) Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-939d6c515deso90497585a.3 for ; Thu, 10 Sep 2026 23:22:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789107742; x=1789712542; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=amy1Wyx/W47khn1kptgW1d87ONaJebqc8PBAbdLfWj8=; b=n2heeMjv8D5aOJ4VdeAeYus/i5lKONdf+XaKxiWFvnmF3vDswVGVRAWUqWjXpTxKhw 4VYEGrNXQ5QrkbHBuB9l4aQODGjt8KcW4YJ7RkEpiT+BugL0ZRqVj1x2On96f7ojilDR kHlk7uRcP7gEYrmVzkFZxwm7OSqGkeZzeIyWGl8uB87MRXcIJSpiBM1OnlQxGLoQejbR Qn7yv+LJ+mNnBEwl6b9BMvMHPBEtblqid1lOas8HqMUslC2IcQDwJLhW4H6/OUcRV48J NPEArKLW9pvMOhB7hm25MWE/MfJK+DWhDSI3H9Kb320zruOBqDh8CQCsIKzWdMMT+25P NDYg== X-Forwarded-Encrypted: i=1; AKwUvBx80ofJoTD8A97MgNouga/gyJc3VG+HxPH4uQmr9dRVj9P2d+KngHpKZvSH0MjuHYZ5zYp4onGbu/h/s54=@vger.kernel.org X-Gm-Message-State: AFuF++mmqlyMjcgspOTp5uzlQzmynXxvecqDWQVSIP/K8bvQzL9XwycH HHGLP4o/sx/FxHNYYn7a2bQ1oHQoMYczJSgvfYE2uupIkIfMRHT+uqlPKW51FweMBFEgz1YpjEY u1SU1lbY2Dx60i/JKhi1EwLiMoXDZWq0gZQhfoxQCuBY22IiwPtuiccNyS98ylCN9N+s= X-Gm-Gg: AYBFou0pnTl617S2tcBUtaOdp2BPsLTj6ERiSizSaaVDc3/cFxH2cxOH6dV4/417HZG AMM6YitMvkJDAZtlmgNrVvT+wiPyToyTxeQt5jldxbdJ6kIsvRceUlt5CSCMWUXsnj80ure42yO ELA9G00sBiME289MsxPDyko1/B0yT88L8afUJXiXKr061Lk7pfUEL1Epn9+eNXkS7LGptxCI4Hv DPPU/LSdcG7U0O9LBTtHofN7jGQafTwywbfHFl3+meLdlu/dmGZGjPCYD4Hk9/YVFqGxB6S5S/i +IMp+NWYE/0srQKpuhL6RMAdLSDX9seZ4TZeT9rus2LQl0bzZ8BO+zDKAYk= X-Received: by 2002:a05:620a:4513:b0:939:c555:efb6 with SMTP id af79cd13be357-939ea085dbdmr334589385a.12.1789107742299; Thu, 10 Sep 2026 23:22:22 -0700 (PDT) X-Received: by 2002:a05:620a:4513:b0:939:c555:efb6 with SMTP id af79cd13be357-939ea085dbdmr334585885a.12.1789107741784; Thu, 10 Sep 2026 23:22:21 -0700 (PDT) Received: from lin-0843.qualcomm.com ([212.136.9.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-486eb33ea60sm3681969f8f.17.2026.09.10.23.22.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2026 23:22:20 -0700 (PDT) From: Gjorgji.Rosikopulos.gjorgji.rosikopulos@oss.qualcomm.com To: Bryan O'Donoghue , Mauro Carvalho Chehab Cc: Vladimir Zapolskiy , Loic Poulain , Dmitry Baryshkov , Atanas Filipov , Jigarkumar Zala , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Gjorgji Rosikopulos Subject: [PATCH 2/8] media: qcom: camss: Add streams API hw_ops to CSID interface Date: Fri, 11 Sep 2026 09:22:07 +0300 Message-Id: <20260911062213.195007-3-gjorgji.rosikopulos@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260911062213.195007-1-gjorgji.rosikopulos@oss.qualcomm.com> References: <20260911062213.195007-1-gjorgji.rosikopulos@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Authority-Analysis: v=2.4 cv=d6lgWhjE c=1 sm=1 tr=0 ts=6aa39e1e cx=c_pps a=hnmNkyzTK/kJ09Xio7VxxA==:117 a=dNlqnMcrdpbb+gQrTujlOQ==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=EUspDBNiAAAA:8 a=nPBgRWIF8C1TIduujCsA:9 a=PEH46H7Ffwr30OY-TuGO:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTExMDA4NiBTYWx0ZWRfXyc34op1zz3sE aa7NJCtEWjVbVJsl7diJOfcb+gMZoEFo/SNi+0q7graefc73MTYm8WuAItqzAyb5AiK9QxwQFDk E10NtBCMiEsSEwIOQyMJ4/bu8hO7b1ms9zsjGgoQT5FruGKYlt+4c62Fqbpi9UHdQj6AMUAhurz T25a4ax9nowP1WTPCPKRk4x3JVAVcn+Gm2QfEJ+r4xSizZV860AP2IwjaxpertGnIC00In8vVIx QqwKgASkycacFAp6TDd734506B+t8fwRi2eyHvWOGzLZo6MnbY5aNMwNQ1Mpxd4pWJDWKNybsXc 64OEDWIMnfNVp3X+L/jHwu4ZKA3CPQ1Y4EXUmpg/YLZYTkLbdFakgHUUdUIXVklNZYMmOvpH1YV 4GTCLIuertb5L2A/py70XHMaNxhWgZNJlA47sWjNeou+14hC3noQFkJWvdlUwbR2xo7qih+GWAk JZqaSYWOP/dpNzRAcmQ== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTExMDA4NiBTYWx0ZWRfX2toylJ4fVFY6 fpnuZA2wxgOi6ORYlxR6NGQ+cnTy4fJg48PS/yba36sxBBLi4zyIHnIUb8fGFGK6j0rIVdbzbYQ Z+xeSU8gmnDoo7qn11+UlUCDJpg+OM0= X-Proofpoint-GUID: 9z1QoEyn5NCwocXJWSwsCYhvgFIn8XwN X-Proofpoint-ORIG-GUID: 9z1QoEyn5NCwocXJWSwsCYhvgFIn8XwN X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-11_02,2026-09-09_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 suspectscore=0 spamscore=0 priorityscore=1501 bulkscore=0 adultscore=0 lowpriorityscore=0 phishscore=0 clxscore=1015 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609110086 Content-Type: text/plain; charset="utf-8" From: Gjorgji Rosikopulos Add configure_rx/enable_stream/disable_stream to struct csid_hw_ops: per-stream hardware operations needed to support the V4L2 subdev streams API, where the CSID Rx front-end is configured once independently of the per-stream RDI programming. No functional change: these are new optional hw_ops entries, not yet implemented by any backend or called by any code path. Signed-off-by: Gjorgji Rosikopulos Tested-by: Hitesh Patel --- .../media/platform/qcom/camss/camss-csid.h | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/drivers/media/platform/qcom/camss/camss-csid.h b/drivers/media= /platform/qcom/camss/camss-csid.h index 5296b10f6bac..90ee611b9092 100644 --- a/drivers/media/platform/qcom/camss/camss-csid.h +++ b/drivers/media/platform/qcom/camss/camss-csid.h @@ -74,6 +74,25 @@ struct csid_phy_config { =20 struct csid_device; =20 +/* + * struct csid_hw_ops - CSID hardware version specific operations + * + * configure_stream() is the legacy (non-streams-API) path and is mutually + * exclusive with enable_stream()/disable_stream() - a given CSID instance + * uses one family or the other, chosen by streams_enable. + * + * stream_id, as passed to enable_stream()/disable_stream(), is a hardware + * RDI/PIX port index in [0, MSM_CSID_MAX_SRC_STREAMS). It is currently + * always equal to pad - MSM_CSID_PAD_FIRST_SRC (multi-pad, 1:1 + * pad-to-port mapping). + * + * configure_rx() is called once, on the transition from zero to non-zero + * active sink streams, strictly before the first enable_stream() call. + * enable_stream()/disable_stream() calls are always made under the + * subdev's active-state lock (core-enforced via + * v4l2_subdev_enable_streams()/disable_streams()), so hw_ops + * implementations don't need their own serialization. + */ struct csid_hw_ops { /* * configure_stream - Configures and starts CSID input stream @@ -81,6 +100,30 @@ struct csid_hw_ops { */ void (*configure_stream)(struct csid_device *csid, u8 enable); =20 + /* + * configure_rx - Configure the CSID Rx front-end + * @csid: CSID device + * + * Called once, when the first stream is enabled. + */ + void (*configure_rx)(struct csid_device *csid); + + /* + * enable_stream - Enable a single CSID output stream + * @csid: CSID device + * @stream_id: stream id to enable + * @vc: virtual channel to program + * @dt: data type to program + */ + void (*enable_stream)(struct csid_device *csid, u32 stream_id, u8 vc, u8 = dt); + + /* + * disable_stream - Disable a single CSID output stream + * @csid: CSID device + * @stream_id: stream id to disable + */ + void (*disable_stream)(struct csid_device *csid, u32 stream_id); + /* * configure_testgen_pattern - Validates and configures output pattern mo= de * of test pattern generator --=20 2.34.1 From nobody Fri Sep 25 14:32:37 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 256F33F23B1 for ; Fri, 11 Sep 2026 06:22:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789107748; cv=none; b=iD7AuQ5lc0+78NBkCrLRVaom3b3+6Xz5JK6lgCVdbeb5JD6e0zDHf73We7vtXnB/qhUzv0CxNVkeG6W3IqZfOU1XCs6NhZySTYFejOMgi3vDyqhO9/oSZw0KuyDGm6gOthky10Myl4hYCmnKYeYkyzvP1F7v/nrDbix1ay15TjA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789107748; c=relaxed/simple; bh=jQhOx3vEY0b8cO6ZOGrXD/l8aLbSQYyq3/tXIbU7Iqs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=TdVYNedHfWxP2z+VaeQXeYfWwWVFJEWhf3p84YvrHiuM8TJQ7XrDeM/KLbmsNjf/NAQYiNQmJlBPmzEF9BdQ2cpa14pJB0XhzBroR+mM5lvBqgDFODbkxiG7lb5uZ9lj1b8gR/x7O06whVI350Q4ItKUUMO8TUbea+d9UfIaTro= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=fail (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=Sxonks// reason="signature verification failed"; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="Sxonks//" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68B5LJ993137601 for ; Fri, 11 Sep 2026 06:22:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=FE8iTCn+Uly bWQ7qDFQypS2k5l4/hLWcIH1MjmtNl0s=; b=Sxonks//qAmQ+YeCSWe7KCI+bRA 6UjV4X+S+gOab32X/ad9Y5weZoxu16KmpHup14xrLhGSEDHgvVzc0LtIFyDZNFwv vZJ49zOqZfOksy/X7D1TzatMFazT2cf743giv6qgGbIg08OICgyR2k145L6G8ZeC GywIQov9UIu8yeF+yaSOl52OF6AlUKSzFa26RyEdcwVSxh8v8SDMK+kFXWtMY9G6 qwL66NwvgThp1a5/QTJrr2u0/ORvTWbrGLJM8IEbnQUO6TCAqNjq0fAvkKIrY0KL ABOGM3Svr++1ozyFDoVCPbA9QB7m06jhmfSXfhM+twbwsLxtvjoi9LRC46w== Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gmbdr87ef-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 11 Sep 2026 06:22:24 +0000 (GMT) Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-92e53b8a302so102494985a.1 for ; Thu, 10 Sep 2026 23:22:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789107744; x=1789712544; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=FE8iTCn+UlybWQ7qDFQypS2k5l4/hLWcIH1MjmtNl0s=; b=OLOft+bSccxM6a5ntFvkPv4lIL6x8fV/LH719xwM6y4Mso1phZ34NlzMbVLkNpsIVo 6l6yXmlOq/C86aQvSE9ZzUHzDvq2rsKgdq3j6VGMwTbysNj4QwIHmDGxF0pSw/8AA3za HKAABPtgKh5alZCZRx+2fVOyHJN4G1NCUgbD/fiueGdtP5EHj/+twXezQaPCCYlk6LTU BjvUXAP7lBpmoo2RYcEUvVN+TMg46D4YVyNqJwmieQ4qWAi56r6LvAGYN3fd8pMcktM9 kZtH39l7gs+scgT6USx4SrL8SuZWsCvfwovgaoH2AnkPtJbyQcs9R625Z6fGMYtmLapW nBFA== X-Forwarded-Encrypted: i=1; AKwUvBztTcOvQJHlqNy4emcRDju51AltBhaBRbs9LCWfijrm8rcSdZSrWydrH0CC12BhyvYxc+M6VscXf0dKprI=@vger.kernel.org X-Gm-Message-State: AFuF++nI75RZy4oxUof7bwnA8tuNBKC1r7yhnkFO4+mfSI07kmd0Ca2K 7zQ8sohQYgIVE8azWHNM5wIT4wjXAOsWRnDNC35S0jUK0cO8yG34A58uq4erVCBGt9/Jyv+icA5 M6u4Amk06Cp57MhhfIav7h9UkTe3mtwk3nngW3YBL9jRHM7XoE1A1ZphzW+nf6ziziX4= X-Gm-Gg: AYBFou3AjrwHLVyLV/2KDW8dte6Ou4OIiHwjazgTd3adSjt0Za+84m3hbGw56tNv8Ou bSFdmJ4qWJNRLwC5yp27FrhsTOT/009gA+hUVISHFWZVJQ9n6Aa6b7yXCQkWXjn/YT6pnFWfOEy YB2UZ+Cp32ndpUlSfE1gKovzDlXkOV4BGTI10rPbET+YFhP9xYnLNB+WIRVszIMdL8+CWrXHvGG 6jOoKkwTi2VS0pGPTaPOl1cnVT/e0NtYEBhetGiKYLJV5jA8akLHWAmt01p3un5bdPoFqzc/uTy cCORLiKzk7ucrQihSZA8+9VSHM+JvD9IkbFhHBWOAF+m+pXssgaySaFmX08= X-Received: by 2002:a05:620a:4103:b0:914:e3dd:17ea with SMTP id af79cd13be357-939ea051eb2mr339495285a.12.1789107744089; Thu, 10 Sep 2026 23:22:24 -0700 (PDT) X-Received: by 2002:a05:620a:4103:b0:914:e3dd:17ea with SMTP id af79cd13be357-939ea051eb2mr339492285a.12.1789107743598; Thu, 10 Sep 2026 23:22:23 -0700 (PDT) Received: from lin-0843.qualcomm.com ([212.136.9.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-486eb33ea60sm3681969f8f.17.2026.09.10.23.22.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2026 23:22:22 -0700 (PDT) From: Gjorgji.Rosikopulos.gjorgji.rosikopulos@oss.qualcomm.com To: Bryan O'Donoghue , Mauro Carvalho Chehab Cc: Vladimir Zapolskiy , Loic Poulain , Dmitry Baryshkov , Atanas Filipov , Jigarkumar Zala , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Gjorgji Rosikopulos Subject: [PATCH 3/8] media: qcom: camss: Implement CSID streams API hw_ops for gen2 Date: Fri, 11 Sep 2026 09:22:08 +0300 Message-Id: <20260911062213.195007-4-gjorgji.rosikopulos@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260911062213.195007-1-gjorgji.rosikopulos@oss.qualcomm.com> References: <20260911062213.195007-1-gjorgji.rosikopulos@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: s9mMyj43TP8khkL2gt-v8jHzwzjOx_1N X-Authority-Analysis: v=2.4 cv=PLmaavqC c=1 sm=1 tr=0 ts=6aa39e20 cx=c_pps a=hnmNkyzTK/kJ09Xio7VxxA==:117 a=dNlqnMcrdpbb+gQrTujlOQ==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=EUspDBNiAAAA:8 a=Uk0bjlubZieTOrE2B0cA:9 a=PEH46H7Ffwr30OY-TuGO:22 X-Proofpoint-ORIG-GUID: s9mMyj43TP8khkL2gt-v8jHzwzjOx_1N X-Proofpoint-Spam-Info: AW1haW4tMjYwOTExMDA4NiBTYWx0ZWRfXxyTKKaA4q2ct EiTwNfGk0rZHjS6R+6oOr4d+0puCSvFIKrt1plg00kpAkIDaJ28T1RI16o6aFPB/4MYlcblP1dG fddj0lRRnVoDbPDUrVG1WEryohitqXQ= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTExMDA4NiBTYWx0ZWRfXwmyZ/DZS3m5P OfQuZW5P7h6E4H3v9eQgvqZoJX8H0oKCaqSmm6EFKT6JSbxh9jtTmKkTTvrf1/NNRecGIdZZimz 0uZH87fBhIiIKAKlIIa02QNNJFupK00uMk303fNZqtffuOMR8szyGPc0uoHyjrv8UqoSjFRPJv7 Ub0cgm9rcYB+zeLwnjPVwR5H8Gh070gJ9JHrXyqjM0vLYQZigU0IDyRuAEaBG1kaaM++gyEt7BU GblgCzwnHfVWAzGlUNU9bw2hWwFMEuQI/mDfgpevH6RUF+c2PUtzSBd0DsI/XRrw6mErOaH5ik6 EWbpX/GCIx1aoxpHdFaQeWSxXGJDRFRAI/UpgWHSszrxS7e7nM9gEm/CKI3L3eVusnsnwoGGKv1 k6cmRzyILlFhVoh/uLydI+Qd1hO2Kw3jYju9bQas8WetLx5XOgEAAJgjFG+Sq7DJ3tjzYpmxgdu Rl1LTrsokzqsOQYFz8g== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-11_02,2026-09-09_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 suspectscore=0 spamscore=0 phishscore=0 adultscore=0 malwarescore=0 clxscore=1015 priorityscore=1501 impostorscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609110086 Content-Type: text/plain; charset="utf-8" From: Gjorgji Rosikopulos Implement the configure_rx/enable_stream/disable_stream hw_ops added to struct csid_hw_ops, for the gen2 CSID hardware backend used by SM8250. __csid_configure_rdi_stream() now takes an explicit data type parameter instead of deriving it from the CSID source pad's format, since the streams API keys each stream by stream_id rather than by pad. The existing configure_stream() path is updated to pass its per-port format lookup through to this parameter, preserving current behavior. Signed-off-by: Gjorgji Rosikopulos Tested-by: Hitesh Patel --- .../platform/qcom/camss/camss-csid-gen2.c | 59 ++++++++++++++++--- 1 file changed, 51 insertions(+), 8 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss-csid-gen2.c b/drivers/= media/platform/qcom/camss/camss-csid-gen2.c index eadcb2f7e3aa..2512cdb16d94 100644 --- a/drivers/media/platform/qcom/camss/camss-csid-gen2.c +++ b/drivers/media/platform/qcom/camss/camss-csid-gen2.c @@ -253,13 +253,8 @@ static void __csid_configure_testgen(struct csid_devic= e *csid, u8 enable, u8 por writel_relaxed(val, csid->base + CSID_TPG_CTRL); } =20 -static void __csid_configure_rdi_stream(struct csid_device *csid, u8 enabl= e, u8 port, u8 vc) +static void __csid_configure_rdi_stream(struct csid_device *csid, u8 enabl= e, u8 port, u8 vc, u8 dt) { - /* Source pads matching RDI channels on hardware. Pad 1 -> RDI0, Pad 2 ->= RDI1, etc. */ - struct v4l2_mbus_framefmt *input_format =3D &csid->fmt[MSM_CSID_PAD_FIRST= _SRC + port]; - const struct csid_format_info *format =3D csid_get_fmt_entry(csid->res->f= ormats->formats, - csid->res->formats->nformats, - input_format->code); u32 val; =20 /* @@ -281,7 +276,7 @@ static void __csid_configure_rdi_stream(struct csid_dev= ice *csid, u8 enable, u8 val |=3D 1 << RDI_CFG0_TIMESTAMP_EN; /* note: for non-RDI path, this should be format->decode_format */ val |=3D DECODE_FORMAT_PAYLOAD_ONLY << RDI_CFG0_DECODE_FORMAT; - val |=3D format->data_type << RDI_CFG0_DATA_TYPE; + val |=3D dt << RDI_CFG0_DATA_TYPE; val |=3D vc << RDI_CFG0_VIRTUAL_CHANNEL; val |=3D dt_id << RDI_CFG0_DT_ID; writel_relaxed(val, csid->base + CSID_RDI_CFG0(port)); @@ -330,15 +325,60 @@ static void csid_configure_stream(struct csid_device = *csid, u8 enable) /* Loop through all enabled ports and configure a stream for each */ for (i =3D 0; i < MSM_CSID_MAX_SRC_STREAMS; i++) if (csid->phy.en_vc & BIT(i)) { + /* Source pads match RDI channels: pad 1 -> RDI0, pad 2 -> RDI1, etc. */ + struct v4l2_mbus_framefmt *input_format =3D + &csid->fmt[MSM_CSID_PAD_FIRST_SRC + i]; + const struct csid_format_info *format =3D + csid_get_fmt_entry(csid->res->formats->formats, + csid->res->formats->nformats, + input_format->code); + u8 vc =3D 0; + if (tg->enabled) __csid_configure_testgen(csid, enable, i, 0); =20 - __csid_configure_rdi_stream(csid, enable, i, 0); + __csid_configure_rdi_stream(csid, enable, i, vc, format->data_type); __csid_configure_rx(csid, &csid->phy, 0); __csid_ctrl_rdi(csid, enable, i); } } =20 +/* + * configure_rx - Configure the CSID Rx front-end + */ +static void csid_configure_rx(struct csid_device *csid) +{ + __csid_configure_rx(csid, &csid->phy, 0); +} + +/* + * stream_id is used directly as the hardware RDI port index below. This + * assumes a 1:1 stream-to-port mapping and should be revisited once + * per-platform src_streams data (stream id -> hw pipe) is added. + */ +static void csid_enable_stream(struct csid_device *csid, u32 stream_id, u8= vc, u8 dt) +{ + struct csid_testgen_config *tg =3D &csid->testgen; + + if (tg->enabled) + __csid_configure_testgen(csid, 1, stream_id, vc); + + __csid_configure_rdi_stream(csid, 1, stream_id, vc, dt); + __csid_ctrl_rdi(csid, 1, stream_id); +} + +static void csid_disable_stream(struct csid_device *csid, u32 stream_id) +{ + struct csid_testgen_config *tg =3D &csid->testgen; + + __csid_ctrl_rdi(csid, 0, stream_id); + + if (tg->enabled) + __csid_configure_testgen(csid, 0, stream_id, 0); + + __csid_configure_rdi_stream(csid, 0, stream_id, 0, 0); +} + static int csid_configure_testgen_pattern(struct csid_device *csid, s32 va= l) { if (val > 0 && val <=3D csid->testgen.nmodes) @@ -425,6 +465,9 @@ static void csid_subdev_init(struct csid_device *csid) const struct csid_hw_ops csid_ops_gen2 =3D { .configure_stream =3D csid_configure_stream, .configure_testgen_pattern =3D csid_configure_testgen_pattern, + .configure_rx =3D csid_configure_rx, + .enable_stream =3D csid_enable_stream, + .disable_stream =3D csid_disable_stream, .hw_version =3D csid_hw_version, .isr =3D csid_isr, .reset =3D csid_reset, --=20 2.34.1 From nobody Fri Sep 25 14:32:37 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 57CC93F4DD6 for ; Fri, 11 Sep 2026 06:22:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789107752; cv=none; b=d2E/drMRjW1AwQCcaQ1a4UJFBZIf8PwEkkz6RkiETH2aGSdTwPppyB2WfhSGUaxeDyLzKiiQB7YqY0XuPdULpPj+7GI5XLb31iRt9E3U3R2KNIpkj0TNzxh250rPykP24SFb1Y2S/eqQCCjevuCZpANOqmyvFMWYJULM/M/TEbg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789107752; c=relaxed/simple; bh=SHXduOI9FxBC5qrnXe0AobISI4kX7mmk/8TchfJBGtQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=N36rVxYxfRMhXCdG6fSpvqh/uV/L8Z6wEDYGyiGAY1MtQr/qmF1P5D31re/SLXHBMJIWIoPNmyFIV0mK+e554t5vOb59/wQQ3z3/yd61/lO4rtVTsHHQzBIXfjyfD5kqbCoZXbrc+thtvdlbyqQNLWijIMjpeUB8YLKGFe0vboE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=fail (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=XTn9dUnZ reason="signature verification failed"; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="XTn9dUnZ" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68B4veqG2986907 for ; Fri, 11 Sep 2026 06:22:27 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= ov8DQ7Trrg6ycqk1f4fnXC/EySQzfAKPrnyDSG2tUmo=; b=XTn9dUnZDhS/E/RP FGv9wmzidE4yzbs45tVOFN8vS4XSRhjT4TmB0z2Ckyk9OLnKLanZHaimDGmct8Ro QpGvTRzNDTrnJbjrHRRQLfs+5OpVAYl3y6Gm332p/RFoNHbKaSfXzCcTYQlGqtv+ N7fhHMqzNmvy4nYh0r+zeP63WmZxxRljkIzokWFbFaUc/NQxUp+Xv1mp30lgBH0N ifVk4ZbC2uERDsDHGXE2oP0PvfNaQFVjQpLJzUAd3NXTMiu+m9RpDDO2pu75+Fqo yv0qPxt+n14+IkkN9GheulAjpV83/6A1JKcb8a0QSHzDMAZ7CcGI8v9GEcaidze3 HHOvLA== Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gm1k2aby1-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 11 Sep 2026 06:22:26 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-939a00c45easo86560185a.2 for ; Thu, 10 Sep 2026 23:22:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789107746; x=1789712546; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=ov8DQ7Trrg6ycqk1f4fnXC/EySQzfAKPrnyDSG2tUmo=; b=pNt2y6d8dOifPdAZg6dXiH8AZRC1+tvCBXWwc24+zfaXzeFDFVBmfi/H1k7iZ1105I Kp+16mcJAnHBo+HTqh2kf9M1ysLmZyL0LzKOg3SnwvVZua7bN19Gi67ITZyV1ImmM54y 2uMR6oCHsRzBZe3/gITtPQjZ+wFxhOHt/dWXXvnEgmthcCZEGiEJ766BK+hdy7rf9ZcA CN73hZuJsrGj8cmMNWQcOG4uvfuMs6EzKeMgyoaSOzviJMBEzVIW4k1YAXEslDnGvIri Hx3B9lE3FVlsC9cNEqqQIrs2ZoqPdMMMODWp2Lf4oNMNZuiUE/LnjvkLb1ynGuU2HtDy 7JFQ== X-Forwarded-Encrypted: i=1; AKwUvBx3eExkWJaAszQgsgOtp5oYiLBav5wrZv26ziQuylcmffWkmVrX/9MJ7HuYtazpbJjmkODN+mRbbFuGLVY=@vger.kernel.org X-Gm-Message-State: AFuF++kZpBUJo60bzwexRWNWyZFIbH2UHxI98hzcOipWiMalWq6yj3XM +lZOSVi94u5t3k3z6XtAabBG5wTGXtWHetWdre1kyisT3zg4zM43QBhiR1pRFI8UBeOEUCvFBdX NNEEWEuLsuTN2GcBD+tMDaPVhTstUM5DC2zvIGE6FxOeF1wBxB2eb0MXgmeYl0QkXm08= X-Gm-Gg: AYBFou2S0Y89DX2dyn60u/bWWVoJjEAThhPJrJMcSBl/GJND97I9GNtWUep0RY18ObX UD7p3UmYa/Kn/YXtLCQyYjDtp9zdYRzRWiTyJkQ1JRvLnadsI2k219rXYnaBwwTqBh5ZXYODeqx eDjqcRRVS5ajy2rnCR1xmpsnWXCfq+96cwoBM+siKCUpUQXzyNL2Or4JRGqjsic/CNYeT9/05WQ pa1ctpiYrCtf3pjRjEMvvNRJ0Zpq0AUxknQMXaqJEzd8Vr1FTAN3Lk+lEVQTGwG4iEXImf+ZtHd KwRbKe/Rb5X2LR0C4gmPuZZA+beheqkTcHZ79D+W5x/UucQ0nI5i3ek8HVs= X-Received: by 2002:a05:620a:4686:b0:939:922b:3de1 with SMTP id af79cd13be357-939ea2a3baemr354694485a.44.1789107745885; Thu, 10 Sep 2026 23:22:25 -0700 (PDT) X-Received: by 2002:a05:620a:4686:b0:939:922b:3de1 with SMTP id af79cd13be357-939ea2a3baemr354691285a.44.1789107745354; Thu, 10 Sep 2026 23:22:25 -0700 (PDT) Received: from lin-0843.qualcomm.com ([212.136.9.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-486eb33ea60sm3681969f8f.17.2026.09.10.23.22.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2026 23:22:24 -0700 (PDT) From: Gjorgji.Rosikopulos.gjorgji.rosikopulos@oss.qualcomm.com To: Bryan O'Donoghue , Mauro Carvalho Chehab Cc: Vladimir Zapolskiy , Loic Poulain , Dmitry Baryshkov , Atanas Filipov , Jigarkumar Zala , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Gjorgji Rosikopulos Subject: [PATCH 4/8] media: qcom: camss: Add streams API support in CSID subdevice Date: Fri, 11 Sep 2026 09:22:09 +0300 Message-Id: <20260911062213.195007-5-gjorgji.rosikopulos@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260911062213.195007-1-gjorgji.rosikopulos@oss.qualcomm.com> References: <20260911062213.195007-1-gjorgji.rosikopulos@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Authority-Analysis: v=2.4 cv=cM11IVeN c=1 sm=1 tr=0 ts=6aa39e22 cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=dNlqnMcrdpbb+gQrTujlOQ==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=EUspDBNiAAAA:8 a=TOnICaHA50gGwtKooHQA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=NFOGd7dJGGMPyQGDc5-O:22 X-Proofpoint-GUID: EqPhyqfvVFeZaUo5g285LaLC9uptVSDq X-Proofpoint-Spam-Info: AW1haW4tMjYwOTExMDA4NiBTYWx0ZWRfX03h8pIqJoMHh SMusTQItz4SUapW6m52EUqGdbpyNaxaRn66ELAjKCeuJtStuUDcvHJk2RgF96fZ+6wAVbcYCDht fFa+7gpRYwOj2cRLzFRdPbPpS31k5Nc= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTExMDA4NiBTYWx0ZWRfX9U+Nq3zf2HW9 exRz+FPBg7JsDffXhSL4eLSTnEserV793wrVgDVKY7M8KwgtsnNU7pz6l+cSwB+8WlcKF561I7z TjJGZ/OFHFcQzkwz9WOqnCS/Mx3CyvBsBXJYi2gB1cbDgCIJ5BaPgcD73pwJrgWIlpwBTXeNpJ4 LTQPIXnP2XqJZQKOTwniprcLjPEtgDXapVWTIO7J5d/yfTOCKKDT8Px1bcI4lbL4bOG18xBhPve Ezt3ekSIkRcf7e7Spf1Nhi12MDeUjmtHzy2+Ty9uIC+oE6NkHDn79f6XBv/HSndDdsOqGb48i/W nfual7RKHpiGAAzzPB3Ur+ewOpsR5ovLzL1smzCrxNVXTKpQWt5FY4nh6ALIltImIEnqLDSH9ja 95/rdGsRkA7FxyTn5/jHv/ZN4jPpT77N7PfdXPqfssefIj8ukKolBrcKzSW3R8cJxsAVISbfoq5 yNSrKbWRNY2fkeKLIfA== X-Proofpoint-ORIG-GUID: EqPhyqfvVFeZaUo5g285LaLC9uptVSDq X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-11_02,2026-09-09_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 lowpriorityscore=0 clxscore=1015 adultscore=0 bulkscore=0 priorityscore=1501 impostorscore=0 malwarescore=0 spamscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609110086 From: Gjorgji Rosikopulos Add the V4L2 subdev streams API to the CSID driver: per-source-pad enable/disable_streams pad ops, VC/DT discovery via get_frame_desc on the remote sink pad, and a routing table that routes a single incoming sink stream to every source pad by default (remappable via set_routing for multi-VC sensors). Active streams are tracked per pad via a per-pad enabled_streams[] bitmask, so that enable/disable_streams correctly propagates to the CSIPHY only on first arrival/last departure of a sink stream, and multiple source-pad consumers can share a single propagated sink stream without redundant or colliding propagation. csid_init_state() caps the number of default routes to MSM_CSID_MAX_SRC_STREAMS - 1 for non-lite CSIDs, matching the 3 usable RDI pads on full-IFE CSIDs (the 4th/pix pad is non-functional). msm_csid_register_entity() mirrors the same is_lite check for the pad count itself, so non-lite CSIDs no longer register a pix source pad that no route ever targets. csid_pad_enable_streams() rejects enabling with -ENOLINK when there is no remote sink link and the test generator is disabled, matching the equivalent check the legacy csid_set_stream() already performs. msm_csid_register_entity() assigns the ctrl handler's lock as the subdev's state_lock before v4l2_subdev_init_finalize(), when the test pattern control is present. Without this, the test-pattern S_CTRL handler and the streams API's active-state accessors serialize on two independent locks despite both touching csid->testgen.enabled, allowing a concurrent S_CTRL(TEST_PATTERN) and stream enable/disable to race. This is opt-in per CSID instance via the new streams_enable resource flag; no platform sets it yet, so CSIDs continue to use the legacy non-streams subdev ops unchanged. Signed-off-by: Gjorgji Rosikopulos Tested-by: Hitesh Patel --- .../media/platform/qcom/camss/camss-csid.c | 494 +++++++++++++++++- .../media/platform/qcom/camss/camss-csid.h | 2 + 2 files changed, 491 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss-csid.c b/drivers/media= /platform/qcom/camss/camss-csid.c index 48459b46a981..ce4b07c0c1c2 100644 --- a/drivers/media/platform/qcom/camss/camss-csid.c +++ b/drivers/media/platform/qcom/camss/camss-csid.c @@ -842,7 +842,7 @@ static void csid_try_format(struct csid_device *csid, =20 break; =20 - case MSM_CSID_PAD_SRC: + default: if (csid->testgen.nmodes =3D=3D CSID_PAYLOAD_MODE_DISABLED || csid->testgen_mode->cur.val =3D=3D 0) { /* Test generator is disabled, */ @@ -1338,10 +1338,476 @@ static const struct v4l2_subdev_ops csid_v4l2_ops = =3D { .pad =3D &csid_pad_ops, }; =20 +/* + * csid_get_stream_csi2_desc - Discover the virtual channel and data type + * used by a given sink stream, from an + * already-fetched frame descriptor + * @frame_desc: Frame descriptor fetched via .get_frame_desc from the remo= te + * subdev linked on the sink pad + * @sink_stream: Sink-side stream number to look up + * @desc_csi2: Returns the discovered virtual channel/data type on success + * + * A frame descriptor with a single entry means the remote only exposes one + * stream (e.g. a single-VC sensor), which feeds every CSID source pad, so + * that entry is used regardless of @sink_stream. + * + * Return true if a matching entry was found, false otherwise + */ +static bool csid_get_stream_csi2_desc(struct v4l2_mbus_frame_desc *frame_d= esc, + u32 sink_stream, + struct v4l2_mbus_frame_desc_entry_csi2 *desc_csi2) +{ + unsigned int i; + + if (frame_desc->type !=3D V4L2_MBUS_FRAME_DESC_TYPE_CSI2 || !frame_desc->= num_entries) + return false; + + if (frame_desc->num_entries =3D=3D 1) { + *desc_csi2 =3D frame_desc->entry[0].bus.csi2; + return true; + } + + for (i =3D 0; i < frame_desc->num_entries; i++) { + if (frame_desc->entry[i].stream =3D=3D sink_stream) { + *desc_csi2 =3D frame_desc->entry[i].bus.csi2; + return true; + } + } + + return false; +} + +/* + * csid_get_stream_vc_dt - Discover the virtual channel and data type to + * program for a given sink pad/stream, falling back + * to @format_dt when no frame descriptor is available + * @csid: CSID device + * @state: V4L2 subdevice state + * @remote_pad: Remote pad linked on the CSID sink pad, or NULL if unlinked + * @pad: Source pad number the caller is enabling a stream on + * @format_dt: Data type derived from the sink format, used as a fallback + * and sanity-checked against the discovered data type + * + * Return the discovered virtual channel/data type, or {0, @format_dt} if + * not discovered + */ +static struct v4l2_mbus_frame_desc_entry_csi2 +csid_get_stream_vc_dt(struct csid_device *csid, struct v4l2_subdev_state *= state, + struct media_pad *remote_pad, u32 pad, u8 format_dt) +{ + struct v4l2_mbus_frame_desc_entry_csi2 desc_csi2 =3D { .dt =3D format_dt = }; + struct v4l2_mbus_frame_desc fd =3D { }; + u32 sink_stream; + + if (!remote_pad || + v4l2_subdev_call(media_entity_to_v4l2_subdev(remote_pad->entity), + pad, get_frame_desc, remote_pad->index, &fd)) + return desc_csi2; + + if (v4l2_subdev_routing_find_opposite_end(&state->routing, pad, 0, NULL, = &sink_stream)) + return desc_csi2; + + if (!csid_get_stream_csi2_desc(&fd, sink_stream, &desc_csi2)) { + dev_warn(csid->camss->dev, + "Failed to find CSI2 descriptor for sink stream %u, using vc=3D%u dt= =3D%u\n", + sink_stream, desc_csi2.vc, desc_csi2.dt); + return desc_csi2; + } + + if (desc_csi2.dt !=3D format_dt) + dev_warn(csid->camss->dev, + "Sink stream %u frame desc dt=3D%u differs from format dt=3D%u, using = dt=3D%u\n", + sink_stream, desc_csi2.dt, format_dt, desc_csi2.dt); + + return desc_csi2; +} + +/* + * csid_pad_enable_streams - Enable one or more streams on a source pad + * @sd: CSID V4L2 subdevice + * @state: V4L2 subdevice state + * @pad: Pad number + * @streams_mask: Bitmask of v4l2 streams to enable + * + * The v4l2 core only calls this on a source pad (v4l2_subdev_enable_strea= ms() + * rejects sink pads with -EOPNOTSUPP before reaching the driver), so @pad= is + * not checked here. Each source pad only ever carries stream 0. + * + * The shared sink stream(s) are propagated upstream only once, on the + * transition from no active sink streams to at least one, so that a second + * consumer of the same shared sink stream never triggers a second, redund= ant + * propagation to the sensor. The Rx front-end is likewise only configured + * once, on that same transition. + * + * Return 0 on success, -ENOLINK if there is no remote sink link and the t= est + * generator is disabled, or another negative error code otherwise + */ +static int csid_pad_enable_streams(struct v4l2_subdev *sd, + struct v4l2_subdev_state *state, + u32 pad, u64 streams_mask) +{ + struct csid_device *csid =3D v4l2_get_subdevdata(sd); + const struct csid_hw_ops *hw_ops =3D csid->res->hw_ops; + struct media_pad *remote_pad =3D media_pad_remote_pad_first(&csid->pads[M= SM_CSID_PAD_SINK]); + unsigned int hw_port =3D pad - MSM_CSID_PAD_FIRST_SRC; + const struct csid_format_info *format; + struct v4l2_mbus_frame_desc_entry_csi2 desc_csi2; + u64 sink_streams, propagate_mask; + int ret; + + if (!csid->testgen.enabled && !remote_pad) + return -ENOLINK; + + sink_streams =3D v4l2_subdev_state_xlate_streams(state, pad, MSM_CSID_PAD= _SINK, + &streams_mask); + + if (!csid->enabled_streams[MSM_CSID_PAD_SINK]) { + if (csid->testgen.nmodes !=3D CSID_PAYLOAD_MODE_DISABLED) { + /* + * sd->state_lock is aliased to csid->ctrls.lock, and is + * already held here by the v4l2_subdev_enable_streams() + * caller, so use the lock-free variant to avoid + * self-deadlocking on the same mutex. + */ + ret =3D __v4l2_ctrl_handler_setup(&csid->ctrls); + if (ret < 0) { + dev_err(csid->camss->dev, + "could not sync v4l2 controls: %d\n", ret); + return ret; + } + } + + hw_ops->configure_rx(csid); + } + + /* Sink streams already active elsewhere don't need re-propagating. */ + propagate_mask =3D sink_streams & ~csid->enabled_streams[MSM_CSID_PAD_SIN= K]; + csid->enabled_streams[MSM_CSID_PAD_SINK] |=3D sink_streams; + csid->enabled_streams[pad] |=3D streams_mask; + + format =3D csid_get_fmt_entry(csid->res->formats->formats, + csid->res->formats->nformats, + csid->fmt[pad].code); + desc_csi2 =3D csid_get_stream_vc_dt(csid, state, remote_pad, pad, format-= >data_type); + + hw_ops->enable_stream(csid, hw_port, desc_csi2.vc, desc_csi2.dt); + + if (propagate_mask && remote_pad) { + ret =3D v4l2_subdev_enable_streams(media_entity_to_v4l2_subdev(remote_pa= d->entity), + remote_pad->index, propagate_mask); + if (ret) { + csid->enabled_streams[MSM_CSID_PAD_SINK] &=3D ~propagate_mask; + csid->enabled_streams[pad] &=3D ~streams_mask; + + hw_ops->disable_stream(csid, hw_port); + + return ret; + } + } + + return 0; +} + +/* + * csid_sink_streams_in_use - Compute the subset of sink streams still + * referenced by a source pad other than @pad + * @csid: CSID device + * @state: V4L2 subdevice state + * @pad: Source pad to exclude from the check + * @sink_streams: Candidate sink streams to check + * + * Return the subset of @sink_streams still referenced by some other source + * pad + */ +static u64 csid_sink_streams_in_use(struct csid_device *csid, struct v4l2_= subdev_state *state, + u32 pad, u64 sink_streams) +{ + u64 in_use =3D 0; + unsigned int i; + + for (i =3D MSM_CSID_PAD_FIRST_SRC; i < MSM_CSID_PADS_NUM; i++) { + u64 other_streams =3D csid->enabled_streams[i]; + u64 other_sink_streams; + + if (i =3D=3D pad) + continue; + + other_sink_streams =3D v4l2_subdev_state_xlate_streams(state, i, MSM_CSI= D_PAD_SINK, + &other_streams); + in_use |=3D sink_streams & other_sink_streams; + } + + return in_use; +} + +/* + * csid_pad_disable_streams - Disable one or more streams on a source pad + * @sd: CSID V4L2 subdevice + * @state: V4L2 subdevice state + * @pad: Pad number + * @streams_mask: Bitmask of v4l2 streams to disable + * + * The v4l2 core only calls this on a source pad (v4l2_subdev_disable_stre= ams() + * rejects sink pads with -EOPNOTSUPP before reaching the driver), so @pad= is + * not checked here. Each source pad only ever carries stream 0. + * + * A sink stream is only disabled, and propagated upstream to disable it t= here + * too, once no source pad references it any more. + * + * Return 0 on success or a negative error code otherwise + */ +static int csid_pad_disable_streams(struct v4l2_subdev *sd, + struct v4l2_subdev_state *state, + u32 pad, u64 streams_mask) +{ + struct csid_device *csid =3D v4l2_get_subdevdata(sd); + const struct csid_hw_ops *hw_ops =3D csid->res->hw_ops; + struct media_pad *remote_pad =3D media_pad_remote_pad_first(&csid->pads[M= SM_CSID_PAD_SINK]); + unsigned int hw_port =3D pad - MSM_CSID_PAD_FIRST_SRC; + u64 sink_streams, disable_sink_streams; + int ret =3D 0; + + sink_streams =3D v4l2_subdev_state_xlate_streams(state, pad, MSM_CSID_PAD= _SINK, + &streams_mask); + + /* Keep a sink stream active as long as any other source pad still uses i= t. */ + disable_sink_streams =3D sink_streams & + ~csid_sink_streams_in_use(csid, state, pad, sink_streams); + + if (disable_sink_streams && remote_pad) { + ret =3D v4l2_subdev_disable_streams(media_entity_to_v4l2_subdev(remote_p= ad->entity), + remote_pad->index, disable_sink_streams); + if (ret) + dev_err(csid->camss->dev, + "Failed to disable stream on remote pad: %d\n", ret); + } + + hw_ops->disable_stream(csid, hw_port); + + csid->enabled_streams[pad] &=3D ~streams_mask; + csid->enabled_streams[MSM_CSID_PAD_SINK] &=3D ~disable_sink_streams; + + return ret; +} + +static const struct v4l2_mbus_framefmt csid_default_format =3D { + .code =3D MEDIA_BUS_FMT_UYVY8_1X16, + .width =3D 1920, + .height =3D 1080, + .field =3D V4L2_FIELD_NONE, + .colorspace =3D V4L2_COLORSPACE_SRGB, +}; + +/* + * csid_set_routing - Handle setting of routing table + * @sd: CSID V4L2 subdevice + * @state: V4L2 subdevice state + * @which: TRY or ACTIVE routing + * @routing: Routing table to set + * + * Return 0 on success or a negative error code otherwise + */ +static int csid_set_routing(struct v4l2_subdev *sd, + struct v4l2_subdev_state *state, + enum v4l2_subdev_format_whence which, + struct v4l2_subdev_krouting *routing) +{ + struct csid_device *csid =3D v4l2_get_subdevdata(sd); + unsigned int i; + int ret; + + if (which =3D=3D V4L2_SUBDEV_FORMAT_ACTIVE && csid->enabled_streams[MSM_C= SID_PAD_SINK]) + return -EBUSY; + + for (i =3D 0; i < routing->num_routes; i++) + if (routing->routes[i].source_stream !=3D 0) + return -EINVAL; + + ret =3D v4l2_subdev_routing_validate(sd, routing, + V4L2_SUBDEV_ROUTING_NO_SOURCE_STREAM_MIX | + V4L2_SUBDEV_ROUTING_NO_SOURCE_MULTIPLEXING | + V4L2_SUBDEV_ROUTING_NO_N_TO_1); + if (ret) + return ret; + + return v4l2_subdev_set_routing_with_fmt(sd, state, routing, &csid_default= _format); +} + +/* + * __csid_get_stream_format - Get pointer to per-stream format structure + * @csid: CSID device + * @sd_state: V4L2 subdev state + * @pad: pad from which format is requested + * @stream: stream from which format is requested + * @which: TRY or ACTIVE format + * + * Same as __csid_get_format(), but honors @stream for TRY-state lookups. + * For ACTIVE state, csid->fmt[] is indexed by pad + stream. @stream is + * always 0 and @pad selects the RDI channel (0-3). + * + * Return pointer to TRY or ACTIVE format structure + */ +static struct v4l2_mbus_framefmt * +__csid_get_stream_format(struct csid_device *csid, + struct v4l2_subdev_state *sd_state, + unsigned int pad, u32 stream, + enum v4l2_subdev_format_whence which) +{ + if (which =3D=3D V4L2_SUBDEV_FORMAT_TRY) + return v4l2_subdev_state_get_format(sd_state, pad, stream); + + if (pad =3D=3D MSM_CSID_PAD_SINK) + return &csid->fmt[MSM_CSID_PAD_SINK]; + + return &csid->fmt[pad + stream]; +} + +/* + * csid_streams_get_format - Handle get format by pads subdev method + * @sd: CSID V4L2 subdevice + * @sd_state: V4L2 subdev state + * @fmt: pointer to v4l2 subdev format structure + * + * Return -EINVAL or zero on success + */ +static int csid_streams_get_format(struct v4l2_subdev *sd, + struct v4l2_subdev_state *sd_state, + struct v4l2_subdev_format *fmt) +{ + struct csid_device *csid =3D v4l2_get_subdevdata(sd); + struct v4l2_mbus_framefmt *format; + + format =3D __csid_get_stream_format(csid, sd_state, fmt->pad, fmt->stream= , fmt->which); + if (!format) + return -EINVAL; + + fmt->format =3D *format; + + return 0; +} + +/* + * csid_streams_set_format - Handle set format by pads subdev method + * @sd: CSID V4L2 subdevice + * @sd_state: V4L2 subdev state + * @fmt: pointer to v4l2 subdev format structure + * + * Return -EINVAL or zero on success + */ +static int csid_streams_set_format(struct v4l2_subdev *sd, + struct v4l2_subdev_state *sd_state, + struct v4l2_subdev_format *fmt) +{ + struct csid_device *csid =3D v4l2_get_subdevdata(sd); + struct v4l2_mbus_framefmt *format; + struct v4l2_subdev_route *route; + + if (fmt->which =3D=3D V4L2_SUBDEV_FORMAT_ACTIVE && csid->enabled_streams[= MSM_CSID_PAD_SINK]) + return -EBUSY; + + format =3D __csid_get_stream_format(csid, sd_state, fmt->pad, fmt->stream= , fmt->which); + if (!format) + return -EINVAL; + + csid_try_format(csid, sd_state, fmt->pad, &fmt->format, fmt->which); + *format =3D fmt->format; + + /* Propagate the format from the sink stream to every source stream it fe= eds */ + for_each_active_route(&sd_state->routing, route) { + struct v4l2_mbus_framefmt *src_format; + + if (route->sink_pad !=3D fmt->pad || route->sink_stream !=3D fmt->stream) + continue; + + src_format =3D __csid_get_stream_format(csid, sd_state, route->source_pa= d, + route->source_stream, fmt->which); + if (!src_format) + continue; + + *src_format =3D fmt->format; + csid_try_format(csid, sd_state, route->source_pad, src_format, fmt->whic= h); + } + + return 0; +} + +static const struct v4l2_subdev_pad_ops csid_streams_pad_ops =3D { + .enum_mbus_code =3D csid_enum_mbus_code, + .enum_frame_size =3D csid_enum_frame_size, + .get_fmt =3D csid_streams_get_format, + .set_fmt =3D csid_streams_set_format, + .set_routing =3D csid_set_routing, + .enable_streams =3D csid_pad_enable_streams, + .disable_streams =3D csid_pad_disable_streams, +}; + +static const struct v4l2_subdev_video_ops csid_streams_video_ops =3D { + .s_stream =3D v4l2_subdev_s_stream_helper, +}; + +static const struct v4l2_subdev_ops csid_streams_v4l2_ops =3D { + .core =3D &csid_core_ops, + .pad =3D &csid_streams_pad_ops, + .video =3D &csid_streams_video_ops, +}; + +/* + * csid_init_state - Initialize the routing table for the streams API subd= ev + * @sd: CSID V4L2 subdevice + * @state: V4L2 subdev state + * + * source_stream is always 0: each source pad MSM_CSID_PAD_FIRST_SRC + i + * links to its own independent downstream subdev, and a link's sink side = is + * validated against the implicit stream 0 exposed by any subdev without + * V4L2_SUBDEV_FL_STREAMS (see v4l2_link_validate_get_streams()) =E2=80=94= every + * downstream VFE line is such a subdev. + * + * All source pads route from sink_stream 0 by default, fanning the single + * incoming stream out to every port; a multi-VC source is supported by + * remapping each route's sink_stream via .set_routing, leaving + * source_pad/source_stream untouched. + * + * Return 0 on success or a negative error code otherwise + */ +static int csid_init_state(struct v4l2_subdev *sd, struct v4l2_subdev_stat= e *state) +{ + struct csid_device *csid =3D v4l2_get_subdevdata(sd); + struct v4l2_subdev_route routes[MSM_CSID_MAX_SRC_STREAMS]; + struct v4l2_subdev_krouting routing =3D { }; + unsigned int num_routes; + int i, ret; + + /* The full IFE has only 3 rdi's and pix output is not functional */ + if (csid_is_lite(csid)) + num_routes =3D MSM_CSID_MAX_SRC_STREAMS; + else + num_routes =3D MSM_CSID_MAX_SRC_STREAMS - 1; + + for (i =3D 0; i < num_routes; i++) { + routes[i].sink_pad =3D MSM_CSID_PAD_SINK; + routes[i].sink_stream =3D 0; + routes[i].source_pad =3D MSM_CSID_PAD_FIRST_SRC + i; + routes[i].source_stream =3D 0; + routes[i].flags =3D V4L2_SUBDEV_ROUTE_FL_ACTIVE; + } + + routing.num_routes =3D num_routes; + routing.routes =3D routes; + ret =3D v4l2_subdev_set_routing_with_fmt(sd, state, &routing, &csid_defau= lt_format); + if (ret) + dev_err(csid->camss->dev, "Failed to set routing: %d\n", ret); + + return ret; +} + static const struct v4l2_subdev_internal_ops csid_v4l2_internal_ops =3D { .open =3D csid_init_formats, }; =20 +static const struct v4l2_subdev_internal_ops csid_streams_internal_ops =3D= { + .init_state =3D csid_init_state, +}; + static const struct media_entity_operations csid_media_ops =3D { .link_setup =3D csid_link_setup, .link_validate =3D v4l2_subdev_link_validate, @@ -1360,13 +1826,18 @@ int msm_csid_register_entity(struct csid_device *cs= id, struct v4l2_subdev *sd =3D &csid->subdev; struct media_pad *pads =3D csid->pads; struct device *dev =3D csid->camss->dev; + bool streams_api =3D csid->res->streams_enable; + unsigned int num_pads =3D csid_is_lite(csid) ? MSM_CSID_PADS_NUM : MSM_CS= ID_PADS_NUM - 1; int i; int ret; =20 - v4l2_subdev_init(sd, &csid_v4l2_ops); - sd->internal_ops =3D &csid_v4l2_internal_ops; + v4l2_subdev_init(sd, streams_api ? &csid_streams_v4l2_ops : &csid_v4l2_op= s); + sd->internal_ops =3D streams_api ? &csid_streams_internal_ops + : &csid_v4l2_internal_ops; sd->flags |=3D V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS; + if (streams_api) + sd->flags |=3D V4L2_SUBDEV_FL_STREAMS; snprintf(sd->name, ARRAY_SIZE(sd->name), "%s%d", MSM_CSID_NAME, csid->id); v4l2_set_subdevdata(sd, csid); @@ -1400,17 +1871,28 @@ int msm_csid_register_entity(struct csid_device *cs= id, } =20 pads[MSM_CSID_PAD_SINK].flags =3D MEDIA_PAD_FL_SINK; - for (i =3D MSM_CSID_PAD_FIRST_SRC; i < MSM_CSID_PADS_NUM; ++i) + for (i =3D MSM_CSID_PAD_FIRST_SRC; i < num_pads; ++i) pads[i].flags =3D MEDIA_PAD_FL_SOURCE; =20 sd->entity.function =3D MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER; sd->entity.ops =3D &csid_media_ops; - ret =3D media_entity_pads_init(&sd->entity, MSM_CSID_PADS_NUM, pads); + ret =3D media_entity_pads_init(&sd->entity, num_pads, pads); if (ret < 0) { dev_err(dev, "Failed to init media entity: %d\n", ret); goto free_ctrl; } =20 + if (streams_api) { + if (csid->testgen.nmodes !=3D CSID_PAYLOAD_MODE_DISABLED) + sd->state_lock =3D csid->ctrls.lock; + + ret =3D v4l2_subdev_init_finalize(sd); + if (ret) { + dev_err(dev, "Failed to finalize subdev: %d\n", ret); + goto media_cleanup; + } + } + ret =3D v4l2_device_register_subdev(v4l2_dev, sd); if (ret < 0) { dev_err(dev, "Failed to register subdev: %d\n", ret); @@ -1420,6 +1902,7 @@ int msm_csid_register_entity(struct csid_device *csid, return 0; =20 media_cleanup: + v4l2_subdev_cleanup(sd); media_entity_cleanup(&sd->entity); free_ctrl: if (csid->testgen.nmodes !=3D CSID_PAYLOAD_MODE_DISABLED) @@ -1435,6 +1918,7 @@ int msm_csid_register_entity(struct csid_device *csid, void msm_csid_unregister_entity(struct csid_device *csid) { v4l2_device_unregister_subdev(&csid->subdev); + v4l2_subdev_cleanup(&csid->subdev); media_entity_cleanup(&csid->subdev.entity); if (csid->testgen.nmodes !=3D CSID_PAYLOAD_MODE_DISABLED) v4l2_ctrl_handler_free(&csid->ctrls); diff --git a/drivers/media/platform/qcom/camss/camss-csid.h b/drivers/media= /platform/qcom/camss/camss-csid.h index 90ee611b9092..a312103cf86d 100644 --- a/drivers/media/platform/qcom/camss/camss-csid.h +++ b/drivers/media/platform/qcom/camss/camss-csid.h @@ -184,6 +184,7 @@ struct csid_hw_ops { =20 struct csid_subdev_resources { bool is_lite; + bool streams_enable; const struct csid_hw_ops *hw_ops; const struct parent_dev_ops *parent_dev_ops; const struct csid_formats *formats; @@ -209,6 +210,7 @@ struct csid_device { struct v4l2_mbus_framefmt fmt[MSM_CSID_PADS_NUM]; struct v4l2_ctrl_handler ctrls; struct v4l2_ctrl *testgen_mode; + u64 enabled_streams[MSM_CSID_PADS_NUM]; const struct csid_subdev_resources *res; }; =20 --=20 2.34.1 From nobody Fri Sep 25 14:32:37 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 4024D3F58EA for ; Fri, 11 Sep 2026 06:22:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789107756; cv=none; b=VqXO2HjpMbkFYpMhKwRkqdFkBY40/xRsdRuwvTxbltY83X6VUTuvoUXOPn17y2OV31Nw+TtXyPFdd/NpZuCI5rSKLiWrDwzx5amAeg7wWGZiio1Vdtr/TFl+AmxEkbGC7Gs4ZI/irVkti7+2n2kXDYwP0bAELv4iYS48A1a1ews= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789107756; c=relaxed/simple; bh=9a2otHsWPgTCqqpoSPH5+inCAvVQ5uCN7hbABIuWFsQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=U8KW5dCN3wMZQy77f0TfqoK91RCnHxj6BX1pU9zwewMmqCRta5kiCM1uzSRGPRGw6eOa9NOE6I/xUVmdkcyp08stBjhjK/4eUpddLVo/wTyDRpyt+RS/oInQcZRJdlznRUr2mHGQEvmv5NlWKC3AOBp72aUYlqPKvn40aqeScHE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=fail (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=Zonxc3Ry reason="signature verification failed"; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="Zonxc3Ry" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68B4vSaf3665120 for ; Fri, 11 Sep 2026 06:22:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=W8+MlrBWEAN eqZf07oqzyGDGfzjvQVczdsnNfM3tEEE=; b=Zonxc3RyrhYAAi2YBOkgdhShqjc eMmc1ooXzGvLaP9/Emif70goSfDI+V277Xs8sOWK40MHigRNNKUk2hOU0jw5rPDu A4/IlNdReshx304qNzx+Wl6ZG3bdNbd7Ww0dC1bQLZbzH8exAMqQQAAsPwFAY+tq 7Tf72E1P9RmTtMC2N3dTgLRHpzt/sZBrDsHuBovwjfdi/XYK2y+KaXpxJBpkZo8o TnKNog+2zD8pepxM6eVyYmo7A7xjrxwOXbYtouaciDilItcngV/aKZCt8xh3B4J1 CSsA2Wg0a7H2RvvDYYa3roJL9qdJFkxTwBVq+bRe0Mggw1gCcq1T6t6Zg9w== Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gm2q1222a-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 11 Sep 2026 06:22:27 +0000 (GMT) Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-939f1847fb9so23829385a.3 for ; Thu, 10 Sep 2026 23:22:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789107747; x=1789712547; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=W8+MlrBWEANeqZf07oqzyGDGfzjvQVczdsnNfM3tEEE=; b=JOK72ZGQgMAEDPw2kppsJCWCJ3s7s8gbQv2AWn5YFyX6++LZ/YEQaDMCW9EzokcRk2 0g+OGMkCCntCqk8eUikjizPEJOwf2K3/8s5BjqNB+UCGiVY2fcKVez4kARDP4LKb+jsH E1X6cyM6GFA4zGLgLVXSHn5uda++6Ho8yZrp//zPotg0+eOY0UP/TSnRzvYJ0hUPX7cS o/Ow01lXqpfRnympxXju6Sb0+aJkBLPXRHEf4z4KCzXoVwy3V8lnuRTq18v6w3OOKhcx UAoVkt8XhjXqOMhwtCcTvAEAe4MIqmBlNjZ2DuBMldyiUo5zdMO3XjMtkXLCT11i2SL1 4Tsw== X-Forwarded-Encrypted: i=1; AKwUvBy/L6Ap4sY1K0IyOyo5MomHwrZwfxesMJSsTLgMsREq11w0lLN17gTsCt2T6cvz1hXUVPQ445qmiQ3KHnE=@vger.kernel.org X-Gm-Message-State: AFuF++neEN37bsw0Ujs3ws5ifgCXQWSF61g9+ptYSVE6HpuuLpO0lfQH 2L7ZFjEYN8nit8jyspOzfsHpbEdIR3SIrJEidPfIBNCCTwWlJlOuSLlKnqEJ4dxZUU5mK2HeyZT pCfVDCh2Q+W+ruVRA4jJ97vKL1bAR3bNg2MDMDOPNEQ0kX5XgZJvJqowsrHxoKSZZEMw= X-Gm-Gg: AYBFou2UpMO0zWy91htzn48brHavOjQPaHlv/D6OAgTq1t/ZbIFX5fQBmsLwfMuGhaU v80Y5wVUdZmcRyVNUQxHVdk/1+ApAl8G/5nhR1ufkLleSnQp6pKOTPxjWFEgzpO4ELUouN800Lm +ueRJ3U7d/H8ntv8mH2ZZW3Zj7ES/NVG3idf97Gu8q3q/KeBbSJZnfJ6ZrTfgOoP46tkHKA9H/C oSvft/Ey/zxaLBG53vixYKLutkotL3BWIaOGpAj7Z1MCL2I7zXlWFjqF4JwGS43M/exPsJ8eefr ku1Pr3NCKP69XPTsfMYjY9QsU4gRcKJBQQn8KRlcCK5a2QqZyCFIxZBDvMk= X-Received: by 2002:a05:620a:29c1:b0:939:993e:bffb with SMTP id af79cd13be357-939ea1838c4mr327272085a.22.1789107747372; Thu, 10 Sep 2026 23:22:27 -0700 (PDT) X-Received: by 2002:a05:620a:29c1:b0:939:993e:bffb with SMTP id af79cd13be357-939ea1838c4mr327269285a.22.1789107747010; Thu, 10 Sep 2026 23:22:27 -0700 (PDT) Received: from lin-0843.qualcomm.com ([212.136.9.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-486eb33ea60sm3681969f8f.17.2026.09.10.23.22.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2026 23:22:26 -0700 (PDT) From: Gjorgji.Rosikopulos.gjorgji.rosikopulos@oss.qualcomm.com To: Bryan O'Donoghue , Mauro Carvalho Chehab Cc: Vladimir Zapolskiy , Loic Poulain , Dmitry Baryshkov , Atanas Filipov , Jigarkumar Zala , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Gjorgji Rosikopulos Subject: [PATCH 5/8] media: qcom: camss: Fix CSID-to-VFE all-to-all link crossbar on sm8250 Date: Fri, 11 Sep 2026 09:22:10 +0300 Message-Id: <20260911062213.195007-6-gjorgji.rosikopulos@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260911062213.195007-1-gjorgji.rosikopulos@oss.qualcomm.com> References: <20260911062213.195007-1-gjorgji.rosikopulos@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Authority-Analysis: v=2.4 cv=d6lgWhjE c=1 sm=1 tr=0 ts=6aa39e23 cx=c_pps a=HLyN3IcIa5EE8TELMZ618Q==:117 a=dNlqnMcrdpbb+gQrTujlOQ==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=EUspDBNiAAAA:8 a=wE0bsl3glxBt6B52h2UA:9 a=bTQJ7kPSJx9SKPbeHEYW:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTExMDA4NiBTYWx0ZWRfX9PfUTDUG74/Z G846QnbmiJP1756fJBDceee+y0W+QxV0RKzdDmJCtJneUs5TeRXZZiwHzoZ1lH9VFVhgUX99gJt S5co0W8u0wQNmx1dR7EVYfpTyIgKB9qmWu9+59zVpKwLxujzJUqHV/6iWwMeAL7/KpxGqGmwf1S hvlzF1lFoL0kzxa7bAqSCcUCe1xefEv4oQybSDL+p06WwKwMfLDIlwuRS6irX9vt9k0nF02zhJm jL1nPCCTFHTp0poeRvdvIK48rpj8uC5BKN2xMV+Gf5XIpprLrbHFRx3gnpdh/2IH43ayog65cds M5tPG3/DkQGy1UELdKHQWjyJUoMtramtmU5/S2Z1H4YWDuhDb04dEpAauAPr5+cs0fE2R/4UBjs ctds94f26tk3BvLTalZayVdRiREE4TRgztuKELr5s5QOHHOhBMZBIaHD85rxbVJjlDpBBnLXF3M BgKplu4q3eqtXTDlaww== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTExMDA4NiBTYWx0ZWRfX86/szuIZmEGF D3s/1HyQJz/zu/uA/4PtYEmroMJXq6SnjonXiGKHFpVg88vyi/09Iz9UOG2URy0LiBJyDzcng2v nSDevCNZy7fcBNCi9s45CRKoQ/W222Q= X-Proofpoint-GUID: ffS7AFd1RGa-KDisbnK8WEwMaGilm-Zt X-Proofpoint-ORIG-GUID: ffS7AFd1RGa-KDisbnK8WEwMaGilm-Zt X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-11_02,2026-09-09_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 suspectscore=0 spamscore=0 priorityscore=1501 bulkscore=0 adultscore=0 lowpriorityscore=0 phishscore=0 clxscore=1015 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609110086 Content-Type: text/plain; charset="utf-8" From: Gjorgji Rosikopulos camss_link_entities() unconditionally links every CSID to every VFE, creating an all-to-all crossbar. On SM8250 the hardware wiring is fixed: each CSID is hardwired to exactly one VFE (csid[i] <-> vfe[i]), with no crossbar between instances. Enabling a mismatched link (e.g. csid0 -> vfe1) creates a media link that does not correspond to any real hardware datapath. Add a csid_vfe_fixed_pairing flag to struct camss_resources and set it for sm8250_resources. When set, camss_link_entities() skips creating links between CSID and VFE instances whose indices do not match. Other platforms keep the historical all-to-all link creation. Signed-off-by: Gjorgji Rosikopulos Tested-by: Hitesh Patel --- drivers/media/platform/qcom/camss/camss.c | 7 ++++++- drivers/media/platform/qcom/camss/camss.h | 7 +++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/plat= form/qcom/camss/camss.c index 2123f6388e3d..1bb22cd23c5e 100644 --- a/drivers/media/platform/qcom/camss/camss.c +++ b/drivers/media/platform/qcom/camss/camss.c @@ -5000,7 +5000,10 @@ static int camss_link_entities(struct camss *camss) } } else { for (i =3D 0; i < camss->res->csid_num; i++) - for (k =3D 0; k < camss->res->vfe_num; k++) + for (k =3D 0; k < camss->res->vfe_num; k++) { + if (camss->res->csid_vfe_fixed_pairing && i !=3D k) + continue; + for (j =3D 0; j < camss->vfe[k].res->line_num; j++) { struct v4l2_subdev *csid =3D &camss->csid[i].subdev; struct v4l2_subdev *vfe =3D &camss->vfe[k].line[j].subdev; @@ -5017,6 +5020,7 @@ static int camss_link_entities(struct camss *camss) return ret; } } + } } =20 return 0; @@ -5666,6 +5670,7 @@ static const struct camss_resources sm8250_resources = =3D { .csiphy_num =3D ARRAY_SIZE(csiphy_res_8250), .csid_num =3D ARRAY_SIZE(csid_res_8250), .vfe_num =3D ARRAY_SIZE(vfe_res_8250), + .csid_vfe_fixed_pairing =3D true, }; =20 static const struct camss_resources sc8280xp_resources =3D { diff --git a/drivers/media/platform/qcom/camss/camss.h b/drivers/media/plat= form/qcom/camss/camss.h index 93d691c8ac63..ad0b42719788 100644 --- a/drivers/media/platform/qcom/camss/camss.h +++ b/drivers/media/platform/qcom/camss/camss.h @@ -119,6 +119,13 @@ struct camss_resources { const unsigned int tpg_num; const unsigned int csid_num; const unsigned int vfe_num; + /* + * True on platforms where each CSID is wired to exactly one VFE at + * the same index (csid[i] <-> vfe[i]). When set, camss_link_entities() + * only creates CSID->VFE links for matching indices instead of an + * all-to-all crossbar. + */ + const bool csid_vfe_fixed_pairing; }; =20 struct camss { --=20 2.34.1 From nobody Fri Sep 25 14:32:37 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 021693F1052 for ; Fri, 11 Sep 2026 06:22:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789107759; cv=none; b=t6PJ+zQPtNC69ps1QTAAtXg1O/vUzKhNXWSIXJgUS3f2ZrqgL+1gqKY/nCWiNCrcKeAq3mdWfZ2cEtwCK+umeAfAKhv+AV5+35Ruky1+egNAjhwBxqG54/ujM8ZppuqBMDDtfDy7lmrdrYMaC7eQ1dcwLKGtTGob5n1D2UVvfMc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789107759; c=relaxed/simple; bh=8sgciIDVExgjJLD3rIKKOvLlqAT+p0grCGzz/zZzc5U=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=saq+V8UoSBofd8cS6SroQmFpgyFts4cPgIz+2geqKG8/lmPplscR6+1rgs8tDZZuG505IcjWMoVVJPA1RV5+Gb3UfC7MjY1cSwGbUcql+D745UB9oXdLE/GYoFWK0Ju7YsnpWcvMVBF7stehbc8oun0dBJzT39Tfie3KLEqdlgg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=fail (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=ealk/Wuk reason="signature verification failed"; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="ealk/Wuk" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68B4vjlo3665845 for ; Fri, 11 Sep 2026 06:22:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=Rhj2lcG2YTl mrBluCpPTnZQuKB9AWdOEgJD05Ko4Lfg=; b=ealk/WukJl5xjNkPsLyu4VbRde6 7SyjJbqK4iZ6y9Z19jMes9e6Wps2/eU1dziNEldeinxISBP3mECJNCzKtgfkoip5 zr7Ow0P08juJfE5pqIMOGmsZwR0D0/8yJ8ZyLjCMs6POffyua/Q21iWOYO+LR37L hJ6Kf8opXtAm/KasQmZupGuO7x7UHqOkUj+ERjE7eKUGvl9BhIv37WtjNbDBFc/L g/uwS6wfXys8ccfcCyb2vD1Rsr1Wc5kYnPsMbQ5hBpnZrcpnwsC1Gd3N6EYjoqDW NfQct5eL80+5KV5zTlDm6ZJMdwH2+z/0FOoN11tb5A8i2UHdOsMaAVu2mGA== Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gm2q1222b-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 11 Sep 2026 06:22:29 +0000 (GMT) Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-90ceabcd64aso10306676d6.3 for ; Thu, 10 Sep 2026 23:22:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789107749; x=1789712549; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=Rhj2lcG2YTlmrBluCpPTnZQuKB9AWdOEgJD05Ko4Lfg=; b=KKXv1vwUfiRx+Cbp6cEZGxIKqCOb3K9fxFD6N9m1OrHpFTNWZr3kz3YencpYofqbz9 HWZTjN0+EplzmUTzuI26hmNaRG5PjLXKUZ3/kmDwpQdRBb8RVGD2qHcQEN5LgcOf8skp UtQQzexWpK+6IXrKfghDedtaqcDbzG0jHiVmHsZdNP/tWO25Q+bplThFdNiUVFEgYwyV JGfiDAmJ6zhymsalfwDeEbbq4vP87FE949PpiMcGNPkkQKkcYxGYVAtFcSBn3udoW8NP WsOrzZGaukQbyvi9Z+NSd0Of1YaGUOEQanXKu2h8a2UfNmPTGeHzi2aXekwSuRQQHyb9 KNdQ== X-Forwarded-Encrypted: i=1; AKwUvBwOOt8XBa5d+tvMD1ipw3i1qKhOUiiep01C8eDvcp2AVcmGgoGInU8/U+0/arYpUMr37CgtlJGamPYVMIk=@vger.kernel.org X-Gm-Message-State: AFuF++nud4G9Y4K8HU/6q2Z56N+WbKtHo6heiZTQEnYp3XIlaDrDZz62 m6tjWAQizgadYLD8JOYVZomrZTkx7tlyCKRCHuUiLC8trnGSrd0wC2ML7HNQFGRwpLnWEjm1NJk 1qYqBWXo3u5Z+d8V4P8Gb1R0a1ZfYkrffczHHNmozdviaxHPmksSpn9nU1QqEA8pAuuM= X-Gm-Gg: AYBFou1KmtPOn4W5KKnnlQcE5swN+euSD7JLwTKnWQ8aDl8Px+rUnsyAz0DIULrlSId XduqaHWYykjh7NYz3WMthvOnWPeKylKBhpWUwhKNRIRlFqvA+mih0B5BlK1jqhh0+ZZx1lGyvNA moE3DuiEyAnY6kTxzCZy++AIfYppx78su3l3hue+L9+IkCUho5P5NluXUA+gy/smphI6bN1hfLP yNapHDR95sL1O7OlRISymzAHfIRzYumVi07mFnh897LsB4q0T/BFtYk/RcrLItCnYuDdbA9c248 SG6iq+vqv6WIF0kqo3808nYE7Heec6zifoNyGw4upkBXWZ/LMjL/NWavNa0= X-Received: by 2002:a05:620a:29c4:b0:939:a1cc:f234 with SMTP id af79cd13be357-939e9d9bb34mr349700085a.5.1789107749207; Thu, 10 Sep 2026 23:22:29 -0700 (PDT) X-Received: by 2002:a05:620a:29c4:b0:939:a1cc:f234 with SMTP id af79cd13be357-939e9d9bb34mr349698185a.5.1789107748789; Thu, 10 Sep 2026 23:22:28 -0700 (PDT) Received: from lin-0843.qualcomm.com ([212.136.9.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-486eb33ea60sm3681969f8f.17.2026.09.10.23.22.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2026 23:22:27 -0700 (PDT) From: Gjorgji.Rosikopulos.gjorgji.rosikopulos@oss.qualcomm.com To: Bryan O'Donoghue , Mauro Carvalho Chehab Cc: Vladimir Zapolskiy , Loic Poulain , Dmitry Baryshkov , Atanas Filipov , Jigarkumar Zala , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Gjorgji Rosikopulos Subject: [PATCH 6/8] media: qcom: camss: add streams API support for VFE Date: Fri, 11 Sep 2026 09:22:11 +0300 Message-Id: <20260911062213.195007-7-gjorgji.rosikopulos@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260911062213.195007-1-gjorgji.rosikopulos@oss.qualcomm.com> References: <20260911062213.195007-1-gjorgji.rosikopulos@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Authority-Analysis: v=2.4 cv=d6lgWhjE c=1 sm=1 tr=0 ts=6aa39e25 cx=c_pps a=7E5Bxpl4vBhpaufnMqZlrw==:117 a=dNlqnMcrdpbb+gQrTujlOQ==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=EUspDBNiAAAA:8 a=1wZbyvoE6vXdBGjt7Z0A:9 a=pJ04lnu7RYOZP9TFuWaZ:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTExMDA4NiBTYWx0ZWRfX67DgJaKNfLwy jdLergPwTCBpDTBSzoU7yrXwciI24aEBG/ZZfamdjyw9GG4h4Y0mICF/OAPQi4XE/AA+lNZjQSh Kn9e31+uG+KTJTl8ap3c0+eqPkQfLaphFpt6RLQju3PH83iAwtbBRtAwMjE2NtuorUxgKRMGcGF 59mztVcs1SjUTuGSbzTzjjr7JXIAQq1NJ4k2aBQYOpJfhXUAIgQQw2P7cv+CRwerJXe7ks6v26e ejWl0lMtp51FPjtEVg/f3CKIPkkj+Ll6ETzLuttX4qlCbSNOYpNFLcmLSQxSlNYMbXWPG9CZkYT Y9XeVHz61eIzoszZwPtdS2qit6UMBT3PkSW7cKE05PIjOYj5Ib185adc8vF9eCKCoZNyOcWwbIQ +BPciwFyEEpOb9aXqteBrLKPjODvKHgbIzTt4xIsIfUawHiRpxAy5xpwKKPupDLj3mOOOKxPqU9 2seAhQk5vgHWU0CtKMg== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTExMDA4NiBTYWx0ZWRfXz5b2IANaiFZ8 k3KYKXXVyXqMBLDaCYG9RutRCBzjnwIGFBOJdqIXoRpjyAOooYC10FZz6nBCBgoEJ0j4ymR+7yh LtqONE9yEDd0tf3RISfbGmemUI3iSgU= X-Proofpoint-GUID: GHNZ71Md7_5G5KaxmmaauJlhETJcMl3P X-Proofpoint-ORIG-GUID: GHNZ71Md7_5G5KaxmmaauJlhETJcMl3P X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-11_02,2026-09-09_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 suspectscore=0 spamscore=0 priorityscore=1501 bulkscore=0 adultscore=0 lowpriorityscore=0 phishscore=0 clxscore=1015 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609110086 Content-Type: text/plain; charset="utf-8" From: Gjorgji Rosikopulos Add the V4L2 subdev streams API to the VFE driver. VFE lines are inherently single-consumer, so no per-stream refcounting is needed: enable_streams reserves the output and enables the line, then propagates a single-stream enable to the CSID; disable_streams mirrors this in reverse. On disable_streams, both the local VFE hardware disable and the propagated disable to the remote CSID pad are attempted unconditionally, and a failure on either side is logged rather than skipping the other side's teardown or attempting a rollback. This matches the best-effort error-handling convention used by other streams-API drivers (e.g. dw-mipi-csi2rx, ds90ub960, cdns-csi2rx) for this same situation, since there is no way to un-disable a peer that already tore itself down. If the local disable also failed, its error takes precedence in the value returned to the core. This is opt-in per VFE instance via the new streams_enable resource flag; no platform sets it yet, so VFE lines continue to use the legacy non-streams subdev ops unchanged. Signed-off-by: Gjorgji Rosikopulos Tested-by: Hitesh Patel --- drivers/media/platform/qcom/camss/camss-vfe.c | 119 +++++++++++++++++- drivers/media/platform/qcom/camss/camss-vfe.h | 1 + 2 files changed, 118 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/= platform/qcom/camss/camss-vfe.c index 319d19158988..84da6600cf99 100644 --- a/drivers/media/platform/qcom/camss/camss-vfe.c +++ b/drivers/media/platform/qcom/camss/camss-vfe.c @@ -1993,6 +1993,104 @@ static const struct v4l2_subdev_internal_ops vfe_v4= l2_internal_ops =3D { .open =3D vfe_init_formats, }; =20 +/* + * vfe_pad_enable_streams - Enable one or more streams on the source pad + * @sd: VFE V4L2 subdevice + * @state: V4L2 subdevice state + * @pad: Pad number + * @streams_mask: Bitmask of streams to enable + * + * VFE lines are inherently single-consumer (vfe_link_setup() enforces one + * link per pad, and each line exposes only the implicit stream 0 of a + * non-streams subdev), so no local refcount is needed here. + * + * Return 0 on success or a negative error code otherwise + */ +static int vfe_pad_enable_streams(struct v4l2_subdev *sd, struct v4l2_subd= ev_state *state, + u32 pad, u64 streams_mask) +{ + struct vfe_line *line =3D v4l2_get_subdevdata(sd); + struct vfe_device *vfe =3D to_vfe(line); + struct media_pad *sink_pad =3D &line->pads[MSM_VFE_PAD_SINK]; + struct media_pad *remote_pad =3D media_pad_remote_pad_first(sink_pad); + int ret; + + line->output.state =3D VFE_OUTPUT_RESERVED; + ret =3D vfe->res->hw_ops->vfe_enable(line); + if (ret) + return ret; + + if (remote_pad) { + ret =3D v4l2_subdev_enable_streams(media_entity_to_v4l2_subdev(remote_pa= d->entity), + remote_pad->index, BIT_ULL(0)); + if (ret) { + vfe->res->hw_ops->vfe_disable(line); + return ret; + } + } + + return 0; +} + +/* + * vfe_pad_disable_streams - Disable one or more streams on the source pad + * @sd: VFE V4L2 subdevice + * @state: V4L2 subdevice state + * @pad: Pad number + * @streams_mask: Bitmask of streams to disable + * + * Local and remote teardown are both attempted unconditionally on a + * best-effort basis, matching the convention used by other streams-API + * drivers (e.g. dw-mipi-csi2rx, ds90ub960, cdns-csi2rx): a failure on + * either side is logged and does not skip the other side's teardown, since + * there is no way to roll back a partially disabled pipeline. If the local + * disable also failed, its error takes precedence in the return value. + * + * Return 0 on success or a negative error code otherwise + */ +static int vfe_pad_disable_streams(struct v4l2_subdev *sd, struct v4l2_sub= dev_state *state, + u32 pad, u64 streams_mask) +{ + struct vfe_line *line =3D v4l2_get_subdevdata(sd); + struct vfe_device *vfe =3D to_vfe(line); + struct media_pad *sink_pad =3D &line->pads[MSM_VFE_PAD_SINK]; + struct media_pad *remote_pad =3D media_pad_remote_pad_first(sink_pad); + int ret; + + ret =3D vfe->res->hw_ops->vfe_disable(line); + + if (remote_pad) { + struct v4l2_subdev *remote_sd =3D media_entity_to_v4l2_subdev(remote_pad= ->entity); + int remote_ret; + + remote_ret =3D v4l2_subdev_disable_streams(remote_sd, remote_pad->index,= BIT_ULL(0)); + if (remote_ret) { + dev_err(vfe->camss->dev, + "Failed to disable stream on remote pad: %d\n", remote_ret); + if (!ret) + ret =3D remote_ret; + } + } + + return ret; +} + +static const struct v4l2_subdev_pad_ops vfe_streams_pad_ops =3D { + .enum_mbus_code =3D vfe_enum_mbus_code, + .enum_frame_size =3D vfe_enum_frame_size, + .get_fmt =3D vfe_get_format, + .set_fmt =3D vfe_set_format, + .get_selection =3D vfe_get_selection, + .set_selection =3D vfe_set_selection, + .enable_streams =3D vfe_pad_enable_streams, + .disable_streams =3D vfe_pad_disable_streams, +}; + +static const struct v4l2_subdev_ops vfe_streams_v4l2_ops =3D { + .core =3D &vfe_core_ops, + .pad =3D &vfe_streams_pad_ops, +}; + static const struct media_entity_operations vfe_media_ops =3D { .link_setup =3D vfe_link_setup, .link_validate =3D v4l2_subdev_link_validate, @@ -2070,7 +2168,8 @@ int msm_vfe_register_entities(struct vfe_device *vfe, pads =3D vfe->line[i].pads; video_out =3D &vfe->line[i].video_out; =20 - v4l2_subdev_init(sd, &vfe_v4l2_ops); + v4l2_subdev_init(sd, vfe->res->streams_enable ? &vfe_streams_v4l2_ops + : &vfe_v4l2_ops); sd->internal_ops =3D &vfe_v4l2_internal_ops; sd->flags |=3D V4L2_SUBDEV_FL_HAS_DEVNODE; if (i =3D=3D VFE_LINE_PIX && vfe->res->is_lite =3D=3D false) @@ -2100,10 +2199,18 @@ int msm_vfe_register_entities(struct vfe_device *vf= e, goto error_init; } =20 + if (vfe->res->streams_enable) { + ret =3D v4l2_subdev_init_finalize(sd); + if (ret) { + dev_err(dev, "Failed to finalize subdev: %d\n", ret); + goto error_reg_subdev; + } + } + ret =3D v4l2_device_register_subdev(v4l2_dev, sd); if (ret < 0) { dev_err(dev, "Failed to register subdev: %d\n", ret); - goto error_reg_subdev; + goto error_subdev_cleanup; } =20 video_out->ops =3D &vfe->video_ops; @@ -2147,6 +2254,10 @@ int msm_vfe_register_entities(struct vfe_device *vfe, error_reg_video: v4l2_device_unregister_subdev(sd); =20 +error_subdev_cleanup: + if (vfe->res->streams_enable) + v4l2_subdev_cleanup(sd); + error_reg_subdev: media_entity_cleanup(&sd->entity); =20 @@ -2157,6 +2268,8 @@ int msm_vfe_register_entities(struct vfe_device *vfe, =20 msm_video_unregister(video_out); v4l2_device_unregister_subdev(sd); + if (vfe->res->streams_enable) + v4l2_subdev_cleanup(sd); media_entity_cleanup(&sd->entity); } =20 @@ -2180,6 +2293,8 @@ void msm_vfe_unregister_entities(struct vfe_device *v= fe) =20 msm_video_unregister(video_out); v4l2_device_unregister_subdev(sd); + if (vfe->res->streams_enable) + v4l2_subdev_cleanup(sd); media_entity_cleanup(&sd->entity); } } diff --git a/drivers/media/platform/qcom/camss/camss-vfe.h b/drivers/media/= platform/qcom/camss/camss-vfe.h index ae9dad353a37..d1c54a516ba1 100644 --- a/drivers/media/platform/qcom/camss/camss-vfe.h +++ b/drivers/media/platform/qcom/camss/camss-vfe.h @@ -138,6 +138,7 @@ struct vfe_subdev_resources { char *pd_name; bool has_vbif; char *vbif_name; + bool streams_enable; const struct vfe_hw_ops *hw_ops; const struct camss_formats *formats_rdi; const struct camss_formats *formats_pix; --=20 2.34.1 From nobody Fri Sep 25 14:32:37 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 22DF53F5BC5 for ; Fri, 11 Sep 2026 06:22:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789107766; cv=none; b=ahKujQJ8XRnPD1xcqYy7eLADbjOrmS+odsIT1uEWe+Nk6nIPqbVyQOhZ/YPW821w5SEaXnWC+A6cjmjp62C/MU5KSVGebTvjeCHgOw0ee767hYfTHKAeLjS1R3MLdEIOy68ueTMxYV3wVelanP89fTLOE9XP4tN+u5T2mgXPUtw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789107766; c=relaxed/simple; bh=P4yejfQoXWEs5WCIo/uSBIMrvzn27wZhAYZfF4/HElo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pSUscySnUadUNmtkYuJ5KsaN0oFD8LNfICXMZKA59DPrcc9BRoycQY5HN5HSwMXZba5f1/f/+8BNN41HLbceenZ9aJi0ICEJ6dRsR2PE2saT4FOLiwt2hfYBINWLONXOpDfaaCgr00PftfiGt8D+3Of0A2ZYg1BZ+4fleytxFHU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=fail (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=lx/aQ248 reason="signature verification failed"; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="lx/aQ248" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68B5NoL1099785 for ; Fri, 11 Sep 2026 06:22:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=PfojdtiyVIg osMA6X+iHeGMye0+VmyZKBg4VC9xW9VE=; b=lx/aQ2483xB8JntsTK70Vs6ZrBC Ho7PlKVSau9VG6ZB5ObLmWTvREKVo7fqxc5wwNr17ViJA/HTwOKMIwAWek7IPZrX CzbBk18RbINJmHKM9HoqFDegr7b/4gAtkvh3d2Dg+6d/uEyPEQbgdLwlF5Qkew1y Ojh9md1zwZRU06fDNyuRAsMMTMKfmS2n3OzYL1MbDClbunUbltPudVXN4dDtnwau /l+bP1PFp+070JNGcLT4zvS6GdU9gEq4f3VjDVAHajRoWsXndaq5Lqfi4+OC4P9U braS7XiYZZkuB59ZYJRwamjWzo5sEXFIdZN54aqKP1Cgy7pOA4dh8aEGygg== Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gmbf8g786-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 11 Sep 2026 06:22:32 +0000 (GMT) Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-939d6c515deso90517285a.3 for ; Thu, 10 Sep 2026 23:22:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789107751; x=1789712551; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=PfojdtiyVIgosMA6X+iHeGMye0+VmyZKBg4VC9xW9VE=; b=hkl09waGP4xXrGBiy8ZrOMu5zpZV5saOgsuEP2ACr7EykzXdYbKhIaZAqessjU93rU 70EomqZ6QfecA3bNbV3XwlKmxaCzoRn4indJi8+wJKaYoxriYi/1DKeHGnuwGGT11TSQ i+bBCXG6ryJkawwnFd2daafIxIRI8rJstF3VJVRXo8TdZwp1TU0YZ+CeDMfAuWLH0leh WZ+XhcR/aiafMgbt9WTBOV6znYvbC9aQbAwta798B7nOPAgIA+qBB9iK3LGVz/psiRdh qO2ZPagSrFcTKA2Q8IS7Uho9UFX5g9WxDfN/rwFhM7tijpA6uEXkkwj7v4RLr/kXQOih VugA== X-Forwarded-Encrypted: i=1; AKwUvBwPKjCi924rZSPzbUzTX4cQASJA9TUGMmAaO4H/scjko6FekUsQgPSJe1HYzKYR1MVhzFn45uMNKy5aMSg=@vger.kernel.org X-Gm-Message-State: AFuF++ng96lRg4YD2c3ahXpnZkAzzu6J3A1x/M3xnkTZyS0nvHJdDnvP oGtX4vHdrPH2YxrF6NnPQtfNhSQjhlvtqVkNOkZX9fdSZ5pgzQW5i+6Dq0nFXXx1nMlah6hRWIV iNXtwPcma92EAidHWHpSMtNp/+AHFz0Zgqb1D7gEY9AMaEKI+RuNyPV+Jgx1yQgAyRDI= X-Gm-Gg: AYBFou0C49NZ6/wXfwwhTPwkoiS+ZxiK9rXea6afMXNApJynMotf8WRkD8HggB6M0k7 zheg5ja0dhMS+6DDWkcycSB03tTnY1ByJ3mVUoL6z7v/+gm0LZZSGB7niGhfp2n5YLX7gQplxJv dlJwnasIOuFNovwt+doLaTNs4PPMYhtMKD0pLEqxb37TTSGdw2f4XBDNNCX03H9DNdY+/9Mexzo /tuX/onWWpxdvZ3z4U27YctUKHF1NjzApqn6OGyB7wz+Indp152FHfECyM5lbAEmJCwmWAAwz8E v0OyKKPXqPoCtI8OJbkyKRLepdMH9OyNrRlxklRJ8MhGkTivuNsUGUcmGbI= X-Received: by 2002:a05:620a:a0cc:10b0:939:f27c:7433 with SMTP id af79cd13be357-939f27c802bmr47740485a.50.1789107751001; Thu, 10 Sep 2026 23:22:31 -0700 (PDT) X-Received: by 2002:a05:620a:a0cc:10b0:939:f27c:7433 with SMTP id af79cd13be357-939f27c802bmr47738285a.50.1789107750457; Thu, 10 Sep 2026 23:22:30 -0700 (PDT) Received: from lin-0843.qualcomm.com ([212.136.9.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-486eb33ea60sm3681969f8f.17.2026.09.10.23.22.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2026 23:22:29 -0700 (PDT) From: Gjorgji.Rosikopulos.gjorgji.rosikopulos@oss.qualcomm.com To: Bryan O'Donoghue , Mauro Carvalho Chehab Cc: Vladimir Zapolskiy , Loic Poulain , Dmitry Baryshkov , Atanas Filipov , Jigarkumar Zala , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Gjorgji Rosikopulos Subject: [PATCH 7/8] media: qcom: camss: add streams API support in camss-video Date: Fri, 11 Sep 2026 09:22:12 +0300 Message-Id: <20260911062213.195007-8-gjorgji.rosikopulos@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260911062213.195007-1-gjorgji.rosikopulos@oss.qualcomm.com> References: <20260911062213.195007-1-gjorgji.rosikopulos@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: yYWkSZvN9ZlGt6rByhOuZtLHnm0gd-mY X-Proofpoint-ORIG-GUID: yYWkSZvN9ZlGt6rByhOuZtLHnm0gd-mY X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTExMDA4NiBTYWx0ZWRfX+JkENG5/n0Cu n0IvKHg4BOlXiBqtaA1/V6olr+9mHPQR56ncO2U4nXVYFnNmR+fQpwcbBQMZACjfmD0vYJCRvr5 wUyJKaGdRKZl9VhHehOdSmzBpCuExvPiYwhGM/pLjJgfswkWzUCT5M8HUKPUEcZpZs/g+LrGLNi C3c4zw+bY551CKk+Cf5X52LUxZc7UW4t7Kip8vg20ol68L72ftyEqjejhJleV4c3L6+mR6GBebJ ekpeUYme3r/grLXEpLMIvhQ8dd5zYIHKwStODdfBlCzm+ixi8Fz3MpILLsjyIGspWo/9c6itarN Cd8IKb5ScA49AsuSkOd0gp7V6HXjtgi1Gr8V2huEAQy8UMdLR03b85jQHOClfVaSaksnzot5I4o f9nkzq/zmSwRbvnH14vFoYOpNV9NOojXQNC2iroZLdHkcHkl/NGljfu6CIDyyAvrbA8kcu/Eoya NMkk7JH9LjGHLrRIjKg== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTExMDA4NiBTYWx0ZWRfX/2hVtgDJ8YyA gFBXISoHWirJPptRIuGaWtTDpmqwjSvTNBmDc4n2CwGSJuusasuRB/qrKQfvTlIq64UqrE9DC2r sqgWA7gxUpfFDZ8p7trhIXZHGnQF8ZE= X-Authority-Analysis: v=2.4 cv=UJFIjyfy c=1 sm=1 tr=0 ts=6aa39e28 cx=c_pps a=HLyN3IcIa5EE8TELMZ618Q==:117 a=dNlqnMcrdpbb+gQrTujlOQ==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=EUspDBNiAAAA:8 a=KYIyY8g0vu4ecJsuFiIA:9 a=bTQJ7kPSJx9SKPbeHEYW:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-11_02,2026-09-09_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 phishscore=0 bulkscore=0 spamscore=0 adultscore=0 malwarescore=0 suspectscore=0 impostorscore=0 clxscore=1015 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609110086 Content-Type: text/plain; charset="utf-8" From: Gjorgji Rosikopulos Generalize the video device pipeline walk to be streams-API-aware: when a directly-connected subdev supports enable_streams/ disable_streams, use it; otherwise fall back to the existing legacy start/stop path, which walks the pipeline one subdev at a time via .s_stream(), unchanged. video_stop_streaming() must always call video_device_pipeline_stop() and flush_buffers(), regardless of whether the disable path succeeded: vb2 requires stop_streaming() to return all buffers, and a successful pipeline_alloc_start() must always be matched by a pipeline_stop(). Make the legacy fallback branch match the streams-API branch by logging a failure instead of returning early on it. Signed-off-by: Gjorgji Rosikopulos Tested-by: Hitesh Patel --- .../media/platform/qcom/camss/camss-video.c | 119 ++++++++++++++---- 1 file changed, 94 insertions(+), 25 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss-video.c b/drivers/medi= a/platform/qcom/camss/camss-video.c index 0852eb6f1315..7f7212996c4a 100644 --- a/drivers/media/platform/qcom/camss/camss-video.c +++ b/drivers/media/platform/qcom/camss/camss-video.c @@ -249,26 +249,27 @@ static int video_prepare_streaming(struct vb2_queue *= q) return ret; } =20 -static int video_start_streaming(struct vb2_queue *q, unsigned int count) +/* + * video_start_streaming_legacy - Walk the whole subdev chain and enable + * streaming via .s_stream() + * @video: Video device + * @sink_pad: Video device's own (single) pad + * + * Fallback used when the subdev directly connected to @sink_pad has no + * .enable_streams op. Mirrors the pre-streams-API pipeline walk: each + * subdev's pad 0 is assumed to be its sink pad, and streaming is started + * one subdev at a time via .s_stream() rather than the streams API. + * + * Return 0 on success or a negative error code otherwise + */ +static int video_start_streaming_legacy(struct camss_video *video, + struct media_pad *sink_pad) { - struct camss_video *video =3D vb2_get_drv_priv(q); - struct video_device *vdev =3D &video->vdev; - struct media_entity *entity; + struct media_entity *entity =3D sink_pad->entity; struct media_pad *pad; struct v4l2_subdev *subdev; int ret; =20 - ret =3D video_device_pipeline_alloc_start(vdev); - if (ret < 0) { - dev_err(video->camss->dev, "Failed to start media pipeline: %d\n", ret); - goto flush_buffers; - } - - ret =3D video_check_format(video); - if (ret < 0) - goto error; - - entity =3D &vdev->entity; while (1) { pad =3D &entity->pads[0]; if (!(pad->flags & MEDIA_PAD_FL_SINK)) @@ -283,6 +284,42 @@ static int video_start_streaming(struct vb2_queue *q, = unsigned int count) =20 ret =3D v4l2_subdev_call(subdev, video, s_stream, 1); if (ret < 0 && ret !=3D -ENOIOCTLCMD) + return ret; + } + + return 0; +} + +static int video_start_streaming(struct vb2_queue *q, unsigned int count) +{ + struct camss_video *video =3D vb2_get_drv_priv(q); + struct video_device *vdev =3D &video->vdev; + struct media_pad *sink_pad =3D &vdev->entity.pads[0]; + struct media_pad *src_pad; + struct v4l2_subdev *subdev =3D NULL; + int ret; + + ret =3D video_device_pipeline_alloc_start(vdev); + if (ret < 0) { + dev_err(video->camss->dev, "Failed to start media pipeline: %d\n", ret); + goto flush_buffers; + } + + ret =3D video_check_format(video); + if (ret < 0) + goto error; + + src_pad =3D media_pad_remote_pad_first(sink_pad); + if (src_pad && is_media_entity_v4l2_subdev(src_pad->entity)) + subdev =3D media_entity_to_v4l2_subdev(src_pad->entity); + + if (subdev && v4l2_subdev_has_op(subdev, pad, enable_streams)) { + ret =3D v4l2_subdev_enable_streams(subdev, src_pad->index, BIT_ULL(0)); + if (ret < 0) + goto error; + } else { + ret =3D video_start_streaming_legacy(video, sink_pad); + if (ret < 0) goto error; } =20 @@ -297,16 +334,27 @@ static int video_start_streaming(struct vb2_queue *q,= unsigned int count) return ret; } =20 -static void video_stop_streaming(struct vb2_queue *q) +/* + * video_stop_streaming_legacy - Walk the whole subdev chain and disable + * streaming via .s_stream() + * @video: Video device + * @sink_pad: Video device's own (single) pad + * + * Fallback used when the subdev directly connected to @sink_pad has no + * .disable_streams op. Mirrors the pre-streams-API pipeline walk: each + * subdev's pad 0 is assumed to be its sink pad, and streaming is stopped + * one subdev at a time via .s_stream() rather than the streams API. + * + * Return 0 on success or a negative error code otherwise + */ +static int video_stop_streaming_legacy(struct camss_video *video, + struct media_pad *sink_pad) { - struct camss_video *video =3D vb2_get_drv_priv(q); - struct video_device *vdev =3D &video->vdev; - struct media_entity *entity; + struct media_entity *entity =3D sink_pad->entity; struct media_pad *pad; struct v4l2_subdev *subdev; int ret; =20 - entity =3D &vdev->entity; while (1) { pad =3D &entity->pads[0]; if (!(pad->flags & MEDIA_PAD_FL_SINK)) @@ -320,13 +368,34 @@ static void video_stop_streaming(struct vb2_queue *q) subdev =3D media_entity_to_v4l2_subdev(entity); =20 ret =3D v4l2_subdev_call(subdev, video, s_stream, 0); - - if (ret) { - dev_err(video->camss->dev, "Video pipeline stop failed: %d\n", ret); - return; - } + if (ret) + return ret; } =20 + return 0; +} + +static void video_stop_streaming(struct vb2_queue *q) +{ + struct camss_video *video =3D vb2_get_drv_priv(q); + struct video_device *vdev =3D &video->vdev; + struct media_pad *sink_pad =3D &vdev->entity.pads[0]; + struct media_pad *src_pad; + struct v4l2_subdev *subdev =3D NULL; + int ret; + + src_pad =3D media_pad_remote_pad_first(sink_pad); + if (src_pad && is_media_entity_v4l2_subdev(src_pad->entity)) + subdev =3D media_entity_to_v4l2_subdev(src_pad->entity); + + if (subdev && v4l2_subdev_has_op(subdev, pad, disable_streams)) + ret =3D v4l2_subdev_disable_streams(subdev, src_pad->index, BIT_ULL(0)); + else + ret =3D video_stop_streaming_legacy(video, sink_pad); + + if (ret) + dev_err(video->camss->dev, "Video pipeline stop failed: %d\n", ret); + video_device_pipeline_stop(vdev); =20 video->ops->flush_buffers(video, VB2_BUF_STATE_ERROR); --=20 2.34.1 From nobody Fri Sep 25 14:32:37 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 C2A593F9F47 for ; Fri, 11 Sep 2026 06:22:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789107759; cv=none; b=uhbscSKF0aNJJjBESdj/SkzYfxidVCQM2cLnt9Nk1IoGv7RcZDidfyMV9QvTK2esfwC5l7T8nUwLRoSW0rophXghvlHEILDOBaGlqZMAFr3RfdZzj0bTHjmvrhJRtEeBJJwGeuegvgUA8akcbPyiMPw3siPJZChgqqv1qjvx33s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789107759; c=relaxed/simple; bh=0L0JCT4m4SJmuTDQ+ialCn/oDk1pcYctuSrLfXdVlfk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=mq964dRS9H2dvqrTGEtrvtovrSBt02a0yG6pDnAUFThFud99zUf/CiYjCMPxPdajUTr0aB8TzL6SWj34SNPqgrx40CN+mtA54xyaIZo/AQItIx2uO/DCvY6FwkCuaNkCJ1id+UW4l28WXbDyp1XlmXVDIP3nxHhepQBkpgeojHE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=fail (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=GGCvurTc reason="signature verification failed"; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="GGCvurTc" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68B4vQsf1930508 for ; Fri, 11 Sep 2026 06:22:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=SNjbE1OBTi0 QsyaZe/ehtUm/QCb8UHhqjcRZksbd9v0=; b=GGCvurTcTnGquoC0xoezhw7uEM9 mZubqQOY/NhAVKh3U+aAmaYpk3hXhjTPzVZlRgX5dHF4/dWDiphqEj4F/pc8sTEj P67CdKWTakIITN428ir1+Am42pSaN+eeksl4jGjWzdGkzBkisGszukqCv13hr4+P vB3C/qdaUlFFwcDJ1PBelex0v2yvRUWasOrANgNzu5fSaF3kIfBU7mpR7JgLaekv pcylbxHfHTULfGvJnbq7FfzdCJXVIaga3g6mMa/I0SI4KG4YPEf6e1zCbxSxBdNJ i2ZFWFm6Duw4QgdqRU8Rbm6S36QmozLGK/+sYnqyLNphu97LQGiQPkgiJaQ== Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gm7uch0fx-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 11 Sep 2026 06:22:33 +0000 (GMT) Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-92e53b8a302so102519685a.1 for ; Thu, 10 Sep 2026 23:22:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789107752; x=1789712552; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=SNjbE1OBTi0QsyaZe/ehtUm/QCb8UHhqjcRZksbd9v0=; b=AYEO07LB351jAmz9GBZ0YTLF80BIFTB+eoDn+gaCq8TWdhamSEbxiBP50FrblljNzt g9g6080OmU6ECDzzkzdZ3PhzFMeLmzMazhlFlk0wWiHf2tCnfdeGzBkUntqoKXBjS+7J kFkVyahOOvZn0yt3YrwfZLrzJ3Ukzr7jE0/Fh8UEZcBQS64JrvSiOjg1Iz68hMduAQ9a QenltC2I+ntIF8qRDz+z6GzJb35RdL+zuOCW27Cz7M38DErpdCvzjM8aoTALXhF7Ye2q tWwiXHOJq2+X/5H019OPmV4UvJMmLWiMc0KmWEqjOmxXzHX20Kx6Lkxvk8PJtORHbfpR NYTg== X-Forwarded-Encrypted: i=1; AKwUvBwacMRRNfzOGxblgt9VEOh5u2rl8zCiBILfu1FluoAcT+7DcUHIOB6WkwXywdOicQdHE7WRIFerJMZhl2U=@vger.kernel.org X-Gm-Message-State: AFuF++nozjyY8tAD0IszXi4vP9IYju9/n7OUXX5cpTMNKvFGN9n5IEiA DJxaYDXOAg07O6iF2EVJg/n6VtVnzCnuZuvSFTu8IIpM/CyHj3StGvseA1pIowkKWEqX/v4XwkV JZvwOQsgGYmdnOud0wUG3+qe3+AX54R4RAJBburAU4l6cjp0nwatha22rmsYYM1qjdYA= X-Gm-Gg: AYBFou1+PWAHI9g2qJSicQMOe1wz4GFwtAQU3M1BJdZwgKA4YMpbo6fRODivtrRvR/m GOqB09p5Jefv5GnBThjPeZ/dH7EDLn1I3a4ZPvFja+zlRRrctIoonkM5TKMeRACmxVadotGVPfF eSmdaz61OmaitQzDWA8mprwd6ohvTfNiRW4JpZNqhn0grPVJ6sagtqfNlFXNdm8uHeUwbBBy7KE woR9oAVa8xmlUyF3Mr/ntI3GYlEqyvcedb2p+zUtVa/BLhed5USKRuEWSu6d30mB1Mvj6T8TRhI 6Igm/5d0u6Z/07oWRA3cON982rWHT3WO3ODLrg/KEjreGs+vqJd2wBKOlPE= X-Received: by 2002:a05:620a:6f0d:b0:939:a199:45b4 with SMTP id af79cd13be357-939ea195c50mr353479185a.39.1789107752602; Thu, 10 Sep 2026 23:22:32 -0700 (PDT) X-Received: by 2002:a05:620a:6f0d:b0:939:a199:45b4 with SMTP id af79cd13be357-939ea195c50mr353475685a.39.1789107752160; Thu, 10 Sep 2026 23:22:32 -0700 (PDT) Received: from lin-0843.qualcomm.com ([212.136.9.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-486eb33ea60sm3681969f8f.17.2026.09.10.23.22.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2026 23:22:31 -0700 (PDT) From: Gjorgji.Rosikopulos.gjorgji.rosikopulos@oss.qualcomm.com To: Bryan O'Donoghue , Mauro Carvalho Chehab Cc: Vladimir Zapolskiy , Loic Poulain , Dmitry Baryshkov , Atanas Filipov , Jigarkumar Zala , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Gjorgji Rosikopulos Subject: [PATCH 8/8] media: qcom: camss: enable streams API on SM8250 Date: Fri, 11 Sep 2026 09:22:13 +0300 Message-Id: <20260911062213.195007-9-gjorgji.rosikopulos@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260911062213.195007-1-gjorgji.rosikopulos@oss.qualcomm.com> References: <20260911062213.195007-1-gjorgji.rosikopulos@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Authority-Analysis: v=2.4 cv=O4asLx9W c=1 sm=1 tr=0 ts=6aa39e29 cx=c_pps a=hnmNkyzTK/kJ09Xio7VxxA==:117 a=dNlqnMcrdpbb+gQrTujlOQ==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=EUspDBNiAAAA:8 a=HJ73pzCofNdhR2KX5BsA:9 a=PEH46H7Ffwr30OY-TuGO:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTExMDA4NiBTYWx0ZWRfX+U/g9Yomwu4q /wLViU2hoIfmqr3ohNlP+xCKJ8Y3vBwqLizw7e6UusfQG5dJSW/lst0zHovpEVdX6DvNyJtYu+C THNRICkUhsuwP4pUa0GhmNFrAGTEnD8x9PiEKbijmUoK18HcJupouNrg7JraySp2J+KzPKlUcQk 51HeEga1wzIK4Ke4hxD/+SSUqxLWOdZ7B7D59TLXcm6XOYrDmCVZvubCPWFUVGC3jsLIlUk2Zgw aftYDO2vFEwPebxe/BleGkvonsKG/sALnxEzGl1F6XKJlJKcxJcHEMBVOj+GHYjbFd3hu1ecO/L ME3e9rEQTjFmR3uoutMnW0LSLEyLNdCUY611GqkmOc6HE33uOkZ8/ZPlUYlTotJ2chgeKIh5q9p 80FRA6rHu0UI2118dulJ2LWljLX+yRcWVTMYKZy9pn2ixQTqqdDV77141NOZlnXm5CPR4dL61BR /cHwgNSBWWhtQbSecVQ== X-Proofpoint-GUID: _-ItvJqHaztYt3gcp0Wjrn7Odx8MKbeD X-Proofpoint-ORIG-GUID: _-ItvJqHaztYt3gcp0Wjrn7Odx8MKbeD X-Proofpoint-Spam-Info: AW1haW4tMjYwOTExMDA4NiBTYWx0ZWRfXwbqU/hFwtcec 6WPy182VlpyovJx54bsf0Hb2UU+BMLR31/+npm49IsNDQSkdJyZxBu05kVogrcAwcfXg0/opWEl GtQNoElD3alX5MpOt76kSRIREM588C0= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-11_02,2026-09-09_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 clxscore=1015 priorityscore=1501 suspectscore=0 impostorscore=0 lowpriorityscore=0 spamscore=0 adultscore=0 malwarescore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609110086 Content-Type: text/plain; charset="utf-8" From: Gjorgji Rosikopulos Now that CSIPHY, CSID, and VFE support the V4L2 subdev streams API, and CSID-to-VFE linking is fixed to the correct 1:1 pairing, switch SM8250 over: set streams_enable on every CSIPHY, CSID, and VFE line resource entry in csiphy_res_8250[], csid_res_8250[], and vfe_res_8250[]. No other platform is affected; they keep using the legacy non-streams subdev ops. Signed-off-by: Gjorgji Rosikopulos Tested-by: Hitesh Patel --- drivers/media/platform/qcom/camss/camss.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/plat= form/qcom/camss/camss.c index 1bb22cd23c5e..9bfb0290395b 100644 --- a/drivers/media/platform/qcom/camss/camss.c +++ b/drivers/media/platform/qcom/camss/camss.c @@ -1964,6 +1964,7 @@ static const struct camss_subdev_resources csiphy_res= _8250[] =3D { .interrupt =3D { "csiphy0" }, .csiphy =3D { .id =3D 0, + .streams_enable =3D true, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sdm845 } @@ -1981,6 +1982,7 @@ static const struct camss_subdev_resources csiphy_res= _8250[] =3D { .interrupt =3D { "csiphy1" }, .csiphy =3D { .id =3D 1, + .streams_enable =3D true, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sdm845 } @@ -1998,6 +2000,7 @@ static const struct camss_subdev_resources csiphy_res= _8250[] =3D { .interrupt =3D { "csiphy2" }, .csiphy =3D { .id =3D 2, + .streams_enable =3D true, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sdm845 } @@ -2015,6 +2018,7 @@ static const struct camss_subdev_resources csiphy_res= _8250[] =3D { .interrupt =3D { "csiphy3" }, .csiphy =3D { .id =3D 3, + .streams_enable =3D true, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sdm845 } @@ -2032,6 +2036,7 @@ static const struct camss_subdev_resources csiphy_res= _8250[] =3D { .interrupt =3D { "csiphy4" }, .csiphy =3D { .id =3D 4, + .streams_enable =3D true, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sdm845 } @@ -2049,6 +2054,7 @@ static const struct camss_subdev_resources csiphy_res= _8250[] =3D { .interrupt =3D { "csiphy5" }, .csiphy =3D { .id =3D 5, + .streams_enable =3D true, .hw_ops =3D &csiphy_ops_3ph_1_0, .formats =3D &csiphy_formats_sdm845 } @@ -2068,6 +2074,7 @@ static const struct camss_subdev_resources csid_res_8= 250[] =3D { .reg =3D { "csid0" }, .interrupt =3D { "csid0" }, .csid =3D { + .streams_enable =3D true, .hw_ops =3D &csid_ops_gen2, .parent_dev_ops =3D &vfe_parent_dev_ops, .formats =3D &csid_formats_gen2 @@ -2085,6 +2092,7 @@ static const struct camss_subdev_resources csid_res_8= 250[] =3D { .reg =3D { "csid1" }, .interrupt =3D { "csid1" }, .csid =3D { + .streams_enable =3D true, .hw_ops =3D &csid_ops_gen2, .parent_dev_ops =3D &vfe_parent_dev_ops, .formats =3D &csid_formats_gen2 @@ -2102,6 +2110,7 @@ static const struct camss_subdev_resources csid_res_8= 250[] =3D { .interrupt =3D { "csid2" }, .csid =3D { .is_lite =3D true, + .streams_enable =3D true, .hw_ops =3D &csid_ops_gen2, .parent_dev_ops =3D &vfe_parent_dev_ops, .formats =3D &csid_formats_gen2 @@ -2119,6 +2128,7 @@ static const struct camss_subdev_resources csid_res_8= 250[] =3D { .interrupt =3D { "csid3" }, .csid =3D { .is_lite =3D true, + .streams_enable =3D true, .hw_ops =3D &csid_ops_gen2, .parent_dev_ops =3D &vfe_parent_dev_ops, .formats =3D &csid_formats_gen2 @@ -2148,6 +2158,7 @@ static const struct camss_subdev_resources vfe_res_82= 50[] =3D { .line_num =3D 3, .has_pd =3D true, .pd_name =3D "ife0", + .streams_enable =3D true, .hw_ops =3D &vfe_ops_480, .formats_rdi =3D &vfe_formats_rdi_845, .formats_pix =3D &vfe_formats_pix_845 @@ -2174,6 +2185,7 @@ static const struct camss_subdev_resources vfe_res_82= 50[] =3D { .line_num =3D 3, .has_pd =3D true, .pd_name =3D "ife1", + .streams_enable =3D true, .hw_ops =3D &vfe_ops_480, .formats_rdi =3D &vfe_formats_rdi_845, .formats_pix =3D &vfe_formats_pix_845 @@ -2198,6 +2210,7 @@ static const struct camss_subdev_resources vfe_res_82= 50[] =3D { .vfe =3D { .is_lite =3D true, .line_num =3D 4, + .streams_enable =3D true, .hw_ops =3D &vfe_ops_480, .formats_rdi =3D &vfe_formats_rdi_845, .formats_pix =3D &vfe_formats_pix_845 @@ -2222,6 +2235,7 @@ static const struct camss_subdev_resources vfe_res_82= 50[] =3D { .vfe =3D { .is_lite =3D true, .line_num =3D 4, + .streams_enable =3D true, .hw_ops =3D &vfe_ops_480, .formats_rdi =3D &vfe_formats_rdi_845, .formats_pix =3D &vfe_formats_pix_845 --=20 2.34.1