From: Gianluca Boiano <morf3089@gmail.com>
To: Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>,
Loic Poulain <loic.poulain@oss.qualcomm.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Hans Verkuil <hverkuil@kernel.org>
Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org, phone-devel@vger.kernel.org,
David Heidelberg <david@ixit.cz>,
stable@vger.kernel.org, Gianluca Boiano <morf3089@gmail.com>
Subject: [PATCH 3/5] media: ccs: Store the format set on a sink pad
Date: Mon, 23 Nov 2026 21:33:55 +0100 [thread overview]
Message-ID: <20261123-b4-ccs-imx376-v1-3-2b26850a6f11@gmail.com> (raw)
In-Reply-To: <20261123-b4-ccs-imx376-v1-0-2b26850a6f11@gmail.com>
Setting the format on the sink pad of the binner or the scaler only
updated the crop and compose rectangles of the sub-device and its source
pad, the format itself was never stored in the sub-device state. Reading
the format back returned the one set up by ccs_init_state(), i.e. the
size of the pixel array, and the selection rectangles, which depend on
the size of the sink pad format, were bounded by it.
Link validation then fails with -EPIPE for any readout mode that does not
output the full pixel array: the scaler's sink pad format is the pixel
array size whereas the binner's source pad format is the binned size, and
there is no way to make the two match from user space since setting the
sink format has no effect.
Before the sub-device active state was used, the active sink format was
stored in struct ccs_subdev (sink_fmt) in ccs_set_format(). The switch to
the sub-device state dropped storing it. Store it in the state again.
Fixes: d8bca3ed1d70 ("media: ccs: Use sub-device active state")
Cc: stable@vger.kernel.org
Signed-off-by: Gianluca Boiano <morf3089@gmail.com>
---
drivers/media/i2c/ccs/ccs-core.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/media/i2c/ccs/ccs-core.c b/drivers/media/i2c/ccs/ccs-core.c
index 1cc4350856fd..a4af27de5453 100644
--- a/drivers/media/i2c/ccs/ccs-core.c
+++ b/drivers/media/i2c/ccs/ccs-core.c
@@ -2275,6 +2275,9 @@ static int ccs_set_format(struct v4l2_subdev *subdev,
CCS_LIM(sensor, MIN_Y_OUTPUT_SIZE),
CCS_LIM(sensor, MAX_Y_OUTPUT_SIZE));
+ *v4l2_subdev_state_get_format(sd_state, ssd->sink_pad,
+ CCS_STREAM_PIXEL) = fmt->format;
+
crop = v4l2_subdev_state_get_crop(sd_state, ssd->sink_pad,
CCS_STREAM_PIXEL);
--
2.56.1
next prev parent reply other threads:[~2026-11-23 20:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 20:33 [PATCH 0/5] media: qcom: camss, ccs: Sony IMX376 on SDM660 using the MIPI CCS driver Gianluca Boiano
2026-11-23 20:33 ` [PATCH 1/5] media: qcom: camss: Don't stream sub-devices upstream of the sensor Gianluca Boiano
2026-11-23 20:33 ` [PATCH 2/5] media: qcom: camss: Look up link frequency from the sub-device on the CSI-2 link Gianluca Boiano
2026-11-23 20:33 ` Gianluca Boiano [this message]
2026-11-23 20:33 ` [PATCH 4/5] media: ccs: Make the source pad format follow the crop rectangle Gianluca Boiano
2026-11-23 20:33 ` [PATCH 5/5] media: ccs: Apply rule-based manufacturer register blocks at stream start Gianluca Boiano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261123-b4-ccs-imx376-v1-3-2b26850a6f11@gmail.com \
--to=morf3089@gmail.com \
--cc=bryan.odonoghue@linaro.org \
--cc=david@ixit.cz \
--cc=hverkuil@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=loic.poulain@oss.qualcomm.com \
--cc=mchehab@kernel.org \
--cc=phone-devel@vger.kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=stable@vger.kernel.org \
--cc=vladimir.zapolskiy@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®