From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.48 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796252609; b=HN8BGr6wSzgwe6yIqlPWDngELwE8KK8KXPZuUVGYLVkLOfXTkBRXJQcPV7cxmfyBqxBV RCY4E84KVRSVSAT5V/oC76NB5P1lajw9QA/6Et950vzPkoj3yk8510g9/FjYMc/olPG5Y iBDb/LcPmh/TFT1lOBfVlswGxebzKDc94rOlZ0XCWzytEM9iSaCRwztXYzLzhecnTbPK+ UI1IU6pY3s8kNHzAPNOxdcFXaMEaFudPZ+UTkXuOuQ2Vw8nI7/Q3QkPKM6k1y7URfP2jG 3Ky7qqPzJo9Zz448+yIHE/l7rYwjpbZoRzArlQJtCkp5+T19cScvGBXe+Hb40mhl8Sw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796252609; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=bJdYL3SnylmYD5eivxOY1+0vkQ24nkPlButNRUDGDOs=; b=UnY8PQbzvO2wBcGrbWwEIlEu0H2uK1XKv1e4OjE5C/9OtBRtS/+csmk2AnxTIjLN3Gi9 r04rsvcCX9IzTvG5dEbfv05BWeoQP2lvdT+hPVtdGtcp+P5gu926U/VO3NUDSwn//OqKq HrOI8ven41iQhJBx/zrxo88MkzgCOifuDkYfcAtKjEmcBk+gTrrpgr7etv8bUN/xrzeeu Zh+pzk2DmSu/JkAau/L6dIbYadU5qrb6BknuKjpkxLZt35DJH5+De6dO2CC8SjAfC2qy1 yZbOH+c6yEhsEVTxvZl38ARE9DkXwz0n7XDXd+vHnT58/wqvRWDt18G0Ll0+5i/DB9A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=oP7viA2s; arc=none smtp.remote-ip=209.85.221.48 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AAC7C606A330 for ; Wed, 2 Dec 2026 23:03:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org AAC7C606A330 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=oP7viA2s Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-4c84abcb549so2676195f8f.1 for ; Wed, 02 Dec 2026 15:03:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796252607; x=1796857407; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=bJdYL3SnylmYD5eivxOY1+0vkQ24nkPlButNRUDGDOs=; b=oP7viA2swDnVDKGxt2n+FlQVvYuD6p57FAQ0osXtY/hUR1lgrG6tBpN+NKJZIUT99o ZlnKTz1p6S5CsXm/J0F6w1XATCeSRkb0sbAfCN6WC+m+7M+Rqx/qI453VZUDYATHlT/H jlxAfgQRBc39jnkObYh2fCT6VrnVDhOQIKty33jwA3UNk82G74On9hP2T1BD1Qawzzi8 hBEKgErWjk2NAdKB8XgS/1SlBd6fQ23svviSlNjPcjPK8JMbtAPIRYXMAiOow0Vqh+Qp wJxTHi8tFLyy5cpVeJSfOL1nvRaLOMCISVKUe0pBHdIIHg/jXlbIHPQQyH8PH9MNL5HJ ucmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796252607; x=1796857407; h=content-transfer-encoding:mime-version: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=bJdYL3SnylmYD5eivxOY1+0vkQ24nkPlButNRUDGDOs=; b=FzXmaGYYcj/fUn0wVWCGR6GWMUblm9svnzA0i3fdnjL/kNMnR8XCNOPHhcGBy+SY2x +HtcAwa3SZfw1kBcRbCgZ4Pi9NWJF6/W4NpLVcnLzr+CXJ1yjQ+epeYLMKFRf7EICbSC m9HvR1IhNk3AvsBVQKJL0ejFX62trX+TeR9LxumJ54DBlVwacLwAoXTJhrn/aFFGCNuY 3JR7evJXLEv9OILiRamHW1tU0KIIK0xTt2Ryu1Ll3KAtte0JRGmZsjGKR2LHDPhvPQYA AfSY1kif3Bu4ZDOoltdEzSN6Az3j/4M7wyOg2F5MwQRK40r3p7S2phyAD3Dy9ge3WO4X M0Ww== X-Forwarded-Encrypted: i=1; AL+hErGGYrSIpLuF3rPC08Y+Htn9tngKuR4Tc7gNIb/3Vw0CZdM5azGNZ7VBcdZhYF/VOT9kOH6wM2X0RCdf3HY=@vger.kernel.org X-Gm-Message-State: APuU4Z8T7NSsjAu6Xeqk3ro0RmWh46geXp9l0U7Tuh+CZPi+NCVGYD1f C3EN463Xte9kWPUIe/jCyDZDm2HkHTQfTfUzLGCbWvf9zJ3J7t0RVYkI X-Gm-Gg: AZFdTZdK+Os9DV0CMOoPcTcE+R9hVttBTX8kqrdAMymDRCrRNVtzIJR9e5J7LPkNjoY 4hLMv2WVItMlzU33PA1y3UwnJNTq6XE2PZO0KodiSDmobqpeFqudAWgtmEysR+QCTr4N54PgAYg j2rM0FyLKfsR9Mj/o2w6/zZaUOMaZ/LuGoHrMnerXm0EZnVqcjZ8HNWlqR7Eyd5j/+K4yAOYNSQ XTbWTHRvjlqN9Eq8TFg2bSNAKep7Sc5WfBFMM6g91wEOyZ0OjxfdUA4ONJLfi0tsaoFMfKkH0i6 aQLF9Z9oVDwq6lPPDVBjwvHHsNMRHua2r3bSJduetONdRWcnSQJcl7+HLJnbjCQcfwATD/Ad1/O GuU4lz+5Ru06t1KtUW9RXSNMEVnJajSR1zey75OJcHw3QxUI6jO+TzLBm+8BRQnDMfwcXFm+/9y i9eiw9jE4jNh2lLj5yJtl0hHMQIl+/gGGK7AXYFIt8xAJVwClXzMpJU86RsOKN1XgyCJv5u7zjY EqsLA0GUrq8tBsCjJm0GEDwmcrJTEQMOtQ2DBYngcvsHmqSvIdSK6Mjbzq28jP4CGcGXbXdXnAV lKdG3k7xB6s9FvFRyabNu6FnXvvCKN5Jem+M4Fm3 X-Received: by 2002:a5d:5d85:0:b0:4aa:e105:381a with SMTP id ffacd0b85a97d-4abb58ec01dmr82102878f8f.51.1796252606964; Wed, 02 Dec 2026 15:03:26 -0800 (PST) Received: from unknown.m0rf30.ray ([2a02:b021:8011:256b:d13a:b0f2:c168:28e9]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-4ab658e2c8csm81180838f8f.2.2026.12.02.15.03.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 15:03:26 -0800 (PST) From: Gianluca Boiano To: Bryan O'Donoghue , Vladimir Zapolskiy , Loic Poulain , Mauro Carvalho Chehab , Sakari Ailus Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, phone-devel@vger.kernel.org, David Heidelberg , stable@vger.kernel.org, Gianluca Boiano Subject: [PATCH v2 0/5] media: qcom: camss, ccs: Sony IMX376 on SDM660 using the MIPI CCS driver Date: Thu, 3 Dec 2026 00:02:57 +0100 Message-ID: X-Mailer: git-send-email 2.56.1 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi, These make the Sony IMX376 work with the mainline MIPI CCS driver behind the Qualcomm CAMSS on SDM660. Nothing specific to the sensor is added to the driver: the DT node uses "mipi-ccs-1.1", and the manufacturer specific register settings come from CCS static data (sensors/sony,imx376.yaml, https://github.com/M0Rf30/ccs-static-data/pull/1, to be submitted to ccs-static-data). Tested on a Xiaomi Mi A2 (SDM660, rear IMX376, 4 lanes, link frequencies 500 and 864 MHz): - 2592x1940 (2x2 binned), 36 fps at 500 MHz - 5184x3880, 29 fps at 864 MHz - switching between the two repeatedly - cropping the pixel array (4096x3000 binned to 2048x1500) - the front IMX376 and the IMX486, which use dedicated drivers, still stream Patches: 1: CAMSS calls s_stream on every sub-device from the video node up to the sensor. For a sensor with several sub-devices (CCS has a pixel array, a binner and a scaler) that includes the pixel array, whose s_stream fails with -EINVAL as only the CSI-2 source pad can be enabled. Stop at the sub-device that is bound to CAMSS, as the other CSI-2 receiver drivers do (ipu3-cio2, rkisp1, ti-cal, ipu6, rcar-vin): that sub-device is responsible for starting what is upstream of it. This touches the loops that Qianhui Xu's "media: camss: video: factor pipeline stream on/off into a helper" also changes; I'm happy to rebase on top of it. 2: The link frequency and the pixel clock were looked up from the pixel array of a CCS sensor, whose pixel rate is not the one on the CSI-2 bus. Use the sub-device bound to CAMSS instead. 3, 4: Two CCS bugs found while doing the above, both regressions from the switch to sub-device active state: the format set on a sink pad is not stored, and the format of a source pad does not follow the crop rectangle. Link validation fails with -EPIPE for anything but the native size. 5: CCS static data can carry manufacturer register blocks conditional on sensor register values (rules); the driver parses them but never writes them. Apply the matching blocks at stream start. The IMX376 needs this for its full resolution mode, which uses different readout registers than the binned one. The pipeline is configured the usual way, from the pixel array to the source of the CSI-2 bus (here the scaler), setting the binning with the compose rectangle of the binner and then the size of the sink pad of the scaler: media-ctl -V '"ccs binner 2-001a":0[fmt:SRGGB12_1X12/5184x3880 compose:(0,0)/2592x1940]' media-ctl -V '"ccs scaler 2-001a":0[fmt:SRGGB12_1X12/2592x1940 crop:(0,0)/2592x1940 compose:(0,0)/2592x1940]' media-ctl -V '"ccs scaler 2-001a":1[fmt:SRGGB10_1X10/2592x1940]' Changes in v2: - 1/5: Inline the hostdata check in the stream on/off loops instead of a one-line helper (David). - Link to v1: https://lore.kernel.org/r/20261123-b4-ccs-imx376-v1-0-2b26850a6f11@gmail.com --- Gianluca Boiano (5): media: qcom: camss: Don't stream sub-devices upstream of the sensor media: qcom: camss: Look up link frequency from the sub-device on the CSI-2 link media: ccs: Store the format set on a sink pad media: ccs: Make the source pad format follow the crop rectangle media: ccs: Apply rule-based manufacturer register blocks at stream start drivers/media/i2c/ccs/ccs-core.c | 106 ++++++++++++++++-- .../media/platform/qcom/camss/camss-video.c | 11 ++ drivers/media/platform/qcom/camss/camss.c | 6 +- 3 files changed, 112 insertions(+), 11 deletions(-) base-commit: aa0f4c41d4870a18e65772a1817af16427200371 -- 2.56.1