All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] v4l: vsp1: Add support for capture and output in HSV formats
@ 2016-09-07  0:14 Laurent Pinchart
  2016-09-07  7:07 ` Ricardo Ribalda Delgado
  2016-09-07  7:48 ` Hans Verkuil
  0 siblings, 2 replies; 5+ messages in thread
From: Laurent Pinchart @ 2016-09-07  0:14 UTC (permalink / raw)
  To: linux-media
  Cc: linux-renesas-soc, Ricardo Ribalda Delgado, Niklas Söderlund

Support both the HSV24 and HSV32 formats. From a hardware point of view
pretend the formats are RGB, the RPF and WPF will just pass the data
through without performing any processing.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---

This patch is based on top of Ricardo's "[PATCH v5 00/12] Add HSV format"
series. I have tested it with the VSP test suite available at

	git://git.ideasonboard.com/renesas/vsp-tests.git hsv

 drivers/media/platform/vsp1/vsp1_pipe.c  | 8 ++++++++
 drivers/media/platform/vsp1/vsp1_rwpf.c  | 2 ++
 drivers/media/platform/vsp1/vsp1_video.c | 5 +++++
 3 files changed, 15 insertions(+)

diff --git a/drivers/media/platform/vsp1/vsp1_pipe.c b/drivers/media/platform/vsp1/vsp1_pipe.c
index 052a6037b9cb..c0b8641d2158 100644
--- a/drivers/media/platform/vsp1/vsp1_pipe.c
+++ b/drivers/media/platform/vsp1/vsp1_pipe.c
@@ -80,6 +80,14 @@ static const struct vsp1_format_info vsp1_video_formats[] = {
 	  VI6_FMT_ARGB_8888, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS |
 	  VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS,
 	  1, { 32, 0, 0 }, false, false, 1, 1, false },
+	{ V4L2_PIX_FMT_HSV24, MEDIA_BUS_FMT_AHSV8888_1X32,
+	  VI6_FMT_RGB_888, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS |
+	  VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS,
+	  1, { 24, 0, 0 }, false, false, 1, 1, false },
+	{ V4L2_PIX_FMT_HSV32, MEDIA_BUS_FMT_AHSV8888_1X32,
+	  VI6_FMT_ARGB_8888, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS |
+	  VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS,
+	  1, { 32, 0, 0 }, false, false, 1, 1, false },
 	{ V4L2_PIX_FMT_UYVY, MEDIA_BUS_FMT_AYUV8_1X32,
 	  VI6_FMT_YUYV_422, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS |
 	  VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS,
diff --git a/drivers/media/platform/vsp1/vsp1_rwpf.c b/drivers/media/platform/vsp1/vsp1_rwpf.c
index 8d461b375e91..13e969ac1538 100644
--- a/drivers/media/platform/vsp1/vsp1_rwpf.c
+++ b/drivers/media/platform/vsp1/vsp1_rwpf.c
@@ -37,6 +37,7 @@ static int vsp1_rwpf_enum_mbus_code(struct v4l2_subdev *subdev,
 {
 	static const unsigned int codes[] = {
 		MEDIA_BUS_FMT_ARGB8888_1X32,
+		MEDIA_BUS_FMT_AHSV8888_1X32,
 		MEDIA_BUS_FMT_AYUV8_1X32,
 	};
 
@@ -74,6 +75,7 @@ static int vsp1_rwpf_set_format(struct v4l2_subdev *subdev,
 
 	/* Default to YUV if the requested format is not supported. */
 	if (fmt->format.code != MEDIA_BUS_FMT_ARGB8888_1X32 &&
+	    fmt->format.code != MEDIA_BUS_FMT_AHSV8888_1X32 &&
 	    fmt->format.code != MEDIA_BUS_FMT_AYUV8_1X32)
 		fmt->format.code = MEDIA_BUS_FMT_AYUV8_1X32;
 
diff --git a/drivers/media/platform/vsp1/vsp1_video.c b/drivers/media/platform/vsp1/vsp1_video.c
index 7215e08eff6e..325377d7c444 100644
--- a/drivers/media/platform/vsp1/vsp1_video.c
+++ b/drivers/media/platform/vsp1/vsp1_video.c
@@ -126,6 +126,11 @@ static int __vsp1_video_try_format(struct vsp1_video *video,
 	pix->pixelformat = info->fourcc;
 	pix->colorspace = V4L2_COLORSPACE_SRGB;
 	pix->field = V4L2_FIELD_NONE;
+
+	if (info->fourcc == V4L2_PIX_FMT_HSV24 ||
+	    info->fourcc == V4L2_PIX_FMT_HSV32)
+		pix->hsv_enc = V4L2_HSV_ENC_256;
+
 	memset(pix->reserved, 0, sizeof(pix->reserved));
 
 	/* Align the width and height for YUV 4:2:2 and 4:2:0 formats. */
-- 
Regards,

Laurent Pinchart


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

* Re: [PATCH] v4l: vsp1: Add support for capture and output in HSV formats
  2016-09-07  0:14 [PATCH] v4l: vsp1: Add support for capture and output in HSV formats Laurent Pinchart
@ 2016-09-07  7:07 ` Ricardo Ribalda Delgado
  2016-09-07  7:09   ` Laurent Pinchart
  2016-09-07  7:48 ` Hans Verkuil
  1 sibling, 1 reply; 5+ messages in thread
From: Ricardo Ribalda Delgado @ 2016-09-07  7:07 UTC (permalink / raw)
  To: Laurent Pinchart, Mauro Carvalho Chehab, Hans Verkuil
  Cc: linux-media, linux-renesas-soc, Niklas Söderlund

Hi Laurent

Thank you very much!

On Wed, Sep 7, 2016 at 2:14 AM, Laurent Pinchart
<laurent.pinchart+renesas@ideasonboard.com> wrote:
> Support both the HSV24 and HSV32 formats. From a hardware point of view
> pretend the formats are RGB, the RPF and WPF will just pass the data
> through without performing any processing.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>

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

* Re: [PATCH] v4l: vsp1: Add support for capture and output in HSV formats
  2016-09-07  7:07 ` Ricardo Ribalda Delgado
@ 2016-09-07  7:09   ` Laurent Pinchart
  2016-09-07  7:12     ` Ricardo Ribalda Delgado
  0 siblings, 1 reply; 5+ messages in thread
From: Laurent Pinchart @ 2016-09-07  7:09 UTC (permalink / raw)
  To: Ricardo Ribalda Delgado
  Cc: Laurent Pinchart, Mauro Carvalho Chehab, Hans Verkuil,
	linux-media, linux-renesas-soc, Niklas Söderlund

Hi Ricardo,

On Wednesday 07 Sep 2016 09:07:35 Ricardo Ribalda Delgado wrote:
> Hi Laurent
> 
> Thank you very much!

You're welcome.

> On Wed, Sep 7, 2016 at 2:14 AM, Laurent Pinchart wrote:
> > Support both the HSV24 and HSV32 formats. From a hardware point of view
> > pretend the formats are RGB, the RPF and WPF will just pass the data
> > through without performing any processing.
> 
> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>

Do you mean Acked-by ?

Feel free to take the patch in your tree to get it merged along with the HSV 
series.

-- 
Regards,

Laurent Pinchart


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

* Re: [PATCH] v4l: vsp1: Add support for capture and output in HSV formats
  2016-09-07  7:09   ` Laurent Pinchart
@ 2016-09-07  7:12     ` Ricardo Ribalda Delgado
  0 siblings, 0 replies; 5+ messages in thread
From: Ricardo Ribalda Delgado @ 2016-09-07  7:12 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Laurent Pinchart, Mauro Carvalho Chehab, Hans Verkuil,
	linux-media, linux-renesas-soc, Niklas Söderlund

Hi Laurent,

On Wed, Sep 7, 2016 at 9:09 AM, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>>
>> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
>
> Do you mean Acked-by ?

Acked-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>

Ups, my bad


>
> Feel free to take the patch in your tree to get it merged along with the HSV
> series.


I do not really have a tree, I have a github account that is it.

Let me ask Hans on the irc how to procede from here.

I really appreciate your help!

-- 
Ricardo Ribalda

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

* Re: [PATCH] v4l: vsp1: Add support for capture and output in HSV formats
  2016-09-07  0:14 [PATCH] v4l: vsp1: Add support for capture and output in HSV formats Laurent Pinchart
  2016-09-07  7:07 ` Ricardo Ribalda Delgado
@ 2016-09-07  7:48 ` Hans Verkuil
  1 sibling, 0 replies; 5+ messages in thread
From: Hans Verkuil @ 2016-09-07  7:48 UTC (permalink / raw)
  To: Laurent Pinchart, linux-media
  Cc: linux-renesas-soc, Ricardo Ribalda Delgado, Niklas Söderlund

On 09/07/16 02:14, Laurent Pinchart wrote:
> Support both the HSV24 and HSV32 formats. From a hardware point of view
> pretend the formats are RGB, the RPF and WPF will just pass the data
> through without performing any processing.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>

Regards,

	Hans

> ---
>
> This patch is based on top of Ricardo's "[PATCH v5 00/12] Add HSV format"
> series. I have tested it with the VSP test suite available at
>
> 	git://git.ideasonboard.com/renesas/vsp-tests.git hsv
>
>  drivers/media/platform/vsp1/vsp1_pipe.c  | 8 ++++++++
>  drivers/media/platform/vsp1/vsp1_rwpf.c  | 2 ++
>  drivers/media/platform/vsp1/vsp1_video.c | 5 +++++
>  3 files changed, 15 insertions(+)
>
> diff --git a/drivers/media/platform/vsp1/vsp1_pipe.c b/drivers/media/platform/vsp1/vsp1_pipe.c
> index 052a6037b9cb..c0b8641d2158 100644
> --- a/drivers/media/platform/vsp1/vsp1_pipe.c
> +++ b/drivers/media/platform/vsp1/vsp1_pipe.c
> @@ -80,6 +80,14 @@ static const struct vsp1_format_info vsp1_video_formats[] = {
>  	  VI6_FMT_ARGB_8888, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS |
>  	  VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS,
>  	  1, { 32, 0, 0 }, false, false, 1, 1, false },
> +	{ V4L2_PIX_FMT_HSV24, MEDIA_BUS_FMT_AHSV8888_1X32,
> +	  VI6_FMT_RGB_888, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS |
> +	  VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS,
> +	  1, { 24, 0, 0 }, false, false, 1, 1, false },
> +	{ V4L2_PIX_FMT_HSV32, MEDIA_BUS_FMT_AHSV8888_1X32,
> +	  VI6_FMT_ARGB_8888, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS |
> +	  VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS,
> +	  1, { 32, 0, 0 }, false, false, 1, 1, false },
>  	{ V4L2_PIX_FMT_UYVY, MEDIA_BUS_FMT_AYUV8_1X32,
>  	  VI6_FMT_YUYV_422, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS |
>  	  VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS,
> diff --git a/drivers/media/platform/vsp1/vsp1_rwpf.c b/drivers/media/platform/vsp1/vsp1_rwpf.c
> index 8d461b375e91..13e969ac1538 100644
> --- a/drivers/media/platform/vsp1/vsp1_rwpf.c
> +++ b/drivers/media/platform/vsp1/vsp1_rwpf.c
> @@ -37,6 +37,7 @@ static int vsp1_rwpf_enum_mbus_code(struct v4l2_subdev *subdev,
>  {
>  	static const unsigned int codes[] = {
>  		MEDIA_BUS_FMT_ARGB8888_1X32,
> +		MEDIA_BUS_FMT_AHSV8888_1X32,
>  		MEDIA_BUS_FMT_AYUV8_1X32,
>  	};
>
> @@ -74,6 +75,7 @@ static int vsp1_rwpf_set_format(struct v4l2_subdev *subdev,
>
>  	/* Default to YUV if the requested format is not supported. */
>  	if (fmt->format.code != MEDIA_BUS_FMT_ARGB8888_1X32 &&
> +	    fmt->format.code != MEDIA_BUS_FMT_AHSV8888_1X32 &&
>  	    fmt->format.code != MEDIA_BUS_FMT_AYUV8_1X32)
>  		fmt->format.code = MEDIA_BUS_FMT_AYUV8_1X32;
>
> diff --git a/drivers/media/platform/vsp1/vsp1_video.c b/drivers/media/platform/vsp1/vsp1_video.c
> index 7215e08eff6e..325377d7c444 100644
> --- a/drivers/media/platform/vsp1/vsp1_video.c
> +++ b/drivers/media/platform/vsp1/vsp1_video.c
> @@ -126,6 +126,11 @@ static int __vsp1_video_try_format(struct vsp1_video *video,
>  	pix->pixelformat = info->fourcc;
>  	pix->colorspace = V4L2_COLORSPACE_SRGB;
>  	pix->field = V4L2_FIELD_NONE;
> +
> +	if (info->fourcc == V4L2_PIX_FMT_HSV24 ||
> +	    info->fourcc == V4L2_PIX_FMT_HSV32)
> +		pix->hsv_enc = V4L2_HSV_ENC_256;
> +
>  	memset(pix->reserved, 0, sizeof(pix->reserved));
>
>  	/* Align the width and height for YUV 4:2:2 and 4:2:0 formats. */
>

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

end of thread, other threads:[~2016-09-07  7:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-07  0:14 [PATCH] v4l: vsp1: Add support for capture and output in HSV formats Laurent Pinchart
2016-09-07  7:07 ` Ricardo Ribalda Delgado
2016-09-07  7:09   ` Laurent Pinchart
2016-09-07  7:12     ` Ricardo Ribalda Delgado
2016-09-07  7:48 ` Hans Verkuil

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.