linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] v4l2-tpg: Init hv_enc field with a valid value
@ 2016-11-15 12:06 Ricardo Ribalda Delgado
  2016-11-15 12:06 ` [PATCH 2/2] vivid: Set color_enc on HSV formats Ricardo Ribalda Delgado
  0 siblings, 1 reply; 2+ messages in thread
From: Ricardo Ribalda Delgado @ 2016-11-15 12:06 UTC (permalink / raw)
  To: Hans Verkuil, Mauro Carvalho Chehab, linux-media, linux-kernel
  Cc: Ricardo Ribalda Delgado

Zero is not a valid value for hsv_enc. Set the field to a valid
initial value.

This is not a problem for vivid, because it sets the field to 180 via
tpg_s_hsv_enc() on the control initialization, but it might be a source
of errors for other drivers that use this code.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
---
 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c b/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
index 28d7b072d867..e47b46e2d26c 100644
--- a/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
+++ b/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
@@ -117,6 +117,7 @@ void tpg_init(struct tpg_data *tpg, unsigned w, unsigned h)
 	tpg_s_fourcc(tpg, V4L2_PIX_FMT_RGB24);
 	tpg->colorspace = V4L2_COLORSPACE_SRGB;
 	tpg->perc_fill = 100;
+	tpg->hsv_enc = V4L2_HSV_ENC_180;
 }
 EXPORT_SYMBOL_GPL(tpg_init);
 
-- 
2.10.2

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

* [PATCH 2/2] vivid: Set color_enc on HSV formats
  2016-11-15 12:06 [PATCH 1/2] v4l2-tpg: Init hv_enc field with a valid value Ricardo Ribalda Delgado
@ 2016-11-15 12:06 ` Ricardo Ribalda Delgado
  0 siblings, 0 replies; 2+ messages in thread
From: Ricardo Ribalda Delgado @ 2016-11-15 12:06 UTC (permalink / raw)
  To: Hans Verkuil, Mauro Carvalho Chehab, linux-media, linux-kernel
  Cc: Ricardo Ribalda Delgado

HSV formats were missing the color encoding, which leads to an invalid
ycbcr_enc value during get_fmt and try_fmt.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
---
 drivers/media/platform/vivid/vivid-vid-common.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/platform/vivid/vivid-vid-common.c b/drivers/media/platform/vivid/vivid-vid-common.c
index 3d003fb913ed..5fc010f6ce67 100644
--- a/drivers/media/platform/vivid/vivid-vid-common.c
+++ b/drivers/media/platform/vivid/vivid-vid-common.c
@@ -447,6 +447,7 @@ struct vivid_fmt vivid_formats[] = {
 	},
 	{
 		.fourcc   = V4L2_PIX_FMT_HSV24, /* HSV 24bits */
+		.color_enc = TGP_COLOR_ENC_HSV,
 		.vdownsampling = { 1 },
 		.bit_depth = { 24 },
 		.planes   = 1,
@@ -454,6 +455,7 @@ struct vivid_fmt vivid_formats[] = {
 	},
 	{
 		.fourcc   = V4L2_PIX_FMT_HSV32, /* HSV 32bits */
+		.color_enc = TGP_COLOR_ENC_HSV,
 		.vdownsampling = { 1 },
 		.bit_depth = { 32 },
 		.planes   = 1,
-- 
2.10.2

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

end of thread, other threads:[~2016-11-15 12:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-15 12:06 [PATCH 1/2] v4l2-tpg: Init hv_enc field with a valid value Ricardo Ribalda Delgado
2016-11-15 12:06 ` [PATCH 2/2] vivid: Set color_enc on HSV formats Ricardo Ribalda Delgado

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).