From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.47 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796252609; b=KiIAdUgNRWAJKn10oxMvgt8un5kiGoZDQp5TSB0NE1SiGyfTw8Ut5SYJZuZuslecbzIH ofcWO25ylpDG/oVjkkSy4XM/Fps9+rcgp2vJlNA5pC3SSsQai38rZIwwst9rYJElrsj6/ KSMJzwWTYcyXizsYZ6VrL7uTqsP1zw5QxEtEip2lG5/k1XWIZrs45RKAldZ6ThhghQ5be BlaUQlbr+/FVUGN9bzeE+KbJlYwip8ZsZXPVLuxULKe6lj4RUf/ov4oYqwXWpu3UgGriw 1VXZn3nw1zBVgKsaD/UDc80nSZAWXT7G/TVD5dGS8XVbm1fDRia8ZajBahC4XT9pG1Q== 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=MiL/IVFzRpXTclaKHfvNemGPtTvbiSPK4JK5hC8NsgTJQHoeDCElZAdCO2LYV7WXXrS7 EtoG06aYpM+KdLxx0hPCOZY0jP4bElZk4RStV1HeSvHKA6T+I4A6ibzPYxdstaG2ePdad V5C3bWE2qJuuJuQRc7tXv1YfkufjjxQmjoPTjaLjs7MA2yheS7M1IMq35cDDUeuzl1mMP MRY0Ipe3wfttprUQtREsn71IK85lGfmdrFr87/eaNqBwNvn2rr1Qu3q81iepE647yfAKW NQeYmoYrlBuor6//+GfQNMokVyPCZO3LbxJ7waEd/ra0i9HRxpt3pJO68w0UyvydZdA== 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.47 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (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 A1D66606A32D for ; Wed, 2 Dec 2026 23:03:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A1D66606A32D 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-f47.google.com with SMTP id ffacd0b85a97d-4c84abcb549so2676196f8f.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=SEP22lzJBJscSa+UtMBSP2d79BycIEfhQ55D8QTSM6QlaKaPr+dcMqmWFL47FcsQky si33oagwns1B4mZxFBQTnHVUuvqrV62vVwDnZY/WrTwahlxHnGKU3PW7Jd1EwEBU66DJ wCV3GrvJgkg49FDb7vgNe9uQtce4UyEV3MvB9+Oe5mKF9OueES6w5QKmDiME1uuBlhL5 BhiYZCdRPeq4U8lffJ99m8cT6PgfQ8Dy9nHMR3zq3/A6IMvLnXtIMbgs0xn/ke3Ce7tg Y9SLzbYzuojUTaOxpIIP2chJQMPxmC7wE6/gLq7930ClvDDmihCyRXenlkiLvZONSnjC IZPQ== X-Forwarded-Encrypted: i=1; AL+hErFzMWY8TMB5wQml/ZYs6fL7vssgCufuaz20gDSRCPqCGwzL82zUYakuByeIZbLV5bzU1SVAqAY=@vger.kernel.org X-Gm-Message-State: APuU4Z/1c7Ml+UsNBCtMqs7kLavudPMDATdDT8clU61TH3WYCqWyPDD7 AiwF+gcQfeAtZfYt5XfHcNtRAHGmtIKzfbRh+q6ZAh6hnTBUrQPD5BBH X-Gm-Gg: AZFdTZdb14VIlSYP/p8VYOlFt4AaLXwDiZdmVRKbS6IWEs27y3TlR1iZcvF62JhTVSP uJ6BBYUIMk4omfTOzi3Sx5Jfty2WJl2b3xMen0vEwr2z0M13jxS5jR/o8KiH6JTPhWkx3+NzDbg wJ+SN8Z9oWfqT3FR+vAHCaYowdFgXKc7khflJzp7ea88iRL3VTt6J86sQNxUWQl3oXpWs1/PNlF M/kpwFf3Zp1Olm7S6/VhAMhcHdz7B2L4q5Gf8OufhDgPin/cS7bNCLZ5gEio+iaszUX5okdK/8L 3T61xYmTikLm2UOFdJlKs3th6UDUnHV7ZiiR2eVAq17fPTxa7c4RyllI6LHYtQj/gsRO1QTKwNu ywWP9lDutW3EYQC91ygMScgvTHV/HQuLZOyyySwi51DsnW08BSXDIJdJ68pUsri1NZ1F6fAHFkc snPlMibpyeztnVnb08swnuvfqvawr6EXw/Vsfb2IxVtZRluBI9UqGHuZ1GOfsr+sK7Zq4l6SnZ3 zN986QnphPHqn5jC2cq63Caa0bh006zUYJoXcJkPL1A0OxyFHDbMCvysKW+l7KdvZSGAkWm088w iSW/pT0o822tTcGtKiSvno5qvFmsv0osn65Gn6nu 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: stable@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