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=QWJQ0UqRjEwQqdnePm0QoKREFpl43nohSbhEggPlBjgZrIhEPWmHJUw7IuE57QIlD0Iu BKDhAE4HBTnTGbntjRhgpa3HYEQdaYqy2yA1GaZpxLPHfnV9LHZzPTaCi4dLYAI4sp/Cx yUXyiaT1mZVl/WpuJEcck3ZEr32JLR4XgdhNmyFyUDv+LJlqrIdNVFHtlRQgFVilNdtyd jKItkAdfx+yVk1yGvGsbg8PcaGcYnRIE8ktZytMrLTJFHg0uWYLdgZhcCAWoGVtE1W6Dr fNMikLh/H33SZbDEsQwUWhuSSuXc668Gp756SDgqExiY/jR5NPN9xJmwXfJnBF6DCPQ== 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=OmlSQ3HzgHjxswTM/E0C4HzsKFWKvtVikuITcRBC5UZCx7xs7rFvHh2p2/b2bOuVh1OQ 7wdVC6EhTG7BOsUTL8IQATvvEsuwCZRuWqipvwMOuUNBITDa2AR2Xl1rKuVK73LmzwBXX nK4nIW3Bu9rd5O0bwpBgqtTQnJYG9hRy7vZA3cVgkda7gB1xaMjFrcUJU8l4R/um80lh1 0TC2TQzJI7No35BkBlKBqxRK17CLFrwFRYlLvQeyJ4iPfMAORYn3H+9JpYQMOEH9qZf9P 6Iw0X2pxIgvMvbHpnAQXmykOokeHapC29MgIY/ihNkFggi528pQhivsuI+W2EQOKbcg== 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 BC13F606A334 for ; Wed, 2 Dec 2026 23:03:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BC13F606A334 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-4a42b34e930so12165427f8f.2 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=zbMFBmF5LALgExQrzCLYqbZU/kFD5pnTweMH+IWK/IQ9UrkC9c+4rpfMBPQ1lt2eUa gkRET/Ugqcfm6EBYll6QidhbjfV/Jb7oWw8DQ9ecQ1rGs15ZdBcSyPmbyNVCkTSO4zrr UcnzBjBKPkBF2P4W+Y5Tbig9lMTxnWc7cVCkGSZ8iWQ+WKi6zmDt6O5arAVJBMuwd5FG krKQ3HkHJgTTBY3fYO69wT0QeARZsfwFXLmcyIwx7T9nfFIQsaqGFLf3VDvjCT5SS/Vj HmT2MIEueslYPyoIWhUOaPQWHGPqgRMm/VuoFcC8tDCGngUndbCJxBPfqZJhSruxyC6x VyXQ== X-Forwarded-Encrypted: i=1; AL+hErHA9hmfprUQ95HBQzuYHL/cLgzIfmNXj4J5o+bp8ft/q4yMiEd9UKgJ86KH8J8kXXSAY3AAHSOAkC3zQSlB@vger.kernel.org X-Gm-Message-State: APuU4Z+mXLJfQhl6Qm7wySNwOLxIso90oJ13k7QCirFhVKw0Ris/fS6O Ka69BUVCPAeqkEUUtMe96+3cAVOgiknGCoJ7jKUWAESZmFWSBcEKZUA4 X-Gm-Gg: AZFdTZdMdMgEXTfEPKr2DK2LDR+ljRIcnw1IFT3bAlg20BhNWsLh3JglzBBeChq9nni dNTnonNc2sxod10xF4K4DSpBeR2VnW3TpY9bFUF2/ofS14gHTrnG5H5Y7ZjlmQpbUJ9gLkyfaHZ qQ6uF3huPgJuGOj2XaZKRo625A8nrilG3ZpyKjFA1z1YFDO1CqaBQFJDLfpoLfbpljGGtF0zs56 v1RCuMAKqAY7I95vQMzxcS4y9JzLXKg9URH63dukR38ubHebX3GwDtlg2Rk5SMnb1ahPAtmm5LK 09PZF3Cqe1bIh+R8XvJ0JGyndPSVlJ3utbpFpyx1APngjFrheOCxG0SL21L2ZHTVHXQf2ClB2xC FDm2rsOZxM7KdIg+me7iZRi57opWpUgBCHApz1bLtVnmrdgQFegXGCb75Cc14/Jjh9lJBNhEww2 fVEyiB3g800QN3iM2LzxkauBAWCVxaI2N4Q29ttiYVp99VsULFZpAv8zhO3i9ecsdiQuWOangVw zGi/xNUVUwNFuubEDglvxRcY3XThOXYdgNrCTl+vI6EecgJZa62rRwa1iKqfRhpOv9yIr2MT2r5 xx5ek6lG+uaCclNx+2uAAug4sk3liu36ECYDj7b4 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-arm-msm@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