public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] utils: media-ctl: Set V4L2_MBUS_FRAMEFMT_SET_CSC flag to set colorspace
@ 2025-04-08 16:10 Laurent Pinchart
  2025-04-10 15:02 ` Sakari Ailus
  0 siblings, 1 reply; 2+ messages in thread
From: Laurent Pinchart @ 2025-04-08 16:10 UTC (permalink / raw)
  To: linux-media; +Cc: Sakari Ailus, Hans Verkuil, Laurent Pinchart

From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

When setting colorspace fields on a source pad, the V4L2 subdev API
requires setting the V4L2_MBUS_FRAMEFMT_SET_CSC flag. This is missing
in libv4l2subdev, resulting in colorspace fields being ignored for
source pad. Fix it by setting the flag.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 utils/media-ctl/libv4l2subdev.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/utils/media-ctl/libv4l2subdev.c b/utils/media-ctl/libv4l2subdev.c
index 2f6b1c948a07..f8f2bdecf910 100644
--- a/utils/media-ctl/libv4l2subdev.c
+++ b/utils/media-ctl/libv4l2subdev.c
@@ -829,6 +829,8 @@ static struct media_pad *v4l2_subdev_parse_pad_format(
 			}
 
 			format->colorspace = colorspace;
+			if (pad->flags & MEDIA_PAD_FL_SOURCE)
+				format->flags |= V4L2_MBUS_FRAMEFMT_SET_CSC;
 
 			p = end;
 			continue;
@@ -857,6 +859,8 @@ static struct media_pad *v4l2_subdev_parse_pad_format(
 			}
 
 			format->xfer_func = xfer_func;
+			if (pad->flags & MEDIA_PAD_FL_SOURCE)
+				format->flags |= V4L2_MBUS_FRAMEFMT_SET_CSC;
 
 			p = end;
 			continue;
@@ -885,6 +889,8 @@ static struct media_pad *v4l2_subdev_parse_pad_format(
 			}
 
 			format->ycbcr_enc = ycbcr_enc;
+			if (pad->flags & MEDIA_PAD_FL_SOURCE)
+				format->flags |= V4L2_MBUS_FRAMEFMT_SET_CSC;
 
 			p = end;
 			continue;
@@ -913,6 +919,8 @@ static struct media_pad *v4l2_subdev_parse_pad_format(
 			}
 
 			format->quantization = quantization;
+			if (pad->flags & MEDIA_PAD_FL_SOURCE)
+				format->flags |= V4L2_MBUS_FRAMEFMT_SET_CSC;
 
 			p = end;
 			continue;

base-commit: 4f4815bd2f4c97ef6b293d1b7b306f14caebf2ef
-- 
Regards,

Laurent Pinchart


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

* Re: [PATCH] utils: media-ctl: Set V4L2_MBUS_FRAMEFMT_SET_CSC flag to set colorspace
  2025-04-08 16:10 [PATCH] utils: media-ctl: Set V4L2_MBUS_FRAMEFMT_SET_CSC flag to set colorspace Laurent Pinchart
@ 2025-04-10 15:02 ` Sakari Ailus
  0 siblings, 0 replies; 2+ messages in thread
From: Sakari Ailus @ 2025-04-10 15:02 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linux-media, Hans Verkuil, Laurent Pinchart

On Tue, Apr 08, 2025 at 07:10:51PM +0300, Laurent Pinchart wrote:
> From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> 
> When setting colorspace fields on a source pad, the V4L2 subdev API
> requires setting the V4L2_MBUS_FRAMEFMT_SET_CSC flag. This is missing
> in libv4l2subdev, resulting in colorspace fields being ignored for
> source pad. Fix it by setting the flag.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>

-- 
Sakari Ailus

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

end of thread, other threads:[~2025-04-10 15:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-08 16:10 [PATCH] utils: media-ctl: Set V4L2_MBUS_FRAMEFMT_SET_CSC flag to set colorspace Laurent Pinchart
2025-04-10 15:02 ` Sakari Ailus

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