All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] media: v4l2-tpg-core: Add 16-bit bayer
@ 2018-10-08 12:29 bwinther
  2018-10-08 12:29 ` [PATCH 2/2] media: vivid: Add 16-bit bayer to format list bwinther
  0 siblings, 1 reply; 4+ messages in thread
From: bwinther @ 2018-10-08 12:29 UTC (permalink / raw)
  To: linux-media; +Cc: hans.verkuil, Bård Eirik Winther

From: Bård Eirik Winther <bwinther@cisco.com>

Add 16-bit bayer formats to the test pattern generator, namely
  V4L2_PIX_FMT_SRGGB16
  V4L2_PIX_FMT_SGRBG16
  V4L2_PIX_FMT_SGBRG16
  V4L2_PIX_FMT_SBGGR16

Signed-off-by: Bård Eirik Winther <bwinther@cisco.com>
---
 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c | 28 +++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c b/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
index f3d9c1140ffa..76b125ebee6d 100644
--- a/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
+++ b/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
@@ -202,6 +202,10 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc)
 	case V4L2_PIX_FMT_SGBRG12:
 	case V4L2_PIX_FMT_SGRBG12:
 	case V4L2_PIX_FMT_SRGGB12:
+	case V4L2_PIX_FMT_SBGGR16:
+	case V4L2_PIX_FMT_SGBRG16:
+	case V4L2_PIX_FMT_SGRBG16:
+	case V4L2_PIX_FMT_SRGGB16:
 		tpg->interleaved = true;
 		tpg->vdownsampling[1] = 1;
 		tpg->hdownsampling[1] = 1;
@@ -394,6 +398,10 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc)
 	case V4L2_PIX_FMT_SGRBG12:
 	case V4L2_PIX_FMT_SGBRG12:
 	case V4L2_PIX_FMT_SBGGR12:
+	case V4L2_PIX_FMT_SRGGB16:
+	case V4L2_PIX_FMT_SGRBG16:
+	case V4L2_PIX_FMT_SGBRG16:
+	case V4L2_PIX_FMT_SBGGR16:
 		tpg->twopixelsize[0] = 4;
 		tpg->twopixelsize[1] = 4;
 		break;
@@ -1358,6 +1366,22 @@ static void gen_twopix(struct tpg_data *tpg,
 		buf[0][offset] |= (buf[0][offset] >> 4) & 0xf;
 		buf[1][offset] |= (buf[1][offset] >> 4) & 0xf;
 		break;
+	case V4L2_PIX_FMT_SBGGR16:
+		buf[0][offset] = buf[0][offset + 1] = odd ? g_u_s : b_v;
+		buf[1][offset] = buf[1][offset + 1] = odd ? r_y_h : g_u_s;
+		break;
+	case V4L2_PIX_FMT_SGBRG16:
+		buf[0][offset] = buf[0][offset + 1] = odd ? b_v : g_u_s;
+		buf[1][offset] = buf[1][offset + 1] = odd ? g_u_s : r_y_h;
+		break;
+	case V4L2_PIX_FMT_SGRBG16:
+		buf[0][offset] = buf[0][offset + 1] = odd ? r_y_h : g_u_s;
+		buf[1][offset] = buf[1][offset + 1] = odd ? g_u_s : b_v;
+		break;
+	case V4L2_PIX_FMT_SRGGB16:
+		buf[0][offset] = buf[0][offset + 1] = odd ? g_u_s : r_y_h;
+		buf[1][offset] = buf[1][offset + 1] = odd ? b_v : g_u_s;
+		break;
 	}
 }
 
@@ -1376,6 +1400,10 @@ unsigned tpg_g_interleaved_plane(const struct tpg_data *tpg, unsigned buf_line)
 	case V4L2_PIX_FMT_SGBRG12:
 	case V4L2_PIX_FMT_SGRBG12:
 	case V4L2_PIX_FMT_SRGGB12:
+	case V4L2_PIX_FMT_SBGGR16:
+	case V4L2_PIX_FMT_SGBRG16:
+	case V4L2_PIX_FMT_SGRBG16:
+	case V4L2_PIX_FMT_SRGGB16:
 		return buf_line & 1;
 	default:
 		return 0;
-- 
2.17.1

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

* [PATCH 2/2] media: vivid: Add 16-bit bayer to format list
  2018-10-08 12:29 [PATCH 1/2] media: v4l2-tpg-core: Add 16-bit bayer bwinther
@ 2018-10-08 12:29 ` bwinther
  0 siblings, 0 replies; 4+ messages in thread
From: bwinther @ 2018-10-08 12:29 UTC (permalink / raw)
  To: linux-media; +Cc: hans.verkuil, Bård Eirik Winther

From: Bård Eirik Winther <bwinther@cisco.com>

New 16-bit bayer options are available in tpg so enable them in vivid.

Signed-off-by: Bård Eirik Winther <bwinther@cisco.com>
---
 .../media/platform/vivid/vivid-vid-common.c   | 28 +++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/drivers/media/platform/vivid/vivid-vid-common.c b/drivers/media/platform/vivid/vivid-vid-common.c
index 27a0000a5973..9645a91b8782 100644
--- a/drivers/media/platform/vivid/vivid-vid-common.c
+++ b/drivers/media/platform/vivid/vivid-vid-common.c
@@ -449,6 +449,34 @@ struct vivid_fmt vivid_formats[] = {
 		.planes   = 1,
 		.buffers = 1,
 	},
+	{
+		.fourcc   = V4L2_PIX_FMT_SBGGR16, /* Bayer BG/GR */
+		.vdownsampling = { 1 },
+		.bit_depth = { 16 },
+		.planes   = 1,
+		.buffers = 1,
+	},
+	{
+		.fourcc   = V4L2_PIX_FMT_SGBRG16, /* Bayer GB/RG */
+		.vdownsampling = { 1 },
+		.bit_depth = { 16 },
+		.planes   = 1,
+		.buffers = 1,
+	},
+	{
+		.fourcc   = V4L2_PIX_FMT_SGRBG16, /* Bayer GR/BG */
+		.vdownsampling = { 1 },
+		.bit_depth = { 16 },
+		.planes   = 1,
+		.buffers = 1,
+	},
+	{
+		.fourcc   = V4L2_PIX_FMT_SRGGB16, /* Bayer RG/GB */
+		.vdownsampling = { 1 },
+		.bit_depth = { 16 },
+		.planes   = 1,
+		.buffers = 1,
+	},
 	{
 		.fourcc   = V4L2_PIX_FMT_HSV24, /* HSV 24bits */
 		.color_enc = TGP_COLOR_ENC_HSV,
-- 
2.17.1

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

* Re: [PATCH 2/2] media: vivid: Add 16-bit bayer to format list
  2018-10-04 11:01 ` [PATCH 2/2] media: vivid: Add 16-bit bayer to format list bwinther
@ 2018-10-04 11:16   ` Hans Verkuil
  0 siblings, 0 replies; 4+ messages in thread
From: Hans Verkuil @ 2018-10-04 11:16 UTC (permalink / raw)
  To: bwinther, linux-media; +Cc: hans.verkuil

On 10/04/18 13:01, bwinther@cisco.com wrote:
> From: Bård Eirik Winther <bwinther@cisco.com>
> 

Same here: missing commit message.

This patch looks good otherwise.

Regards,

	Hans

> Signed-off-by: Bård Eirik Winther <bwinther@cisco.com>
> ---
>  .../media/platform/vivid/vivid-vid-common.c   | 28 +++++++++++++++++++
>  1 file changed, 28 insertions(+)
> 
> diff --git a/drivers/media/platform/vivid/vivid-vid-common.c b/drivers/media/platform/vivid/vivid-vid-common.c
> index 27a0000a5973..9645a91b8782 100644
> --- a/drivers/media/platform/vivid/vivid-vid-common.c
> +++ b/drivers/media/platform/vivid/vivid-vid-common.c
> @@ -449,6 +449,34 @@ struct vivid_fmt vivid_formats[] = {
>  		.planes   = 1,
>  		.buffers = 1,
>  	},
> +	{
> +		.fourcc   = V4L2_PIX_FMT_SBGGR16, /* Bayer BG/GR */
> +		.vdownsampling = { 1 },
> +		.bit_depth = { 16 },
> +		.planes   = 1,
> +		.buffers = 1,
> +	},
> +	{
> +		.fourcc   = V4L2_PIX_FMT_SGBRG16, /* Bayer GB/RG */
> +		.vdownsampling = { 1 },
> +		.bit_depth = { 16 },
> +		.planes   = 1,
> +		.buffers = 1,
> +	},
> +	{
> +		.fourcc   = V4L2_PIX_FMT_SGRBG16, /* Bayer GR/BG */
> +		.vdownsampling = { 1 },
> +		.bit_depth = { 16 },
> +		.planes   = 1,
> +		.buffers = 1,
> +	},
> +	{
> +		.fourcc   = V4L2_PIX_FMT_SRGGB16, /* Bayer RG/GB */
> +		.vdownsampling = { 1 },
> +		.bit_depth = { 16 },
> +		.planes   = 1,
> +		.buffers = 1,
> +	},
>  	{
>  		.fourcc   = V4L2_PIX_FMT_HSV24, /* HSV 24bits */
>  		.color_enc = TGP_COLOR_ENC_HSV,
> 

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

* [PATCH 2/2] media: vivid: Add 16-bit bayer to format list
  2018-10-04 11:01 [PATCH 1/2] media: v4l2-tpg-core: Add 16-bit bayer bwinther
@ 2018-10-04 11:01 ` bwinther
  2018-10-04 11:16   ` Hans Verkuil
  0 siblings, 1 reply; 4+ messages in thread
From: bwinther @ 2018-10-04 11:01 UTC (permalink / raw)
  To: linux-media; +Cc: hans.verkuil, Bård Eirik Winther

From: Bård Eirik Winther <bwinther@cisco.com>

Signed-off-by: Bård Eirik Winther <bwinther@cisco.com>
---
 .../media/platform/vivid/vivid-vid-common.c   | 28 +++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/drivers/media/platform/vivid/vivid-vid-common.c b/drivers/media/platform/vivid/vivid-vid-common.c
index 27a0000a5973..9645a91b8782 100644
--- a/drivers/media/platform/vivid/vivid-vid-common.c
+++ b/drivers/media/platform/vivid/vivid-vid-common.c
@@ -449,6 +449,34 @@ struct vivid_fmt vivid_formats[] = {
 		.planes   = 1,
 		.buffers = 1,
 	},
+	{
+		.fourcc   = V4L2_PIX_FMT_SBGGR16, /* Bayer BG/GR */
+		.vdownsampling = { 1 },
+		.bit_depth = { 16 },
+		.planes   = 1,
+		.buffers = 1,
+	},
+	{
+		.fourcc   = V4L2_PIX_FMT_SGBRG16, /* Bayer GB/RG */
+		.vdownsampling = { 1 },
+		.bit_depth = { 16 },
+		.planes   = 1,
+		.buffers = 1,
+	},
+	{
+		.fourcc   = V4L2_PIX_FMT_SGRBG16, /* Bayer GR/BG */
+		.vdownsampling = { 1 },
+		.bit_depth = { 16 },
+		.planes   = 1,
+		.buffers = 1,
+	},
+	{
+		.fourcc   = V4L2_PIX_FMT_SRGGB16, /* Bayer RG/GB */
+		.vdownsampling = { 1 },
+		.bit_depth = { 16 },
+		.planes   = 1,
+		.buffers = 1,
+	},
 	{
 		.fourcc   = V4L2_PIX_FMT_HSV24, /* HSV 24bits */
 		.color_enc = TGP_COLOR_ENC_HSV,
-- 
2.17.1

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

end of thread, other threads:[~2018-10-08 19:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-08 12:29 [PATCH 1/2] media: v4l2-tpg-core: Add 16-bit bayer bwinther
2018-10-08 12:29 ` [PATCH 2/2] media: vivid: Add 16-bit bayer to format list bwinther
  -- strict thread matches above, loose matches on Subject: below --
2018-10-04 11:01 [PATCH 1/2] media: v4l2-tpg-core: Add 16-bit bayer bwinther
2018-10-04 11:01 ` [PATCH 2/2] media: vivid: Add 16-bit bayer to format list bwinther
2018-10-04 11:16   ` 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.