All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/4] media-ctl: add pad support to set/get_frame_interval
@ 2017-02-13  9:33 Philipp Zabel
  2017-02-13  9:33 ` [PATCH v2 2/4] media-ctl: print the configured frame interval Philipp Zabel
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Philipp Zabel @ 2017-02-13  9:33 UTC (permalink / raw)
  To: linux-media
  Cc: Laurent Pinchart, Hans Verkuil, Steve Longerbeam, Sakari Ailus,
	Philipp Zabel

This allows to set and get the frame interval on pads other than pad 0.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
Changes since v1:
 - use "pad %s/%u" instead of "entity %s pad %u" in debug message
---
 utils/media-ctl/libv4l2subdev.c | 24 ++++++++++++++----------
 utils/media-ctl/v4l2subdev.h    |  4 ++--
 2 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/utils/media-ctl/libv4l2subdev.c b/utils/media-ctl/libv4l2subdev.c
index 3dcf943..2f2ac8e 100644
--- a/utils/media-ctl/libv4l2subdev.c
+++ b/utils/media-ctl/libv4l2subdev.c
@@ -262,7 +262,8 @@ int v4l2_subdev_set_dv_timings(struct media_entity *entity,
 }
 
 int v4l2_subdev_get_frame_interval(struct media_entity *entity,
-				   struct v4l2_fract *interval)
+				   struct v4l2_fract *interval,
+				   unsigned int pad)
 {
 	struct v4l2_subdev_frame_interval ival;
 	int ret;
@@ -272,6 +273,7 @@ int v4l2_subdev_get_frame_interval(struct media_entity *entity,
 		return ret;
 
 	memset(&ival, 0, sizeof(ival));
+	ival.pad = pad;
 
 	ret = ioctl(entity->fd, VIDIOC_SUBDEV_G_FRAME_INTERVAL, &ival);
 	if (ret < 0)
@@ -282,7 +284,8 @@ int v4l2_subdev_get_frame_interval(struct media_entity *entity,
 }
 
 int v4l2_subdev_set_frame_interval(struct media_entity *entity,
-				   struct v4l2_fract *interval)
+				   struct v4l2_fract *interval,
+				   unsigned int pad)
 {
 	struct v4l2_subdev_frame_interval ival;
 	int ret;
@@ -292,6 +295,7 @@ int v4l2_subdev_set_frame_interval(struct media_entity *entity,
 		return ret;
 
 	memset(&ival, 0, sizeof(ival));
+	ival.pad = pad;
 	ival.interval = *interval;
 
 	ret = ioctl(entity->fd, VIDIOC_SUBDEV_S_FRAME_INTERVAL, &ival);
@@ -617,7 +621,7 @@ static int set_selection(struct media_pad *pad, unsigned int target,
 	return 0;
 }
 
-static int set_frame_interval(struct media_entity *entity,
+static int set_frame_interval(struct media_pad *pad,
 			      struct v4l2_fract *interval)
 {
 	int ret;
@@ -625,20 +629,20 @@ static int set_frame_interval(struct media_entity *entity,
 	if (interval->numerator == 0)
 		return 0;
 
-	media_dbg(entity->media,
-		  "Setting up frame interval %u/%u on entity %s\n",
+	media_dbg(pad->entity->media,
+		  "Setting up frame interval %u/%u on pad %s/%u\n",
 		  interval->numerator, interval->denominator,
-		  entity->info.name);
+		  pad->entity->info.name, pad->index);
 
-	ret = v4l2_subdev_set_frame_interval(entity, interval);
+	ret = v4l2_subdev_set_frame_interval(pad->entity, interval, pad->index);
 	if (ret < 0) {
-		media_dbg(entity->media,
+		media_dbg(pad->entity->media,
 			  "Unable to set frame interval: %s (%d)",
 			  strerror(-ret), ret);
 		return ret;
 	}
 
-	media_dbg(entity->media, "Frame interval set: %u/%u\n",
+	media_dbg(pad->entity->media, "Frame interval set: %u/%u\n",
 		  interval->numerator, interval->denominator);
 
 	return 0;
@@ -685,7 +689,7 @@ static int v4l2_subdev_parse_setup_format(struct media_device *media,
 			return ret;
 	}
 
-	ret = set_frame_interval(pad->entity, &interval);
+	ret = set_frame_interval(pad, &interval);
 	if (ret < 0)
 		return ret;
 
diff --git a/utils/media-ctl/v4l2subdev.h b/utils/media-ctl/v4l2subdev.h
index 9c8fee8..413094d 100644
--- a/utils/media-ctl/v4l2subdev.h
+++ b/utils/media-ctl/v4l2subdev.h
@@ -200,7 +200,7 @@ int v4l2_subdev_set_dv_timings(struct media_entity *entity,
  */
 
 int v4l2_subdev_get_frame_interval(struct media_entity *entity,
-	struct v4l2_fract *interval);
+	struct v4l2_fract *interval, unsigned int pad);
 
 /**
  * @brief Set the frame interval on a sub-device.
@@ -217,7 +217,7 @@ int v4l2_subdev_get_frame_interval(struct media_entity *entity,
  * @return 0 on success, or a negative error code on failure.
  */
 int v4l2_subdev_set_frame_interval(struct media_entity *entity,
-	struct v4l2_fract *interval);
+	struct v4l2_fract *interval, unsigned int pad);
 
 /**
  * @brief Parse a string and apply format, crop and frame interval settings.
-- 
2.1.4

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

* [PATCH v2 2/4] media-ctl: print the configured frame interval
  2017-02-13  9:33 [PATCH v2 1/4] media-ctl: add pad support to set/get_frame_interval Philipp Zabel
@ 2017-02-13  9:33 ` Philipp Zabel
  2017-02-13  9:33 ` [PATCH v2 3/4] media-ctl: propagate " Philipp Zabel
  2017-02-13  9:33 ` [PATCH v2 4/4] media-ctl: add colorimetry support Philipp Zabel
  2 siblings, 0 replies; 11+ messages in thread
From: Philipp Zabel @ 2017-02-13  9:33 UTC (permalink / raw)
  To: linux-media
  Cc: Laurent Pinchart, Hans Verkuil, Steve Longerbeam, Sakari Ailus,
	Philipp Zabel

After the pad format, also print the frame interval, if already configured.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 utils/media-ctl/media-ctl.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/utils/media-ctl/media-ctl.c b/utils/media-ctl/media-ctl.c
index 572bcf7..383fbfa 100644
--- a/utils/media-ctl/media-ctl.c
+++ b/utils/media-ctl/media-ctl.c
@@ -79,6 +79,7 @@ static void v4l2_subdev_print_format(struct media_entity *entity,
 	unsigned int pad, enum v4l2_subdev_format_whence which)
 {
 	struct v4l2_mbus_framefmt format;
+	struct v4l2_fract interval = { 0, 0 };
 	struct v4l2_rect rect;
 	int ret;
 
@@ -86,10 +87,17 @@ static void v4l2_subdev_print_format(struct media_entity *entity,
 	if (ret != 0)
 		return;
 
+	ret = v4l2_subdev_get_frame_interval(entity, &interval, pad);
+	if (ret != 0 && ret != -ENOTTY)
+		return;
+
 	printf("\t\t[fmt:%s/%ux%u",
 	       v4l2_subdev_pixelcode_to_string(format.code),
 	       format.width, format.height);
 
+	if (interval.numerator || interval.denominator)
+		printf("@%u/%u", interval.numerator, interval.denominator);
+
 	if (format.field)
 		printf(" field:%s", v4l2_subdev_field_to_string(format.field));
 
-- 
2.1.4

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

* [PATCH v2 3/4] media-ctl: propagate frame interval
  2017-02-13  9:33 [PATCH v2 1/4] media-ctl: add pad support to set/get_frame_interval Philipp Zabel
  2017-02-13  9:33 ` [PATCH v2 2/4] media-ctl: print the configured frame interval Philipp Zabel
@ 2017-02-13  9:33 ` Philipp Zabel
  2017-02-13  9:33 ` [PATCH v2 4/4] media-ctl: add colorimetry support Philipp Zabel
  2 siblings, 0 replies; 11+ messages in thread
From: Philipp Zabel @ 2017-02-13  9:33 UTC (permalink / raw)
  To: linux-media
  Cc: Laurent Pinchart, Hans Verkuil, Steve Longerbeam, Sakari Ailus,
	Philipp Zabel

Same as the media bus format, the frame interval should be propagated
from output pads to connected entities' input pads.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 utils/media-ctl/libv4l2subdev.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/utils/media-ctl/libv4l2subdev.c b/utils/media-ctl/libv4l2subdev.c
index 2f2ac8e..7f9ef48 100644
--- a/utils/media-ctl/libv4l2subdev.c
+++ b/utils/media-ctl/libv4l2subdev.c
@@ -694,8 +694,8 @@ static int v4l2_subdev_parse_setup_format(struct media_device *media,
 		return ret;
 
 
-	/* If the pad is an output pad, automatically set the same format on
-	 * the remote subdev input pads, if any.
+	/* If the pad is an output pad, automatically set the same format and
+	 * frame interval on the remote subdev input pads, if any.
 	 */
 	if (pad->flags & MEDIA_PAD_FL_SOURCE) {
 		for (i = 0; i < pad->entity->num_links; ++i) {
@@ -709,6 +709,10 @@ static int v4l2_subdev_parse_setup_format(struct media_device *media,
 			    link->sink->entity->info.type == MEDIA_ENT_T_V4L2_SUBDEV) {
 				remote_format = format;
 				set_format(link->sink, &remote_format);
+
+				ret = set_frame_interval(link->sink, &interval);
+				if (ret < 0)
+					return ret;
 			}
 		}
 	}
-- 
2.1.4

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

* [PATCH v2 4/4] media-ctl: add colorimetry support
  2017-02-13  9:33 [PATCH v2 1/4] media-ctl: add pad support to set/get_frame_interval Philipp Zabel
  2017-02-13  9:33 ` [PATCH v2 2/4] media-ctl: print the configured frame interval Philipp Zabel
  2017-02-13  9:33 ` [PATCH v2 3/4] media-ctl: propagate " Philipp Zabel
@ 2017-02-13  9:33 ` Philipp Zabel
  2017-02-13  9:40   ` Hans Verkuil
  2 siblings, 1 reply; 11+ messages in thread
From: Philipp Zabel @ 2017-02-13  9:33 UTC (permalink / raw)
  To: linux-media
  Cc: Laurent Pinchart, Hans Verkuil, Steve Longerbeam, Sakari Ailus,
	Philipp Zabel

media-ctl can be used to propagate v4l2 subdevice pad formats from
source pads of one subdevice to another one's sink pads. These formats
include colorimetry information, so media-ctl should be able to print
or change it using the --set/get-v4l2 option.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 utils/media-ctl/libv4l2subdev.c | 263 ++++++++++++++++++++++++++++++++++++++++
 utils/media-ctl/media-ctl.c     |  17 +++
 utils/media-ctl/options.c       |  22 +++-
 utils/media-ctl/v4l2subdev.h    |  80 ++++++++++++
 4 files changed, 381 insertions(+), 1 deletion(-)

diff --git a/utils/media-ctl/libv4l2subdev.c b/utils/media-ctl/libv4l2subdev.c
index 7f9ef48..c918777 100644
--- a/utils/media-ctl/libv4l2subdev.c
+++ b/utils/media-ctl/libv4l2subdev.c
@@ -511,6 +511,118 @@ static struct media_pad *v4l2_subdev_parse_pad_format(
 			continue;
 		}
 
+		if (strhazit("colorspace:", &p)) {
+			enum v4l2_colorspace colorspace;
+			char *strfield;
+
+			for (end = (char *)p; isalnum(*end) || *end == '-';
+			     ++end);
+
+			strfield = strndup(p, end - p);
+			if (!strfield) {
+				*endp = (char *)p;
+				return NULL;
+			}
+
+			colorspace = v4l2_subdev_string_to_colorspace(strfield);
+			free(strfield);
+			if (colorspace == (enum v4l2_colorspace)-1) {
+				media_dbg(media, "Invalid colorspace value '%*s'\n",
+					  end - p, p);
+				*endp = (char *)p;
+				return NULL;
+			}
+
+			format->colorspace = colorspace;
+
+			p = end;
+			continue;
+		}
+
+		if (strhazit("xfer:", &p)) {
+			enum v4l2_xfer_func xfer_func;
+			char *strfield;
+
+			for (end = (char *)p; isalnum(*end) || *end == '-';
+			     ++end);
+
+			strfield = strndup(p, end - p);
+			if (!strfield) {
+				*endp = (char *)p;
+				return NULL;
+			}
+
+			xfer_func = v4l2_subdev_string_to_xfer_func(strfield);
+			free(strfield);
+			if (xfer_func == (enum v4l2_xfer_func)-1) {
+				media_dbg(media, "Invalid transfer function value '%*s'\n",
+					  end - p, p);
+				*endp = (char *)p;
+				return NULL;
+			}
+
+			format->xfer_func = xfer_func;
+
+			p = end;
+			continue;
+		}
+
+		if (strhazit("ycbcr:", &p)) {
+			enum v4l2_ycbcr_encoding ycbcr_enc;
+			char *strfield;
+
+			for (end = (char *)p; isalnum(*end) || *end == '-';
+			     ++end);
+
+			strfield = strndup(p, end - p);
+			if (!strfield) {
+				*endp = (char *)p;
+				return NULL;
+			}
+
+			ycbcr_enc = v4l2_subdev_string_to_ycbcr_encoding(strfield);
+			free(strfield);
+			if (ycbcr_enc == (enum v4l2_ycbcr_encoding)-1) {
+				media_dbg(media, "Invalid YCbCr encoding value '%*s'\n",
+					  end - p, p);
+				*endp = (char *)p;
+				return NULL;
+			}
+
+			format->ycbcr_enc = ycbcr_enc;
+
+			p = end;
+			continue;
+		}
+
+		if (strhazit("quantization:", &p)) {
+			enum v4l2_quantization quantization;
+			char *strfield;
+
+			for (end = (char *)p; isalnum(*end) || *end == '-';
+			     ++end);
+
+			strfield = strndup(p, end - p);
+			if (!strfield) {
+				*endp = (char *)p;
+				return NULL;
+			}
+
+			quantization = v4l2_subdev_string_to_quantization(strfield);
+			free(strfield);
+			if (quantization == (enum v4l2_quantization)-1) {
+				media_dbg(media, "Invalid quantization value '%*s'\n",
+					  end - p, p);
+				*endp = (char *)p;
+				return NULL;
+			}
+
+			format->quantization = quantization;
+
+			p = end;
+			continue;
+		}
+
 		/*
 		 * Backward compatibility: crop rectangles can be specified
 		 * implicitly without the 'crop:' property name.
@@ -839,6 +951,157 @@ enum v4l2_field v4l2_subdev_string_to_field(const char *string)
 	return (enum v4l2_field)-1;
 }
 
+static struct {
+	const char *name;
+	enum v4l2_colorspace colorspace;
+} colorspaces[] = {
+	{ "default", V4L2_COLORSPACE_DEFAULT },
+	{ "smpte170m", V4L2_COLORSPACE_SMPTE170M },
+	{ "smpte240m", V4L2_COLORSPACE_SMPTE240M },
+	{ "rec709", V4L2_COLORSPACE_REC709 },
+	{ "bt878", V4L2_COLORSPACE_BT878 },
+	{ "470m", V4L2_COLORSPACE_470_SYSTEM_M },
+	{ "470bg", V4L2_COLORSPACE_470_SYSTEM_BG },
+	{ "jpeg", V4L2_COLORSPACE_JPEG },
+	{ "srgb", V4L2_COLORSPACE_SRGB },
+	{ "adobergb", V4L2_COLORSPACE_ADOBERGB },
+	{ "bt2020", V4L2_COLORSPACE_BT2020 },
+	{ "dcip3", V4L2_COLORSPACE_DCI_P3 },
+};
+
+const char *v4l2_subdev_colorspace_to_string(enum v4l2_colorspace colorspace)
+{
+	unsigned int i;
+
+	for (i = 0; i < ARRAY_SIZE(colorspaces); ++i) {
+		if (colorspaces[i].colorspace == colorspace)
+			return colorspaces[i].name;
+	}
+
+	return "unknown";
+}
+
+enum v4l2_colorspace v4l2_subdev_string_to_colorspace(const char *string)
+{
+	unsigned int i;
+
+	for (i = 0; i < ARRAY_SIZE(colorspaces); ++i) {
+		if (strcasecmp(colorspaces[i].name, string) == 0)
+			return colorspaces[i].colorspace;
+	}
+
+	return (enum v4l2_colorspace)-1;
+}
+
+static struct {
+	const char *name;
+	enum v4l2_xfer_func xfer_func;
+} xfer_funcs[] = {
+	{ "default", V4L2_XFER_FUNC_DEFAULT },
+	{ "709", V4L2_XFER_FUNC_709 },
+	{ "srgb", V4L2_XFER_FUNC_SRGB },
+	{ "adobergb", V4L2_XFER_FUNC_ADOBERGB },
+	{ "smpte240m", V4L2_XFER_FUNC_SMPTE240M },
+	{ "smpte2084", V4L2_XFER_FUNC_SMPTE2084 },
+	{ "dcip3", V4L2_XFER_FUNC_DCI_P3 },
+	{ "none", V4L2_XFER_FUNC_NONE },
+};
+
+const char *v4l2_subdev_xfer_func_to_string(enum v4l2_xfer_func xfer_func)
+{
+	unsigned int i;
+
+	for (i = 0; i < ARRAY_SIZE(xfer_funcs); ++i) {
+		if (xfer_funcs[i].xfer_func == xfer_func)
+			return xfer_funcs[i].name;
+	}
+
+	return "unknown";
+}
+
+enum v4l2_xfer_func v4l2_subdev_string_to_xfer_func(const char *string)
+{
+	unsigned int i;
+
+	for (i = 0; i < ARRAY_SIZE(xfer_funcs); ++i) {
+		if (strcasecmp(xfer_funcs[i].name, string) == 0)
+			return xfer_funcs[i].xfer_func;
+	}
+
+	return (enum v4l2_xfer_func)-1;
+}
+
+static struct {
+	const char *name;
+	enum v4l2_ycbcr_encoding ycbcr_enc;
+} ycbcr_encs[] = {
+	{ "default", V4L2_YCBCR_ENC_DEFAULT },
+	{ "601", V4L2_YCBCR_ENC_601 },
+	{ "709", V4L2_YCBCR_ENC_709 },
+	{ "xv601", V4L2_YCBCR_ENC_XV601 },
+	{ "xv709", V4L2_YCBCR_ENC_XV709 },
+	{ "bt2020", V4L2_YCBCR_ENC_BT2020 },
+	{ "bt2020c", V4L2_YCBCR_ENC_BT2020_CONST_LUM },
+	{ "smpte240m", V4L2_YCBCR_ENC_SMPTE240M },
+};
+
+const char *v4l2_subdev_ycbcr_encoding_to_string(enum v4l2_ycbcr_encoding ycbcr_enc)
+{
+	unsigned int i;
+
+	for (i = 0; i < ARRAY_SIZE(ycbcr_encs); ++i) {
+		if (ycbcr_encs[i].ycbcr_enc == ycbcr_enc)
+			return ycbcr_encs[i].name;
+	}
+
+	return "unknown";
+}
+
+enum v4l2_ycbcr_encoding v4l2_subdev_string_to_ycbcr_encoding(const char *string)
+{
+	unsigned int i;
+
+	for (i = 0; i < ARRAY_SIZE(ycbcr_encs); ++i) {
+		if (strcasecmp(ycbcr_encs[i].name, string) == 0)
+			return ycbcr_encs[i].ycbcr_enc;
+	}
+
+	return (enum v4l2_ycbcr_encoding)-1;
+}
+
+static struct {
+	const char *name;
+	enum v4l2_quantization quantization;
+} quantizations[] = {
+	{ "default", V4L2_QUANTIZATION_DEFAULT },
+	{ "full-range", V4L2_QUANTIZATION_FULL_RANGE },
+	{ "lim-range", V4L2_QUANTIZATION_LIM_RANGE },
+};
+
+const char *v4l2_subdev_quantization_to_string(enum v4l2_quantization quantization)
+{
+	unsigned int i;
+
+	for (i = 0; i < ARRAY_SIZE(quantizations); ++i) {
+		if (quantizations[i].quantization == quantization)
+			return quantizations[i].name;
+	}
+
+	return "unknown";
+}
+
+enum v4l2_quantization v4l2_subdev_string_to_quantization(const char *string)
+{
+	unsigned int i;
+
+	for (i = 0; i < ARRAY_SIZE(quantizations); ++i) {
+		if (strcasecmp(quantizations[i].name, string) == 0)
+			return quantizations[i].quantization;
+	}
+
+	return (enum v4l2_quantization)-1;
+}
+
 static const enum v4l2_mbus_pixelcode mbus_codes[] = {
 #include "media-bus-format-codes.h"
 };
diff --git a/utils/media-ctl/media-ctl.c b/utils/media-ctl/media-ctl.c
index 383fbfa..f61963a 100644
--- a/utils/media-ctl/media-ctl.c
+++ b/utils/media-ctl/media-ctl.c
@@ -101,6 +101,23 @@ static void v4l2_subdev_print_format(struct media_entity *entity,
 	if (format.field)
 		printf(" field:%s", v4l2_subdev_field_to_string(format.field));
 
+	if (format.colorspace) {
+		printf(" colorspace:%s",
+		       v4l2_subdev_colorspace_to_string(format.colorspace));
+
+		if (format.xfer_func)
+			printf(" xfer:%s",
+			       v4l2_subdev_xfer_func_to_string(format.xfer_func));
+
+		if (format.ycbcr_enc)
+			printf(" ycbcr:%s",
+			       v4l2_subdev_ycbcr_encoding_to_string(format.ycbcr_enc));
+
+		if (format.quantization)
+			printf(" quantization:%s",
+			       v4l2_subdev_quantization_to_string(format.quantization));
+	}
+
 	ret = v4l2_subdev_get_selection(entity, &rect, pad,
 					V4L2_SEL_TGT_CROP_BOUNDS,
 					which);
diff --git a/utils/media-ctl/options.c b/utils/media-ctl/options.c
index 59841bb..83ca1ca 100644
--- a/utils/media-ctl/options.c
+++ b/utils/media-ctl/options.c
@@ -68,7 +68,9 @@ static void usage(const char *argv0)
 	printf("\tv4l2-properties = v4l2-property { ',' v4l2-property } ;\n");
 	printf("\tv4l2-property   = v4l2-mbusfmt | v4l2-crop | v4l2-interval\n");
 	printf("\t                | v4l2-compose | v4l2-interval ;\n");
-	printf("\tv4l2-mbusfmt    = 'fmt:' fcc '/' size ; { 'field:' v4l2-field ; }\n");
+	printf("\tv4l2-mbusfmt    = 'fmt:' fcc '/' size ; { 'field:' v4l2-field ; } { 'colorspace:' v4l2-colorspace ; }\n");
+	printf("\t                   { 'xfer:' v4l2-xfer-func ; } { 'ycbcr-enc:' v4l2-ycbcr-enc-func ; }\n");
+	printf("\t                   { 'quantization:' v4l2-quant ; }\n");
 	printf("\tv4l2-crop       = 'crop:' rectangle ;\n");
 	printf("\tv4l2-compose    = 'compose:' rectangle ;\n");
 	printf("\tv4l2-interval   = '@' numerator '/' denominator ;\n");
@@ -91,6 +93,24 @@ static void usage(const char *argv0)
 	for (i = V4L2_FIELD_ANY; i <= V4L2_FIELD_INTERLACED_BT; i++)
 		printf("\t                %s\n",
 		       v4l2_subdev_field_to_string(i));
+
+	printf("\tv4l2-colorspace One of the following:\n");
+
+	for (i = V4L2_COLORSPACE_DEFAULT; i <= V4L2_COLORSPACE_DCI_P3; i++)
+		printf("\t                %s\n",
+		       v4l2_subdev_colorspace_to_string(i));
+
+	printf("\tv4l2-xfer-func  One of the following:\n");
+
+	for (i = V4L2_XFER_FUNC_DEFAULT; i <= V4L2_XFER_FUNC_SMPTE2084; i++)
+		printf("\t                %s\n",
+		       v4l2_subdev_xfer_func_to_string(i));
+
+	printf("\tv4l2-quant      One of the following:\n");
+
+	for (i = V4L2_QUANTIZATION_DEFAULT; i <= V4L2_QUANTIZATION_LIM_RANGE; i++)
+		printf("\t                %s\n",
+		       v4l2_subdev_quantization_to_string(i));
 }
 
 #define OPT_PRINT_DOT			256
diff --git a/utils/media-ctl/v4l2subdev.h b/utils/media-ctl/v4l2subdev.h
index 413094d..a181391 100644
--- a/utils/media-ctl/v4l2subdev.h
+++ b/utils/media-ctl/v4l2subdev.h
@@ -276,6 +276,86 @@ const char *v4l2_subdev_field_to_string(enum v4l2_field field);
 enum v4l2_field v4l2_subdev_string_to_field(const char *string);
 
 /**
+ * @brief Convert a colorspace to string.
+ * @param colorspace - colorspace
+ *
+ * Convert colorspace @a colorspace to a human-readable string.
+ *
+ * @return A pointer to a string on success, NULL on failure.
+ */
+const char *v4l2_subdev_colorspace_to_string(enum v4l2_colorspace colorspace);
+
+/**
+ * @brief Parse string to colorspace.
+ * @param string - nul terminated string, textual colorspace
+ *
+ * Parse human readable string @a string to colorspace.
+ *
+ * @return colorspace on success, -1 on failure.
+ */
+enum v4l2_colorspace v4l2_subdev_string_to_colorspace(const char *string);
+
+/**
+ * @brief Convert a transfer function to string.
+ * @param xfer_func - transfer function
+ *
+ * Convert transfer function @a xfer_func to a human-readable string.
+ *
+ * @return A pointer to a string on success, NULL on failure.
+ */
+const char *v4l2_subdev_xfer_func_to_string(enum v4l2_xfer_func xfer_func);
+
+/**
+ * @brief Parse string to transfer function.
+ * @param string - nul terminated string, textual transfer function
+ *
+ * Parse human readable string @a string to xfer_func.
+ *
+ * @return xfer_func on success, -1 on failure.
+ */
+enum v4l2_xfer_func v4l2_subdev_string_to_xfer_func(const char *string);
+
+/**
+ * @brief Convert a YCbCr encoding to string.
+ * @param ycbcr_enc - YCbCr encoding
+ *
+ * Convert YCbCr encoding @a ycbcr_enc to a human-readable string.
+ *
+ * @return A pointer to a string on success, NULL on failure.
+ */
+const char *v4l2_subdev_ycbcr_encoding_to_string(enum v4l2_ycbcr_encoding ycbcr_enc);
+
+/**
+ * @brief Parse string to YCbCr encoding.
+ * @param string - nul terminated string, textual YCbCr encoding
+ *
+ * Parse human readable string @a string to YCbCr encoding.
+ *
+ * @return ycbcr_enc on success, -1 on failure.
+ */
+enum v4l2_ycbcr_encoding v4l2_subdev_string_to_ycbcr_encoding(const char *string);
+
+/**
+ * @brief Convert a quantization to string.
+ * @param quantization - quantization
+ *
+ * Convert quantization @a quantization to a human-readable string.
+ *
+ * @return A pointer to a string on success, NULL on failure.
+ */
+const char *v4l2_subdev_quantization_to_string(enum v4l2_quantization quantization);
+
+/**
+ * @brief Parse string to quantization.
+ * @param string - nul terminated string, textual quantization
+ *
+ * Parse human readable string @a string to quantization.
+ *
+ * @return quantization on success, -1 on failure.
+ */
+enum v4l2_quantization v4l2_subdev_string_to_quantization(const char *string);
+
+/**
  * @brief Enumerate library supported media bus pixel codes.
  * @param length - the number of the supported pixel codes
  *
-- 
2.1.4

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

* Re: [PATCH v2 4/4] media-ctl: add colorimetry support
  2017-02-13  9:33 ` [PATCH v2 4/4] media-ctl: add colorimetry support Philipp Zabel
@ 2017-02-13  9:40   ` Hans Verkuil
  2017-02-13  9:48     ` Sakari Ailus
  2017-02-13  9:49     ` Philipp Zabel
  0 siblings, 2 replies; 11+ messages in thread
From: Hans Verkuil @ 2017-02-13  9:40 UTC (permalink / raw)
  To: Philipp Zabel, linux-media
  Cc: Laurent Pinchart, Steve Longerbeam, Sakari Ailus

On 02/13/2017 10:33 AM, Philipp Zabel wrote:
> media-ctl can be used to propagate v4l2 subdevice pad formats from
> source pads of one subdevice to another one's sink pads. These formats
> include colorimetry information, so media-ctl should be able to print
> or change it using the --set/get-v4l2 option.
> 
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>

Just one small comment:

> ---
>  utils/media-ctl/libv4l2subdev.c | 263 ++++++++++++++++++++++++++++++++++++++++
>  utils/media-ctl/media-ctl.c     |  17 +++
>  utils/media-ctl/options.c       |  22 +++-
>  utils/media-ctl/v4l2subdev.h    |  80 ++++++++++++
>  4 files changed, 381 insertions(+), 1 deletion(-)
> 
> diff --git a/utils/media-ctl/libv4l2subdev.c b/utils/media-ctl/libv4l2subdev.c
> index 7f9ef48..c918777 100644
> --- a/utils/media-ctl/libv4l2subdev.c
> +++ b/utils/media-ctl/libv4l2subdev.c
> @@ -511,6 +511,118 @@ static struct media_pad *v4l2_subdev_parse_pad_format(
>  			continue;
>  		}
>  
> +		if (strhazit("colorspace:", &p)) {
> +			enum v4l2_colorspace colorspace;
> +			char *strfield;
> +
> +			for (end = (char *)p; isalnum(*end) || *end == '-';
> +			     ++end);
> +
> +			strfield = strndup(p, end - p);
> +			if (!strfield) {
> +				*endp = (char *)p;
> +				return NULL;
> +			}
> +
> +			colorspace = v4l2_subdev_string_to_colorspace(strfield);
> +			free(strfield);
> +			if (colorspace == (enum v4l2_colorspace)-1) {
> +				media_dbg(media, "Invalid colorspace value '%*s'\n",
> +					  end - p, p);
> +				*endp = (char *)p;
> +				return NULL;
> +			}
> +
> +			format->colorspace = colorspace;
> +
> +			p = end;
> +			continue;
> +		}
> +
> +		if (strhazit("xfer:", &p)) {
> +			enum v4l2_xfer_func xfer_func;
> +			char *strfield;
> +
> +			for (end = (char *)p; isalnum(*end) || *end == '-';
> +			     ++end);
> +
> +			strfield = strndup(p, end - p);
> +			if (!strfield) {
> +				*endp = (char *)p;
> +				return NULL;
> +			}
> +
> +			xfer_func = v4l2_subdev_string_to_xfer_func(strfield);
> +			free(strfield);
> +			if (xfer_func == (enum v4l2_xfer_func)-1) {
> +				media_dbg(media, "Invalid transfer function value '%*s'\n",
> +					  end - p, p);
> +				*endp = (char *)p;
> +				return NULL;
> +			}
> +
> +			format->xfer_func = xfer_func;
> +
> +			p = end;
> +			continue;
> +		}
> +
> +		if (strhazit("ycbcr:", &p)) {
> +			enum v4l2_ycbcr_encoding ycbcr_enc;
> +			char *strfield;
> +
> +			for (end = (char *)p; isalnum(*end) || *end == '-';
> +			     ++end);
> +
> +			strfield = strndup(p, end - p);
> +			if (!strfield) {
> +				*endp = (char *)p;
> +				return NULL;
> +			}
> +
> +			ycbcr_enc = v4l2_subdev_string_to_ycbcr_encoding(strfield);
> +			free(strfield);
> +			if (ycbcr_enc == (enum v4l2_ycbcr_encoding)-1) {
> +				media_dbg(media, "Invalid YCbCr encoding value '%*s'\n",
> +					  end - p, p);
> +				*endp = (char *)p;
> +				return NULL;
> +			}
> +
> +			format->ycbcr_enc = ycbcr_enc;
> +
> +			p = end;
> +			continue;
> +		}
> +
> +		if (strhazit("quantization:", &p)) {
> +			enum v4l2_quantization quantization;
> +			char *strfield;
> +
> +			for (end = (char *)p; isalnum(*end) || *end == '-';
> +			     ++end);
> +
> +			strfield = strndup(p, end - p);
> +			if (!strfield) {
> +				*endp = (char *)p;
> +				return NULL;
> +			}
> +
> +			quantization = v4l2_subdev_string_to_quantization(strfield);
> +			free(strfield);
> +			if (quantization == (enum v4l2_quantization)-1) {
> +				media_dbg(media, "Invalid quantization value '%*s'\n",
> +					  end - p, p);
> +				*endp = (char *)p;
> +				return NULL;
> +			}
> +
> +			format->quantization = quantization;
> +
> +			p = end;
> +			continue;
> +		}
> +
>  		/*
>  		 * Backward compatibility: crop rectangles can be specified
>  		 * implicitly without the 'crop:' property name.
> @@ -839,6 +951,157 @@ enum v4l2_field v4l2_subdev_string_to_field(const char *string)
>  	return (enum v4l2_field)-1;
>  }
>  
> +static struct {
> +	const char *name;
> +	enum v4l2_colorspace colorspace;
> +} colorspaces[] = {
> +	{ "default", V4L2_COLORSPACE_DEFAULT },
> +	{ "smpte170m", V4L2_COLORSPACE_SMPTE170M },
> +	{ "smpte240m", V4L2_COLORSPACE_SMPTE240M },
> +	{ "rec709", V4L2_COLORSPACE_REC709 },
> +	{ "bt878", V4L2_COLORSPACE_BT878 },

Drop this, it's no longer used in the kernel.

Regards,

	Hans

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

* Re: [PATCH v2 4/4] media-ctl: add colorimetry support
  2017-02-13  9:40   ` Hans Verkuil
@ 2017-02-13  9:48     ` Sakari Ailus
  2017-02-13  9:58       ` Hans Verkuil
  2017-02-13 10:02       ` Philipp Zabel
  2017-02-13  9:49     ` Philipp Zabel
  1 sibling, 2 replies; 11+ messages in thread
From: Sakari Ailus @ 2017-02-13  9:48 UTC (permalink / raw)
  To: Hans Verkuil
  Cc: Philipp Zabel, linux-media, Laurent Pinchart, Steve Longerbeam

Hi Hans,

On Mon, Feb 13, 2017 at 10:40:41AM +0100, Hans Verkuil wrote:
...
> > @@ -839,6 +951,157 @@ enum v4l2_field v4l2_subdev_string_to_field(const char *string)
> >  	return (enum v4l2_field)-1;
> >  }
> >  
> > +static struct {
> > +	const char *name;
> > +	enum v4l2_colorspace colorspace;
> > +} colorspaces[] = {
> > +	{ "default", V4L2_COLORSPACE_DEFAULT },
> > +	{ "smpte170m", V4L2_COLORSPACE_SMPTE170M },
> > +	{ "smpte240m", V4L2_COLORSPACE_SMPTE240M },
> > +	{ "rec709", V4L2_COLORSPACE_REC709 },
> > +	{ "bt878", V4L2_COLORSPACE_BT878 },
> 
> Drop this, it's no longer used in the kernel.

What about older kernels? Were there drivers that reported it?

-- 
Sakari Ailus
e-mail: sakari.ailus@iki.fi	XMPP: sailus@retiisi.org.uk

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

* Re: [PATCH v2 4/4] media-ctl: add colorimetry support
  2017-02-13  9:40   ` Hans Verkuil
  2017-02-13  9:48     ` Sakari Ailus
@ 2017-02-13  9:49     ` Philipp Zabel
  1 sibling, 0 replies; 11+ messages in thread
From: Philipp Zabel @ 2017-02-13  9:49 UTC (permalink / raw)
  To: Hans Verkuil
  Cc: linux-media, Laurent Pinchart, Steve Longerbeam, Sakari Ailus

On Mon, 2017-02-13 at 10:40 +0100, Hans Verkuil wrote:
> On 02/13/2017 10:33 AM, Philipp Zabel wrote:
> > media-ctl can be used to propagate v4l2 subdevice pad formats from
> > source pads of one subdevice to another one's sink pads. These formats
> > include colorimetry information, so media-ctl should be able to print
> > or change it using the --set/get-v4l2 option.
> > 
> > Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> > Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> 
> Just one small comment:
> 
> > ---
> >  utils/media-ctl/libv4l2subdev.c | 263 ++++++++++++++++++++++++++++++++++++++++
> >  utils/media-ctl/media-ctl.c     |  17 +++
> >  utils/media-ctl/options.c       |  22 +++-
> >  utils/media-ctl/v4l2subdev.h    |  80 ++++++++++++
> >  4 files changed, 381 insertions(+), 1 deletion(-)
> > 
> > diff --git a/utils/media-ctl/libv4l2subdev.c b/utils/media-ctl/libv4l2subdev.c
> > index 7f9ef48..c918777 100644
> > --- a/utils/media-ctl/libv4l2subdev.c
> > +++ b/utils/media-ctl/libv4l2subdev.c
> > @@ -511,6 +511,118 @@ static struct media_pad *v4l2_subdev_parse_pad_format(
> >  			continue;
> >  		}
> >  
> > +		if (strhazit("colorspace:", &p)) {
> > +			enum v4l2_colorspace colorspace;
> > +			char *strfield;
> > +
> > +			for (end = (char *)p; isalnum(*end) || *end == '-';
> > +			     ++end);
> > +
> > +			strfield = strndup(p, end - p);
> > +			if (!strfield) {
> > +				*endp = (char *)p;
> > +				return NULL;
> > +			}
> > +
> > +			colorspace = v4l2_subdev_string_to_colorspace(strfield);
> > +			free(strfield);
> > +			if (colorspace == (enum v4l2_colorspace)-1) {
> > +				media_dbg(media, "Invalid colorspace value '%*s'\n",
> > +					  end - p, p);
> > +				*endp = (char *)p;
> > +				return NULL;
> > +			}
> > +
> > +			format->colorspace = colorspace;
> > +
> > +			p = end;
> > +			continue;
> > +		}
> > +
> > +		if (strhazit("xfer:", &p)) {
> > +			enum v4l2_xfer_func xfer_func;
> > +			char *strfield;
> > +
> > +			for (end = (char *)p; isalnum(*end) || *end == '-';
> > +			     ++end);
> > +
> > +			strfield = strndup(p, end - p);
> > +			if (!strfield) {
> > +				*endp = (char *)p;
> > +				return NULL;
> > +			}
> > +
> > +			xfer_func = v4l2_subdev_string_to_xfer_func(strfield);
> > +			free(strfield);
> > +			if (xfer_func == (enum v4l2_xfer_func)-1) {
> > +				media_dbg(media, "Invalid transfer function value '%*s'\n",
> > +					  end - p, p);
> > +				*endp = (char *)p;
> > +				return NULL;
> > +			}
> > +
> > +			format->xfer_func = xfer_func;
> > +
> > +			p = end;
> > +			continue;
> > +		}
> > +
> > +		if (strhazit("ycbcr:", &p)) {
> > +			enum v4l2_ycbcr_encoding ycbcr_enc;
> > +			char *strfield;
> > +
> > +			for (end = (char *)p; isalnum(*end) || *end == '-';
> > +			     ++end);
> > +
> > +			strfield = strndup(p, end - p);
> > +			if (!strfield) {
> > +				*endp = (char *)p;
> > +				return NULL;
> > +			}
> > +
> > +			ycbcr_enc = v4l2_subdev_string_to_ycbcr_encoding(strfield);
> > +			free(strfield);
> > +			if (ycbcr_enc == (enum v4l2_ycbcr_encoding)-1) {
> > +				media_dbg(media, "Invalid YCbCr encoding value '%*s'\n",
> > +					  end - p, p);
> > +				*endp = (char *)p;
> > +				return NULL;
> > +			}
> > +
> > +			format->ycbcr_enc = ycbcr_enc;
> > +
> > +			p = end;
> > +			continue;
> > +		}
> > +
> > +		if (strhazit("quantization:", &p)) {
> > +			enum v4l2_quantization quantization;
> > +			char *strfield;
> > +
> > +			for (end = (char *)p; isalnum(*end) || *end == '-';
> > +			     ++end);
> > +
> > +			strfield = strndup(p, end - p);
> > +			if (!strfield) {
> > +				*endp = (char *)p;
> > +				return NULL;
> > +			}
> > +
> > +			quantization = v4l2_subdev_string_to_quantization(strfield);
> > +			free(strfield);
> > +			if (quantization == (enum v4l2_quantization)-1) {
> > +				media_dbg(media, "Invalid quantization value '%*s'\n",
> > +					  end - p, p);
> > +				*endp = (char *)p;
> > +				return NULL;
> > +			}
> > +
> > +			format->quantization = quantization;
> > +
> > +			p = end;
> > +			continue;
> > +		}
> > +
> >  		/*
> >  		 * Backward compatibility: crop rectangles can be specified
> >  		 * implicitly without the 'crop:' property name.
> > @@ -839,6 +951,157 @@ enum v4l2_field v4l2_subdev_string_to_field(const char *string)
> >  	return (enum v4l2_field)-1;
> >  }
> >  
> > +static struct {
> > +	const char *name;
> > +	enum v4l2_colorspace colorspace;
> > +} colorspaces[] = {
> > +	{ "default", V4L2_COLORSPACE_DEFAULT },
> > +	{ "smpte170m", V4L2_COLORSPACE_SMPTE170M },
> > +	{ "smpte240m", V4L2_COLORSPACE_SMPTE240M },
> > +	{ "rec709", V4L2_COLORSPACE_REC709 },
> > +	{ "bt878", V4L2_COLORSPACE_BT878 },
> 
> Drop this, it's no longer used in the kernel.

Done, thanks.

regards
Philipp

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

* Re: [PATCH v2 4/4] media-ctl: add colorimetry support
  2017-02-13  9:48     ` Sakari Ailus
@ 2017-02-13  9:58       ` Hans Verkuil
  2017-02-13 10:02       ` Philipp Zabel
  1 sibling, 0 replies; 11+ messages in thread
From: Hans Verkuil @ 2017-02-13  9:58 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: Philipp Zabel, linux-media, Laurent Pinchart, Steve Longerbeam

On 02/13/2017 10:48 AM, Sakari Ailus wrote:
> Hi Hans,
> 
> On Mon, Feb 13, 2017 at 10:40:41AM +0100, Hans Verkuil wrote:
> ...
>>> @@ -839,6 +951,157 @@ enum v4l2_field v4l2_subdev_string_to_field(const char *string)
>>>  	return (enum v4l2_field)-1;
>>>  }
>>>  
>>> +static struct {
>>> +	const char *name;
>>> +	enum v4l2_colorspace colorspace;
>>> +} colorspaces[] = {
>>> +	{ "default", V4L2_COLORSPACE_DEFAULT },
>>> +	{ "smpte170m", V4L2_COLORSPACE_SMPTE170M },
>>> +	{ "smpte240m", V4L2_COLORSPACE_SMPTE240M },
>>> +	{ "rec709", V4L2_COLORSPACE_REC709 },
>>> +	{ "bt878", V4L2_COLORSPACE_BT878 },
>>
>> Drop this, it's no longer used in the kernel.
> 
> What about older kernels? Were there drivers that reported it?
> 

Possibly in a very distant past. But certainly not in anything supporting subdevs.

I looked into this when I worked on colorspaces and from what I could gather it
was based on a misunderstanding what a colorspace really is and it was just a
bogus 'colorspace'.

Regards,

	Hans

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

* Re: [PATCH v2 4/4] media-ctl: add colorimetry support
  2017-02-13  9:48     ` Sakari Ailus
  2017-02-13  9:58       ` Hans Verkuil
@ 2017-02-13 10:02       ` Philipp Zabel
  2017-02-13 10:05         ` Sakari Ailus
  2017-02-13 10:06         ` Hans Verkuil
  1 sibling, 2 replies; 11+ messages in thread
From: Philipp Zabel @ 2017-02-13 10:02 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: Hans Verkuil, linux-media, Laurent Pinchart, Steve Longerbeam

On Mon, 2017-02-13 at 11:48 +0200, Sakari Ailus wrote:
> Hi Hans,
> 
> On Mon, Feb 13, 2017 at 10:40:41AM +0100, Hans Verkuil wrote:
> ...
> > > @@ -839,6 +951,157 @@ enum v4l2_field v4l2_subdev_string_to_field(const char *string)
> > >  	return (enum v4l2_field)-1;
> > >  }
> > >  
> > > +static struct {
> > > +	const char *name;
> > > +	enum v4l2_colorspace colorspace;
> > > +} colorspaces[] = {
> > > +	{ "default", V4L2_COLORSPACE_DEFAULT },
> > > +	{ "smpte170m", V4L2_COLORSPACE_SMPTE170M },
> > > +	{ "smpte240m", V4L2_COLORSPACE_SMPTE240M },
> > > +	{ "rec709", V4L2_COLORSPACE_REC709 },
> > > +	{ "bt878", V4L2_COLORSPACE_BT878 },
> > 
> > Drop this, it's no longer used in the kernel.
> 
> What about older kernels? Were there drivers that reported it?

Has there ever been a v4l2 subdevice that reported bt878 colorspace on a
pad via VIDIOC_SUBDEV_G_FMT?

regards
Philipp

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

* Re: [PATCH v2 4/4] media-ctl: add colorimetry support
  2017-02-13 10:02       ` Philipp Zabel
@ 2017-02-13 10:05         ` Sakari Ailus
  2017-02-13 10:06         ` Hans Verkuil
  1 sibling, 0 replies; 11+ messages in thread
From: Sakari Ailus @ 2017-02-13 10:05 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: Hans Verkuil, linux-media, Laurent Pinchart, Steve Longerbeam

On Mon, Feb 13, 2017 at 11:02:42AM +0100, Philipp Zabel wrote:
> On Mon, 2017-02-13 at 11:48 +0200, Sakari Ailus wrote:
> > Hi Hans,
> > 
> > On Mon, Feb 13, 2017 at 10:40:41AM +0100, Hans Verkuil wrote:
> > ...
> > > > @@ -839,6 +951,157 @@ enum v4l2_field v4l2_subdev_string_to_field(const char *string)
> > > >  	return (enum v4l2_field)-1;
> > > >  }
> > > >  
> > > > +static struct {
> > > > +	const char *name;
> > > > +	enum v4l2_colorspace colorspace;
> > > > +} colorspaces[] = {
> > > > +	{ "default", V4L2_COLORSPACE_DEFAULT },
> > > > +	{ "smpte170m", V4L2_COLORSPACE_SMPTE170M },
> > > > +	{ "smpte240m", V4L2_COLORSPACE_SMPTE240M },
> > > > +	{ "rec709", V4L2_COLORSPACE_REC709 },
> > > > +	{ "bt878", V4L2_COLORSPACE_BT878 },
> > > 
> > > Drop this, it's no longer used in the kernel.
> > 
> > What about older kernels? Were there drivers that reported it?
> 
> Has there ever been a v4l2 subdevice that reported bt878 colorspace on a
> pad via VIDIOC_SUBDEV_G_FMT?

Based on Hans's reply, no. So let's remove that.

-- 
Sakari Ailus
e-mail: sakari.ailus@iki.fi	XMPP: sailus@retiisi.org.uk

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

* Re: [PATCH v2 4/4] media-ctl: add colorimetry support
  2017-02-13 10:02       ` Philipp Zabel
  2017-02-13 10:05         ` Sakari Ailus
@ 2017-02-13 10:06         ` Hans Verkuil
  1 sibling, 0 replies; 11+ messages in thread
From: Hans Verkuil @ 2017-02-13 10:06 UTC (permalink / raw)
  To: Philipp Zabel, Sakari Ailus
  Cc: linux-media, Laurent Pinchart, Steve Longerbeam

On 02/13/2017 11:02 AM, Philipp Zabel wrote:
> On Mon, 2017-02-13 at 11:48 +0200, Sakari Ailus wrote:
>> Hi Hans,
>>
>> On Mon, Feb 13, 2017 at 10:40:41AM +0100, Hans Verkuil wrote:
>> ...
>>>> @@ -839,6 +951,157 @@ enum v4l2_field v4l2_subdev_string_to_field(const char *string)
>>>>  	return (enum v4l2_field)-1;
>>>>  }
>>>>  
>>>> +static struct {
>>>> +	const char *name;
>>>> +	enum v4l2_colorspace colorspace;
>>>> +} colorspaces[] = {
>>>> +	{ "default", V4L2_COLORSPACE_DEFAULT },
>>>> +	{ "smpte170m", V4L2_COLORSPACE_SMPTE170M },
>>>> +	{ "smpte240m", V4L2_COLORSPACE_SMPTE240M },
>>>> +	{ "rec709", V4L2_COLORSPACE_REC709 },
>>>> +	{ "bt878", V4L2_COLORSPACE_BT878 },
>>>
>>> Drop this, it's no longer used in the kernel.
>>
>> What about older kernels? Were there drivers that reported it?
> 
> Has there ever been a v4l2 subdevice that reported bt878 colorspace on a
> pad via VIDIOC_SUBDEV_G_FMT?

No, never. If it was ever used it would be specific to the bttv driver which
doesn't use subdev ioctls.

	Hans

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

end of thread, other threads:[~2017-02-13 10:06 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-13  9:33 [PATCH v2 1/4] media-ctl: add pad support to set/get_frame_interval Philipp Zabel
2017-02-13  9:33 ` [PATCH v2 2/4] media-ctl: print the configured frame interval Philipp Zabel
2017-02-13  9:33 ` [PATCH v2 3/4] media-ctl: propagate " Philipp Zabel
2017-02-13  9:33 ` [PATCH v2 4/4] media-ctl: add colorimetry support Philipp Zabel
2017-02-13  9:40   ` Hans Verkuil
2017-02-13  9:48     ` Sakari Ailus
2017-02-13  9:58       ` Hans Verkuil
2017-02-13 10:02       ` Philipp Zabel
2017-02-13 10:05         ` Sakari Ailus
2017-02-13 10:06         ` Hans Verkuil
2017-02-13  9:49     ` Philipp Zabel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.