Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
* [PATCH 0/2] media: qcom: camss: Fix the X1E80100 lite CSID paths
@ 2026-11-20 17:40 Jesse Casco
  2026-11-20 17:40 ` [PATCH 1/2] media: qcom: camss: x1e80100: Use the lite clocks for the lite CSIDs Jesse Casco
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Jesse Casco @ 2026-11-20 17:40 UTC (permalink / raw)
  To: Bryan O'Donoghue, Vladimir Zapolskiy, Loic Poulain,
	Mauro Carvalho Chehab
  Cc: Nihal Kumar Gupta, Allan Siriani, linux-media, linux-arm-msm

The X1E80100 CAMSS resources, which Glymur reuses for its CSIDs and VFEs
(also with Nihal's Glymur-specific resources [1]), have two problems on
the lite paths:

- the lite CSIDs are given the full CSID clocks, so their CSI-2
  receiver is never clocked and they never see a frame;
- CAMSS assumes CSID n feeds VFE n, but X1E80100 has three full CSIDs
  and two full VFEs, so CSID_LITE0 powers VFE_LITE1, CSID_LITE1 has no
  VFE to power and CSID2 powers VFE_LITE0.

Tested on an Asus Zenbook A16 (Glymur), Linux 7.3 with the X1E80100
CSID/VFE tables, streaming 8 frames from the HM1092 IR sensor on CSIPHY0
through each CSID/VFE pair with media-ctl and v4l2-ctl:

                     before          after
  CSID0 -> VFE0      8 frames        8 frames
  CSID1 -> VFE1      8 frames        8 frames
  LITE0 -> LITE0     no frames       8 frames
  LITE1 -> LITE1     -EINVAL         8 frames
  CSID2 -> VFE0      no frames       -EINVAL

The OV02C10 RGB sensor on CSIPHY4 through LITE1 -> LITE1 also goes from
-EINVAL to 8 frames. libcamera still captures from both cameras. I ran
the same tests again with Nihal's v3 [1] applied and the board's CSIPHY4
link on port@2, with the same results.

I don't have an X1E80100 machine; testing there would be welcome.

The series applies on its own and in either order with [1]. Patch 2
touches vfe_parent_dev_ops_get() like Allan's "media: qcom: camss: do
not fail CSID power up without a matching VFE" [2]. They don't depend
on each other; I'm happy to rebase on whichever lands first.

[1] https://lore.kernel.org/r/20261119-glymur_camss-v3-0-71ab966c41c9@oss.qualcomm.com
[2] https://lore.kernel.org/r/20261111135338.27008-5-allan@fatecpompeia.edu.br

Jesse Casco (2):
  media: qcom: camss: x1e80100: Use the lite clocks for the lite CSIDs
  media: qcom: camss: Map each CSID to the VFE it feeds

 drivers/media/platform/qcom/camss/camss.c | 54 +++++++++++++++++++----
 1 file changed, 45 insertions(+), 9 deletions(-)


base-commit: adcad7f4e6332cff3d6d7165f41584899f598534
-- 
2.56.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] media: qcom: camss: x1e80100: Use the lite clocks for the lite CSIDs
  2026-11-20 17:40 [PATCH 0/2] media: qcom: camss: Fix the X1E80100 lite CSID paths Jesse Casco
@ 2026-11-20 17:40 ` Jesse Casco
  2026-11-20 19:29   ` Loic Poulain
  2026-11-20 17:40 ` [PATCH 2/2] media: qcom: camss: Map each CSID to the VFE it feeds Jesse Casco
  2026-11-20 20:01 ` [PATCH 0/2] media: qcom: camss: Fix the X1E80100 lite CSID paths Gjorgji Rosikopulos (Consultant)
  2 siblings, 1 reply; 7+ messages in thread
From: Jesse Casco @ 2026-11-20 17:40 UTC (permalink / raw)
  To: Bryan O'Donoghue, Vladimir Zapolskiy, Loic Poulain,
	Mauro Carvalho Chehab
  Cc: Nihal Kumar Gupta, Allan Siriani, linux-media, linux-arm-msm

The X1E80100 CSID_LITE0 and CSID_LITE1 resources list the full CSID
clocks, "csid" and "csid_csiphy_rx", instead of "vfe_lite_csid" and
"vfe_lite_cphy_rx", which the binding provides for them. The lite CSIDs
then run with their own CSI-2 receiver unclocked: their registers can be
read and they raise the reset interrupt, but they never report RX, RDI
or buffer-done interrupts, so no frame arrives.

Use the lite clocks, with the vfe_lite_csid rates the IFE_LITE entries
already use.

Fixes: 1830cf0f56c3 ("media: qcom: camss: Add x1e80100 specific support")
Signed-off-by: Jesse Casco <jesse.casco@gmail.com>
---
 drivers/media/platform/qcom/camss/camss.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
index f8e5cf9f3..7d9622097 100644
--- a/drivers/media/platform/qcom/camss/camss.c
+++ b/drivers/media/platform/qcom/camss/camss.c
@@ -4287,13 +4287,13 @@ static const struct camss_subdev_resources csid_res_x1e80100[] = {
 	{
 		.regulators = {},
 		.clock = { "gcc_axi_hf", "gcc_axi_sf", "cpas_ahb",
-			   "cpas_fast_ahb", "csid", "csid_csiphy_rx" },
+			   "cpas_fast_ahb", "vfe_lite_csid", "vfe_lite_cphy_rx" },
 		.clock_rate = { { 0 },
 				{ 0 },
 				{ 64000000, 80000000 },
 				{ 80000000,  100000000, 200000000,
 				  300000000, 400000000 },
-				{ 300000000, 400000000, 480000000 },
+				{ 266666667, 400000000, 480000000 },
 				{ 300000000, 400000000, 480000000 }, },
 		.reg = { "csid_lite0" },
 		.interrupt = { "csid_lite0" },
@@ -4308,13 +4308,13 @@ static const struct camss_subdev_resources csid_res_x1e80100[] = {
 	{
 		.regulators = {},
 		.clock = { "gcc_axi_hf", "gcc_axi_sf", "cpas_ahb",
-			   "cpas_fast_ahb", "csid", "csid_csiphy_rx" },
+			   "cpas_fast_ahb", "vfe_lite_csid", "vfe_lite_cphy_rx" },
 		.clock_rate = { { 0 },
 				{ 0 },
 				{ 64000000, 80000000 },
 				{ 80000000,  100000000, 200000000,
 				  300000000, 400000000 },
-				{ 300000000, 400000000, 480000000 },
+				{ 266666667, 400000000, 480000000 },
 				{ 300000000, 400000000, 480000000 }, },
 
 		.reg = { "csid_lite1" },
-- 
2.56.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] media: qcom: camss: Map each CSID to the VFE it feeds
  2026-11-20 17:40 [PATCH 0/2] media: qcom: camss: Fix the X1E80100 lite CSID paths Jesse Casco
  2026-11-20 17:40 ` [PATCH 1/2] media: qcom: camss: x1e80100: Use the lite clocks for the lite CSIDs Jesse Casco
@ 2026-11-20 17:40 ` Jesse Casco
  2026-11-20 19:39   ` Loic Poulain
  2026-11-20 20:01 ` [PATCH 0/2] media: qcom: camss: Fix the X1E80100 lite CSID paths Gjorgji Rosikopulos (Consultant)
  2 siblings, 1 reply; 7+ messages in thread
From: Jesse Casco @ 2026-11-20 17:40 UTC (permalink / raw)
  To: Bryan O'Donoghue, Vladimir Zapolskiy, Loic Poulain,
	Mauro Carvalho Chehab
  Cc: Nihal Kumar Gupta, Allan Siriani, linux-media, linux-arm-msm

CAMSS assumes that CSID n feeds VFE n: csid_set_power() powers the VFE
with the CSID's index through parent_dev_ops, camss_buf_done() is passed
a CSID index and completes the buffer on the VFE of that index, and
camss_reg_update() is passed a VFE index and updates the CSID of that
index.

That holds as long as a SoC has the same number of full CSIDs and full
VFEs, with the lite blocks after them. X1E80100 has three full CSIDs but
only two full VFEs:

  CSID:  0, 1, 2, LITE0 (3), LITE1 (4)
  VFE:   0, 1, LITE0 (2), LITE1 (3)

so CSID2 powers VFE_LITE0, CSID_LITE0 powers VFE_LITE1, and CSID_LITE1
fails to stream with "Failed to power up pipeline: -22" because there is
no VFE 4.

Look the VFE up instead: a full CSID feeds the full VFE with the same
index, and the n-th lite CSID feeds the n-th lite VFE. CSID2 has no VFE.
This gives the same mapping as before on every other SoC.

Fixes: 1830cf0f56c3 ("media: qcom: camss: Add x1e80100 specific support")
Signed-off-by: Jesse Casco <jesse.casco@gmail.com>
---
 drivers/media/platform/qcom/camss/camss.c | 46 ++++++++++++++++++++---
 1 file changed, 41 insertions(+), 5 deletions(-)

diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
index 7d9622097..8020b675c 100644
--- a/drivers/media/platform/qcom/camss/camss.c
+++ b/drivers/media/platform/qcom/camss/camss.c
@@ -4629,11 +4629,39 @@ static int camss_read_version(struct camss *camss)
 	return 0;
 }
 
+/*
+ * Return the index of the VFE fed by CSID @csid_id, or -EINVAL if it feeds
+ * none. A full CSID feeds the full VFE with the same index and the n-th lite
+ * CSID feeds the n-th lite VFE. The two only differ when a SoC has more full
+ * CSIDs than full VFEs, as X1E80100 does (three full CSIDs, two full VFEs).
+ */
+static int camss_csid_to_vfe(struct camss *camss, int csid_id)
+{
+	const struct camss_resources *res = camss->res;
+	int i, n = 0;
+
+	if (!res->csid_res[csid_id].csid.is_lite) {
+		if (csid_id < res->vfe_num && !res->vfe_res[csid_id].vfe.is_lite)
+			return csid_id;
+		return -EINVAL;
+	}
+
+	for (i = 0; i < csid_id; i++)
+		n += res->csid_res[i].csid.is_lite;
+
+	for (i = 0; i < res->vfe_num; i++)
+		if (res->vfe_res[i].vfe.is_lite && n-- == 0)
+			return i;
+
+	return -EINVAL;
+}
+
 static int vfe_parent_dev_ops_get(struct camss *camss, int id)
 {
 	int ret = -EINVAL;
 
-	if (id < camss->res->vfe_num) {
+	id = camss_csid_to_vfe(camss, id);
+	if (id >= 0 && id < camss->res->vfe_num) {
 		struct vfe_device *vfe = &camss->vfe[id];
 
 		ret = vfe_get(vfe);
@@ -4644,7 +4672,8 @@ static int vfe_parent_dev_ops_get(struct camss *camss, int id)
 
 static int vfe_parent_dev_ops_put(struct camss *camss, int id)
 {
-	if (id < camss->res->vfe_num) {
+	id = camss_csid_to_vfe(camss, id);
+	if (id >= 0 && id < camss->res->vfe_num) {
 		struct vfe_device *vfe = &camss->vfe[id];
 
 		vfe_put(vfe);
@@ -5043,11 +5072,16 @@ static int camss_link_entities(struct camss *camss)
 void camss_reg_update(struct camss *camss, int hw_id, int port_id, bool is_clear)
 {
 	struct csid_device *csid;
+	int i;
 
-	if (hw_id < camss->res->csid_num) {
-		csid = &camss->csid[hw_id];
+	/* hw_id is a VFE index; update the CSID that feeds that VFE */
+	for (i = 0; i < camss->res->csid_num; i++) {
+		if (camss_csid_to_vfe(camss, i) != hw_id)
+			continue;
 
+		csid = &camss->csid[i];
 		csid->res->hw_ops->reg_update(csid, port_id, is_clear);
+		return;
 	}
 }
 
@@ -5055,7 +5089,9 @@ void camss_buf_done(struct camss *camss, int hw_id, int port_id)
 {
 	struct vfe_device *vfe;
 
-	if (hw_id < camss->res->vfe_num) {
+	/* hw_id is a CSID index; complete the buffer on the VFE it feeds */
+	hw_id = camss_csid_to_vfe(camss, hw_id);
+	if (hw_id >= 0 && hw_id < camss->res->vfe_num) {
 		vfe = &camss->vfe[hw_id];
 
 		vfe->res->hw_ops->vfe_buf_done(vfe, port_id);
-- 
2.56.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] media: qcom: camss: x1e80100: Use the lite clocks for the lite CSIDs
  2026-11-20 17:40 ` [PATCH 1/2] media: qcom: camss: x1e80100: Use the lite clocks for the lite CSIDs Jesse Casco
@ 2026-11-20 19:29   ` Loic Poulain
  0 siblings, 0 replies; 7+ messages in thread
From: Loic Poulain @ 2026-11-20 19:29 UTC (permalink / raw)
  To: Jesse Casco
  Cc: Bryan O'Donoghue, Vladimir Zapolskiy, Mauro Carvalho Chehab,
	Nihal Kumar Gupta, Allan Siriani, linux-media, linux-arm-msm

On Fri, Nov 20, 2026 at 6:40 PM Jesse Casco <jesse.casco@gmail.com> wrote:
>
> The X1E80100 CSID_LITE0 and CSID_LITE1 resources list the full CSID
> clocks, "csid" and "csid_csiphy_rx", instead of "vfe_lite_csid" and
> "vfe_lite_cphy_rx", which the binding provides for them. The lite CSIDs
> then run with their own CSI-2 receiver unclocked: their registers can be
> read and they raise the reset interrupt, but they never report RX, RDI
> or buffer-done interrupts, so no frame arrives.
>
> Use the lite clocks, with the vfe_lite_csid rates the IFE_LITE entries
> already use.
>
> Fixes: 1830cf0f56c3 ("media: qcom: camss: Add x1e80100 specific support")
> Signed-off-by: Jesse Casco <jesse.casco@gmail.com>

Reviewed-by: Loic Poulain <loic.poulain@oss.qualcomm.com>

> ---
>  drivers/media/platform/qcom/camss/camss.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
> index f8e5cf9f3..7d9622097 100644
> --- a/drivers/media/platform/qcom/camss/camss.c
> +++ b/drivers/media/platform/qcom/camss/camss.c
> @@ -4287,13 +4287,13 @@ static const struct camss_subdev_resources csid_res_x1e80100[] = {
>         {
>                 .regulators = {},
>                 .clock = { "gcc_axi_hf", "gcc_axi_sf", "cpas_ahb",
> -                          "cpas_fast_ahb", "csid", "csid_csiphy_rx" },
> +                          "cpas_fast_ahb", "vfe_lite_csid", "vfe_lite_cphy_rx" },
>                 .clock_rate = { { 0 },
>                                 { 0 },
>                                 { 64000000, 80000000 },
>                                 { 80000000,  100000000, 200000000,
>                                   300000000, 400000000 },
> -                               { 300000000, 400000000, 480000000 },
> +                               { 266666667, 400000000, 480000000 },
>                                 { 300000000, 400000000, 480000000 }, },
>                 .reg = { "csid_lite0" },
>                 .interrupt = { "csid_lite0" },
> @@ -4308,13 +4308,13 @@ static const struct camss_subdev_resources csid_res_x1e80100[] = {
>         {
>                 .regulators = {},
>                 .clock = { "gcc_axi_hf", "gcc_axi_sf", "cpas_ahb",
> -                          "cpas_fast_ahb", "csid", "csid_csiphy_rx" },
> +                          "cpas_fast_ahb", "vfe_lite_csid", "vfe_lite_cphy_rx" },
>                 .clock_rate = { { 0 },
>                                 { 0 },
>                                 { 64000000, 80000000 },
>                                 { 80000000,  100000000, 200000000,
>                                   300000000, 400000000 },
> -                               { 300000000, 400000000, 480000000 },
> +                               { 266666667, 400000000, 480000000 },
>                                 { 300000000, 400000000, 480000000 }, },
>
>                 .reg = { "csid_lite1" },
> --
> 2.56.1
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] media: qcom: camss: Map each CSID to the VFE it feeds
  2026-11-20 17:40 ` [PATCH 2/2] media: qcom: camss: Map each CSID to the VFE it feeds Jesse Casco
@ 2026-11-20 19:39   ` Loic Poulain
  2026-11-20 19:56     ` Gjorgji Rosikopulos (Consultant)
  0 siblings, 1 reply; 7+ messages in thread
From: Loic Poulain @ 2026-11-20 19:39 UTC (permalink / raw)
  To: Jesse Casco
  Cc: Bryan O'Donoghue, Vladimir Zapolskiy, Mauro Carvalho Chehab,
	Nihal Kumar Gupta, Allan Siriani, linux-media, linux-arm-msm

Hi Jesse,

On Fri, Nov 20, 2026 at 6:40 PM Jesse Casco <jesse.casco@gmail.com> wrote:
>
> CAMSS assumes that CSID n feeds VFE n: csid_set_power() powers the VFE
> with the CSID's index through parent_dev_ops, camss_buf_done() is passed
> a CSID index and completes the buffer on the VFE of that index, and
> camss_reg_update() is passed a VFE index and updates the CSID of that
> index.
>
> That holds as long as a SoC has the same number of full CSIDs and full
> VFEs, with the lite blocks after them. X1E80100 has three full CSIDs but
> only two full VFEs:
>
>   CSID:  0, 1, 2, LITE0 (3), LITE1 (4)
>   VFE:   0, 1, LITE0 (2), LITE1 (3)
>
> so CSID2 powers VFE_LITE0, CSID_LITE0 powers VFE_LITE1, and CSID_LITE1
> fails to stream with "Failed to power up pipeline: -22" because there is
> no VFE 4.
>
> Look the VFE up instead: a full CSID feeds the full VFE with the same
> index, and the n-th lite CSID feeds the n-th lite VFE. CSID2 has no VFE.
> This gives the same mapping as before on every other SoC.

Can you also check there is no possible link in the media graph
between LITE and FULL CSID/VFE blocks,

>
> Fixes: 1830cf0f56c3 ("media: qcom: camss: Add x1e80100 specific support")
> Signed-off-by: Jesse Casco <jesse.casco@gmail.com>
> ---
>  drivers/media/platform/qcom/camss/camss.c | 46 ++++++++++++++++++++---
>  1 file changed, 41 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
> index 7d9622097..8020b675c 100644
> --- a/drivers/media/platform/qcom/camss/camss.c
> +++ b/drivers/media/platform/qcom/camss/camss.c
> @@ -4629,11 +4629,39 @@ static int camss_read_version(struct camss *camss)
>         return 0;
>  }
>
> +/*
> + * Return the index of the VFE fed by CSID @csid_id, or -EINVAL if it feeds
> + * none. A full CSID feeds the full VFE with the same index and the n-th lite
> + * CSID feeds the n-th lite VFE. The two only differ when a SoC has more full
> + * CSIDs than full VFEs, as X1E80100 does (three full CSIDs, two full VFEs).
> + */
> +static int camss_csid_to_vfe(struct camss *camss, int csid_id)
> +{
> +       const struct camss_resources *res = camss->res;
> +       int i, n = 0;
> +
> +       if (!res->csid_res[csid_id].csid.is_lite) {
> +               if (csid_id < res->vfe_num && !res->vfe_res[csid_id].vfe.is_lite)
> +                       return csid_id;
> +               return -EINVAL;
> +       }
> +
> +       for (i = 0; i < csid_id; i++)
> +               n += res->csid_res[i].csid.is_lite;
> +
> +       for (i = 0; i < res->vfe_num; i++)
> +               if (res->vfe_res[i].vfe.is_lite && n-- == 0)
> +                       return i;
> +
> +       return -EINVAL;
> +}
> +
>  static int vfe_parent_dev_ops_get(struct camss *camss, int id)
>  {
>         int ret = -EINVAL;
>
> -       if (id < camss->res->vfe_num) {
> +       id = camss_csid_to_vfe(camss, id);
> +       if (id >= 0 && id < camss->res->vfe_num) {
>                 struct vfe_device *vfe = &camss->vfe[id];
>
>                 ret = vfe_get(vfe);
> @@ -4644,7 +4672,8 @@ static int vfe_parent_dev_ops_get(struct camss *camss, int id)
>
>  static int vfe_parent_dev_ops_put(struct camss *camss, int id)
>  {
> -       if (id < camss->res->vfe_num) {
> +       id = camss_csid_to_vfe(camss, id);
> +       if (id >= 0 && id < camss->res->vfe_num) {
>                 struct vfe_device *vfe = &camss->vfe[id];
>
>                 vfe_put(vfe);
> @@ -5043,11 +5072,16 @@ static int camss_link_entities(struct camss *camss)
>  void camss_reg_update(struct camss *camss, int hw_id, int port_id, bool is_clear)
>  {
>         struct csid_device *csid;
> +       int i;
>
> -       if (hw_id < camss->res->csid_num) {
> -               csid = &camss->csid[hw_id];
> +       /* hw_id is a VFE index; update the CSID that feeds that VFE */
> +       for (i = 0; i < camss->res->csid_num; i++) {
> +               if (camss_csid_to_vfe(camss, i) != hw_id)
> +                       continue;
>
> +               csid = &camss->csid[i];
>                 csid->res->hw_ops->reg_update(csid, port_id, is_clear);
> +               return;
>         }
>  }
>
> @@ -5055,7 +5089,9 @@ void camss_buf_done(struct camss *camss, int hw_id, int port_id)
>  {
>         struct vfe_device *vfe;
>
> -       if (hw_id < camss->res->vfe_num) {
> +       /* hw_id is a CSID index; complete the buffer on the VFE it feeds */
> +       hw_id = camss_csid_to_vfe(camss, hw_id);
> +       if (hw_id >= 0 && hw_id < camss->res->vfe_num) {
>                 vfe = &camss->vfe[hw_id];
>
>                 vfe->res->hw_ops->vfe_buf_done(vfe, port_id);
> --
> 2.56.1
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] media: qcom: camss: Map each CSID to the VFE it feeds
  2026-11-20 19:39   ` Loic Poulain
@ 2026-11-20 19:56     ` Gjorgji Rosikopulos (Consultant)
  0 siblings, 0 replies; 7+ messages in thread
From: Gjorgji Rosikopulos (Consultant) @ 2026-11-20 19:56 UTC (permalink / raw)
  To: Loic Poulain, Jesse Casco
  Cc: Bryan O'Donoghue, Vladimir Zapolskiy, Mauro Carvalho Chehab,
	Nihal Kumar Gupta, Allan Siriani, linux-media, linux-arm-msm

Hi Loic,

On 11/20/2026 9:39 PM, Loic Poulain wrote:
> Hi Jesse,
> 
> On Fri, Nov 20, 2026 at 6:40 PM Jesse Casco <jesse.casco@gmail.com> wrote:
>>
>> CAMSS assumes that CSID n feeds VFE n: csid_set_power() powers the VFE
>> with the CSID's index through parent_dev_ops, camss_buf_done() is passed
>> a CSID index and completes the buffer on the VFE of that index, and
>> camss_reg_update() is passed a VFE index and updates the CSID of that
>> index.
>>
>> That holds as long as a SoC has the same number of full CSIDs and full
>> VFEs, with the lite blocks after them. X1E80100 has three full CSIDs but
>> only two full VFEs:
>>
>>   CSID:  0, 1, 2, LITE0 (3), LITE1 (4)
>>   VFE:   0, 1, LITE0 (2), LITE1 (3)
>>
>> so CSID2 powers VFE_LITE0, CSID_LITE0 powers VFE_LITE1, and CSID_LITE1
>> fails to stream with "Failed to power up pipeline: -22" because there is
>> no VFE 4.
>>
>> Look the VFE up instead: a full CSID feeds the full VFE with the same
>> index, and the n-th lite CSID feeds the n-th lite VFE. CSID2 has no VFE.
>> This gives the same mapping as before on every other SoC.
> 
> Can you also check there is no possible link in the media graph
> between LITE and FULL CSID/VFE blocks,

For the current state of the driver maybe make sense because "v4l2_pipeline_pm_get"
is called in prepare_streaming in camss_video, with previous state of the driver
this call was done on video_open. 
I think that from sub-device api point of view it is not correct s_power to fail if link is 
not enabled, but if there is consensus for that logic i think i am also ok...

~Gjorgji

> 
>>
>> Fixes: 1830cf0f56c3 ("media: qcom: camss: Add x1e80100 specific support")
>> Signed-off-by: Jesse Casco <jesse.casco@gmail.com>
>> ---
>>  drivers/media/platform/qcom/camss/camss.c | 46 ++++++++++++++++++++---
>>  1 file changed, 41 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
>> index 7d9622097..8020b675c 100644
>> --- a/drivers/media/platform/qcom/camss/camss.c
>> +++ b/drivers/media/platform/qcom/camss/camss.c
>> @@ -4629,11 +4629,39 @@ static int camss_read_version(struct camss *camss)
>>         return 0;
>>  }
>>
>> +/*
>> + * Return the index of the VFE fed by CSID @csid_id, or -EINVAL if it feeds
>> + * none. A full CSID feeds the full VFE with the same index and the n-th lite
>> + * CSID feeds the n-th lite VFE. The two only differ when a SoC has more full
>> + * CSIDs than full VFEs, as X1E80100 does (three full CSIDs, two full VFEs).
>> + */
>> +static int camss_csid_to_vfe(struct camss *camss, int csid_id)
>> +{
>> +       const struct camss_resources *res = camss->res;
>> +       int i, n = 0;
>> +
>> +       if (!res->csid_res[csid_id].csid.is_lite) {
>> +               if (csid_id < res->vfe_num && !res->vfe_res[csid_id].vfe.is_lite)
>> +                       return csid_id;
>> +               return -EINVAL;
>> +       }
>> +
>> +       for (i = 0; i < csid_id; i++)
>> +               n += res->csid_res[i].csid.is_lite;
>> +
>> +       for (i = 0; i < res->vfe_num; i++)
>> +               if (res->vfe_res[i].vfe.is_lite && n-- == 0)
>> +                       return i;
>> +
>> +       return -EINVAL;
>> +}
>> +
>>  static int vfe_parent_dev_ops_get(struct camss *camss, int id)
>>  {
>>         int ret = -EINVAL;
>>
>> -       if (id < camss->res->vfe_num) {
>> +       id = camss_csid_to_vfe(camss, id);
>> +       if (id >= 0 && id < camss->res->vfe_num) {
>>                 struct vfe_device *vfe = &camss->vfe[id];
>>
>>                 ret = vfe_get(vfe);
>> @@ -4644,7 +4672,8 @@ static int vfe_parent_dev_ops_get(struct camss *camss, int id)
>>
>>  static int vfe_parent_dev_ops_put(struct camss *camss, int id)
>>  {
>> -       if (id < camss->res->vfe_num) {
>> +       id = camss_csid_to_vfe(camss, id);
>> +       if (id >= 0 && id < camss->res->vfe_num) {
>>                 struct vfe_device *vfe = &camss->vfe[id];
>>
>>                 vfe_put(vfe);
>> @@ -5043,11 +5072,16 @@ static int camss_link_entities(struct camss *camss)
>>  void camss_reg_update(struct camss *camss, int hw_id, int port_id, bool is_clear)
>>  {
>>         struct csid_device *csid;
>> +       int i;
>>
>> -       if (hw_id < camss->res->csid_num) {
>> -               csid = &camss->csid[hw_id];
>> +       /* hw_id is a VFE index; update the CSID that feeds that VFE */
>> +       for (i = 0; i < camss->res->csid_num; i++) {
>> +               if (camss_csid_to_vfe(camss, i) != hw_id)
>> +                       continue;
>>
>> +               csid = &camss->csid[i];
>>                 csid->res->hw_ops->reg_update(csid, port_id, is_clear);
>> +               return;
>>         }
>>  }
>>
>> @@ -5055,7 +5089,9 @@ void camss_buf_done(struct camss *camss, int hw_id, int port_id)
>>  {
>>         struct vfe_device *vfe;
>>
>> -       if (hw_id < camss->res->vfe_num) {
>> +       /* hw_id is a CSID index; complete the buffer on the VFE it feeds */
>> +       hw_id = camss_csid_to_vfe(camss, hw_id);
>> +       if (hw_id >= 0 && hw_id < camss->res->vfe_num) {
>>                 vfe = &camss->vfe[hw_id];
>>
>>                 vfe->res->hw_ops->vfe_buf_done(vfe, port_id);
>> --
>> 2.56.1
>>
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2] media: qcom: camss: Fix the X1E80100 lite CSID paths
  2026-11-20 17:40 [PATCH 0/2] media: qcom: camss: Fix the X1E80100 lite CSID paths Jesse Casco
  2026-11-20 17:40 ` [PATCH 1/2] media: qcom: camss: x1e80100: Use the lite clocks for the lite CSIDs Jesse Casco
  2026-11-20 17:40 ` [PATCH 2/2] media: qcom: camss: Map each CSID to the VFE it feeds Jesse Casco
@ 2026-11-20 20:01 ` Gjorgji Rosikopulos (Consultant)
  2 siblings, 0 replies; 7+ messages in thread
From: Gjorgji Rosikopulos (Consultant) @ 2026-11-20 20:01 UTC (permalink / raw)
  To: Jesse Casco, Bryan O'Donoghue, Vladimir Zapolskiy,
	Loic Poulain, Mauro Carvalho Chehab
  Cc: Nihal Kumar Gupta, Allan Siriani, linux-media, linux-arm-msm

Hi Jesse,

On 11/20/2026 7:40 PM, Jesse Casco wrote:
> The X1E80100 CAMSS resources, which Glymur reuses for its CSIDs and VFEs
> (also with Nihal's Glymur-specific resources [1]), have two problems on
> the lite paths:
> 
> - the lite CSIDs are given the full CSID clocks, so their CSI-2
>   receiver is never clocked and they never see a frame;
> - CAMSS assumes CSID n feeds VFE n, but X1E80100 has three full CSIDs
>   and two full VFEs, so CSID_LITE0 powers VFE_LITE1, CSID_LITE1 has no
>   VFE to power and CSID2 powers VFE_LITE0.
> 
> Tested on an Asus Zenbook A16 (Glymur), Linux 7.3 with the X1E80100
> CSID/VFE tables, streaming 8 frames from the HM1092 IR sensor on CSIPHY0
> through each CSID/VFE pair with media-ctl and v4l2-ctl:
> 
>                      before          after
>   CSID0 -> VFE0      8 frames        8 frames
>   CSID1 -> VFE1      8 frames        8 frames
>   LITE0 -> LITE0     no frames       8 frames
>   LITE1 -> LITE1     -EINVAL         8 frames
>   CSID2 -> VFE0      no frames       -EINVAL

Just to note that my opinion is that CSID2 shall be removed from the
resources since can not be used as of today. But others may share
different opinion.

~Gjorgji

> 
> The OV02C10 RGB sensor on CSIPHY4 through LITE1 -> LITE1 also goes from
> -EINVAL to 8 frames. libcamera still captures from both cameras. I ran
> the same tests again with Nihal's v3 [1] applied and the board's CSIPHY4
> link on port@2, with the same results.
> 
> I don't have an X1E80100 machine; testing there would be welcome.
> 
> The series applies on its own and in either order with [1]. Patch 2
> touches vfe_parent_dev_ops_get() like Allan's "media: qcom: camss: do
> not fail CSID power up without a matching VFE" [2]. They don't depend
> on each other; I'm happy to rebase on whichever lands first.
> 
> [1] https://lore.kernel.org/r/20261119-glymur_camss-v3-0-71ab966c41c9@oss.qualcomm.com
> [2] https://lore.kernel.org/r/20261111135338.27008-5-allan@fatecpompeia.edu.br
> 
> Jesse Casco (2):
>   media: qcom: camss: x1e80100: Use the lite clocks for the lite CSIDs
>   media: qcom: camss: Map each CSID to the VFE it feeds
> 
>  drivers/media/platform/qcom/camss/camss.c | 54 +++++++++++++++++++----
>  1 file changed, 45 insertions(+), 9 deletions(-)
> 
> 
> base-commit: adcad7f4e6332cff3d6d7165f41584899f598534


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-11-20 20:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20 17:40 [PATCH 0/2] media: qcom: camss: Fix the X1E80100 lite CSID paths Jesse Casco
2026-11-20 17:40 ` [PATCH 1/2] media: qcom: camss: x1e80100: Use the lite clocks for the lite CSIDs Jesse Casco
2026-11-20 19:29   ` Loic Poulain
2026-11-20 17:40 ` [PATCH 2/2] media: qcom: camss: Map each CSID to the VFE it feeds Jesse Casco
2026-11-20 19:39   ` Loic Poulain
2026-11-20 19:56     ` Gjorgji Rosikopulos (Consultant)
2026-11-20 20:01 ` [PATCH 0/2] media: qcom: camss: Fix the X1E80100 lite CSID paths Gjorgji Rosikopulos (Consultant)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox