From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.53 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796252609; b=OXJQAoFj64yuKFki1M0NQOc28nqm+fEyE0r0yfe+xaz5sI9GlirF8GK7W4RPQIjHY7L8 K49KR9BJWYtKwcrYPIP4VgW9207xazbEgk9af0NuP2c9SHIBwdccaqCfJYOTXU7spa/d/ KNHp9rkGhp4hmEc6C5sZQaW3u2S7spMtEgsGPQbcxSMtJR84lHNKT4n7gtmD5Wk1jvwt5 CRv+FfOVy+VyNEolQlVpIaqOnE3/I0sl0BNQB4tIaVolhr87riiGEjCi/jPY4aZcRRVwp QBJKPiXk8XR0eaRZcgzNAchECgGseeGcBcQmtGAhyk84eu1NhXpgdoVZhap/sg+rZRQ== 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-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=AfLu5YMgtI8cfOukAjntG8ApCzaBynD8qv/L3U4XCRrYZOrQXjJzw82UGBQEJZb3jwHI KL3kWZWVpqN/ib8TFy0I3tw8GnBxnxrj0JyImWabctf/UDju21xJZa0Pr5pZJlwyw0vJP vKxwif4WTvwA8vPB8YgY9DEN/DlVgB06KbolzxyCCeXAMlBDGewHC3QTEK/a8RPsR5nWl WLNdpBpZXq7ufek8BljAmQA2RFR69rCfvbKJhUWz4WRQ1KRErSRM/D9qX6YRowlkbLVPQ PvBsRsRG6yOJczJVuFeMXIDv2Vlk/DTbEMsbdIBy/JLlNr1PPxpcbh2s9fwO9tZX0xg== 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.53 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (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 BC05B606A333 for ; Wed, 2 Dec 2026 23:03:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BC05B606A333 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-f53.google.com with SMTP id ffacd0b85a97d-491846221ffso11934013f8f.3 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=OHH7UNs91hQ7KtstTpqjb6H0CCSVfAqG+3kK2vBeYOme7ociCjtG1MYlRHnXTmdwki ulUScPx/a/4WS2ZOrKUvdJXQDOdpeE4jeKzWhLG1tPwseWcohYvunNJ/pOGRtqr5jf3s PXkiZpmwK1nUcaxedkQd9z1MgeyP2c0g0saNR3Dm77yZTuL8DTd9pMmTHZIge5itaGps GepBSswYTX3RAtxmfWm/sul/oUYNPz0SQCaemqrq9Fp9oyKZS98OliMHCQyjXmMxdLqK 0DJGYc/MQg4dIveNaZH/ZxM1nTKQCFgWEu6j2Inge1387SqktYo2WdE58GovFTUAknhm v86Q== X-Gm-Message-State: APuU4Z/BMCSnpgPS88y/ozunIXbaeUaGC0+0RiVGjcyn20ZJVl4rm3b6 Nz8+Cq0p1k0oyi0NQV6PsMwJe+/wWcvWCKE+KifHf/TN+JDJdWlRvXrG X-Gm-Gg: AZFdTZcksjpLyMmVNs/CMSAOQ3KmEJIVbS8m2EnLNOe3XD8015MqV05Aw3BYNLnSnwu aaMSteaya1Z71TLAceUKjvv0zo0m/BzfTePI+JJZNNX9RKIUfeTamOeDhXoJDhxcsvU7mOv1TG4 34yWW8hYms69vDmMA8hkWFb9uooaDqGmndZSGIxD8cippH0h9QHUNpKrI78KyzNVlAaBQSZuS4a 0mLDDoswtJKyRAlEqXYTrusT7cY7VtZDQ/rtpXfceC6A5EWGuLuXxaXcFKtVCsN8fOK6CppfdFp TcJ0dNweREcN0GoPb2rIX1b7tx8/jHOZnVavC5P+YRhd15AXDFt1Jq9ChVN2k8FnZ5Qw/6x/ZqP ld49iIRfwjEa78+9qaCs1E1ZcI12Lt9+LHERfP+R5qUumQJLzyFDPID7JCgbpEMjo/wLFtFPyS8 7mdan6UDV3VKDzWU8OddTKj7QJkhApDGlYDIkPedUN2pziSVcYP4pyq3gm42njGvOLm5nhiAHPz s0gdNQ2Bq2WZGMq668j+OWubNgRQzuMheuezVubZakFBCQ+qhgzx8LGn6VFZy3BnSsQNU0ysay+ aLfjGZtW4TKXSPCp3RTEk2J2e5QuwfqP0JcasuFb 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-media@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