linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] V4L2 SDR: Add Real U8 format (V4L2_SDR_FMT_RU8)
@ 2017-04-23 22:45 Bertold Van den Bergh
  2017-04-24 14:28 ` Philipp Zabel
  0 siblings, 1 reply; 4+ messages in thread
From: Bertold Van den Bergh @ 2017-04-23 22:45 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, linux-media, linux-kernel, Bertold Van den Bergh

This patch adds support for the Real U8 format to the V4L2 SDR framework.
This will be used for a piece of hardware we are developing.

Signed-off-by: Bertold Van den Bergh <vandenbergh@bertold.org>
---
 drivers/media/v4l2-core/v4l2-ioctl.c | 1 +
 include/uapi/linux/videodev2.h       | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
index e5a2187..8b6e097 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -1229,6 +1229,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
 	case V4L2_SDR_FMT_CS8:		descr = "Complex S8"; break;
 	case V4L2_SDR_FMT_CS14LE:	descr = "Complex S14LE"; break;
 	case V4L2_SDR_FMT_RU12LE:	descr = "Real U12LE"; break;
+	case V4L2_SDR_FMT_RU8:		descr = "Real U8"; break;
 	case V4L2_TCH_FMT_DELTA_TD16:	descr = "16-bit signed deltas"; break;
 	case V4L2_TCH_FMT_DELTA_TD08:	descr = "8-bit signed deltas"; break;
 	case V4L2_TCH_FMT_TU16:		descr = "16-bit unsigned touch data"; break;
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 2b8feb8..50c3ef4 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -669,6 +669,7 @@ struct v4l2_pix_format {
 #define V4L2_SDR_FMT_CS8          v4l2_fourcc('C', 'S', '0', '8') /* complex s8 */
 #define V4L2_SDR_FMT_CS14LE       v4l2_fourcc('C', 'S', '1', '4') /* complex s14le */
 #define V4L2_SDR_FMT_RU12LE       v4l2_fourcc('R', 'U', '1', '2') /* real u12le */
+#define V4L2_SDR_FMT_RU8          v4l2_fourcc('R', 'U', '0', '8') /* real u8 */
 
 /* Touch formats - used for Touch devices */
 #define V4L2_TCH_FMT_DELTA_TD16	v4l2_fourcc('T', 'D', '1', '6') /* 16-bit signed deltas */
-- 
1.9.1

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

* Re: [PATCH] V4L2 SDR: Add Real U8 format (V4L2_SDR_FMT_RU8)
  2017-04-23 22:45 [PATCH] V4L2 SDR: Add Real U8 format (V4L2_SDR_FMT_RU8) Bertold Van den Bergh
@ 2017-04-24 14:28 ` Philipp Zabel
  2017-04-24 17:57   ` [PATCH v2] " Bertold Van den Bergh
  0 siblings, 1 reply; 4+ messages in thread
From: Philipp Zabel @ 2017-04-24 14:28 UTC (permalink / raw)
  To: Bertold Van den Bergh; +Cc: Mauro Carvalho Chehab, linux-media, linux-kernel

Hi Bertold,

On Mon, 2017-04-24 at 00:45 +0200, Bertold Van den Bergh wrote:
> This patch adds support for the Real U8 format to the V4L2 SDR framework.
> This will be used for a piece of hardware we are developing.
> 
> Signed-off-by: Bertold Van den Bergh <vandenbergh@bertold.org>
> ---
>  drivers/media/v4l2-core/v4l2-ioctl.c | 1 +
>  include/uapi/linux/videodev2.h       | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
> index e5a2187..8b6e097 100644
> --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> @@ -1229,6 +1229,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
>  	case V4L2_SDR_FMT_CS8:		descr = "Complex S8"; break;
>  	case V4L2_SDR_FMT_CS14LE:	descr = "Complex S14LE"; break;
>  	case V4L2_SDR_FMT_RU12LE:	descr = "Real U12LE"; break;
> +	case V4L2_SDR_FMT_RU8:		descr = "Real U8"; break;
>  	case V4L2_TCH_FMT_DELTA_TD16:	descr = "16-bit signed deltas"; break;
>  	case V4L2_TCH_FMT_DELTA_TD08:	descr = "8-bit signed deltas"; break;
>  	case V4L2_TCH_FMT_TU16:		descr = "16-bit unsigned touch data"; break;
> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
> index 2b8feb8..50c3ef4 100644
> --- a/include/uapi/linux/videodev2.h
> +++ b/include/uapi/linux/videodev2.h
> @@ -669,6 +669,7 @@ struct v4l2_pix_format {
>  #define V4L2_SDR_FMT_CS8          v4l2_fourcc('C', 'S', '0', '8') /* complex s8 */
>  #define V4L2_SDR_FMT_CS14LE       v4l2_fourcc('C', 'S', '1', '4') /* complex s14le */
>  #define V4L2_SDR_FMT_RU12LE       v4l2_fourcc('R', 'U', '1', '2') /* real u12le */
> +#define V4L2_SDR_FMT_RU8          v4l2_fourcc('R', 'U', '0', '8') /* real u8 */

When adding new SDR formats, could you also add an entry to
Documentation/media/uapi/v4l/sdr-formats.rst ? See for example
Documentation/media/uapi/v4l/pixfmt-sdr-ru12le.rst.

Also maybe V4L2_SDR_FMT_RU8 should be ordered above V4L2_SDR_FMT_RU12LE?
I'm not sure from the context.

regards
Philipp

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

* [PATCH v2] V4L2 SDR: Add Real U8 format (V4L2_SDR_FMT_RU8)
  2017-04-24 14:28 ` Philipp Zabel
@ 2017-04-24 17:57   ` Bertold Van den Bergh
  2018-03-09 12:12     ` Hans Verkuil
  0 siblings, 1 reply; 4+ messages in thread
From: Bertold Van den Bergh @ 2017-04-24 17:57 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, linux-media, linux-kernel, vandenbergh

This patch adds support for the Real U8 format to the V4L2 SDR framework.

Signed-off-by: Bertold Van den Bergh <vandenbergh@bertold.org>
---
Thanks for your comments. I was not aware of the V4L format documentation.
I don't think there is a clear natural ordering for these types of formats,
but I agree it looks more consistent in this way.

Changes in v2:
  - Added documentation files
  - Changed order of formats

 Documentation/media/uapi/v4l/pixfmt-sdr-ru08.rst | 17 +++++++++++++++++
 Documentation/media/uapi/v4l/sdr-formats.rst     |  1 +
 drivers/media/v4l2-core/v4l2-ioctl.c             |  1 +
 include/uapi/linux/videodev2.h                   |  1 +
 4 files changed, 20 insertions(+)
 create mode 100644 Documentation/media/uapi/v4l/pixfmt-sdr-ru08.rst

diff --git a/Documentation/media/uapi/v4l/pixfmt-sdr-ru08.rst b/Documentation/media/uapi/v4l/pixfmt-sdr-ru08.rst
new file mode 100644
index 0000000..ddd56e1
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-sdr-ru08.rst
@@ -0,0 +1,17 @@
+.. -*- coding: utf-8; mode: rst -*-
+
+.. _V4L2-SDR-FMT-RU8:
+
+****************************
+V4L2_SDR_FMT_RU8 ('RU08')
+****************************
+
+
+Real unsigned 8-bit sample
+
+
+Description
+===========
+
+This format contains a sequence of real number samples. Each sample is
+represented as a 8 bit unsigned number.
diff --git a/Documentation/media/uapi/v4l/sdr-formats.rst b/Documentation/media/uapi/v4l/sdr-formats.rst
index f863c08..a08b5c2 100644
--- a/Documentation/media/uapi/v4l/sdr-formats.rst
+++ b/Documentation/media/uapi/v4l/sdr-formats.rst
@@ -16,4 +16,5 @@ These formats are used for :ref:`SDR <sdr>` interface only.
     pixfmt-sdr-cu16le
     pixfmt-sdr-cs08
     pixfmt-sdr-cs14le
+    pixfmt-sdr-ru08
     pixfmt-sdr-ru12le
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
index e5a2187..79140cc 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -1228,6 +1228,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
 	case V4L2_SDR_FMT_CU16LE:	descr = "Complex U16LE"; break;
 	case V4L2_SDR_FMT_CS8:		descr = "Complex S8"; break;
 	case V4L2_SDR_FMT_CS14LE:	descr = "Complex S14LE"; break;
+	case V4L2_SDR_FMT_RU8:		descr = "Real U8"; break;
 	case V4L2_SDR_FMT_RU12LE:	descr = "Real U12LE"; break;
 	case V4L2_TCH_FMT_DELTA_TD16:	descr = "16-bit signed deltas"; break;
 	case V4L2_TCH_FMT_DELTA_TD08:	descr = "8-bit signed deltas"; break;
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 2b8feb8..21e9ae3 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -668,6 +668,7 @@ struct v4l2_pix_format {
 #define V4L2_SDR_FMT_CU16LE       v4l2_fourcc('C', 'U', '1', '6') /* IQ u16le */
 #define V4L2_SDR_FMT_CS8          v4l2_fourcc('C', 'S', '0', '8') /* complex s8 */
 #define V4L2_SDR_FMT_CS14LE       v4l2_fourcc('C', 'S', '1', '4') /* complex s14le */
+#define V4L2_SDR_FMT_RU8          v4l2_fourcc('R', 'U', '0', '8') /* real u8 */
 #define V4L2_SDR_FMT_RU12LE       v4l2_fourcc('R', 'U', '1', '2') /* real u12le */
 
 /* Touch formats - used for Touch devices */
-- 
1.9.1

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

* Re: [PATCH v2] V4L2 SDR: Add Real U8 format (V4L2_SDR_FMT_RU8)
  2017-04-24 17:57   ` [PATCH v2] " Bertold Van den Bergh
@ 2018-03-09 12:12     ` Hans Verkuil
  0 siblings, 0 replies; 4+ messages in thread
From: Hans Verkuil @ 2018-03-09 12:12 UTC (permalink / raw)
  To: Bertold Van den Bergh, Mauro Carvalho Chehab, linux-media, linux-kernel

Hi Bertold,

I'm going through old patches in my TODO list and found this one.

It clearly fell through the cracks, for which I apologize.

The problem with this patch is that there is no kernel driver that supports
this format. The general policy is that we don't add formats unless some
driver actually uses it.

That does not appear to be the case here. I assume you use it with some
out-of-tree driver?

Anyway, that's the reason I have to reject it.

Regards,

	Hans

On 24/04/17 19:57, Bertold Van den Bergh wrote:
> This patch adds support for the Real U8 format to the V4L2 SDR framework.
> 
> Signed-off-by: Bertold Van den Bergh <vandenbergh@bertold.org>
> ---
> Thanks for your comments. I was not aware of the V4L format documentation.
> I don't think there is a clear natural ordering for these types of formats,
> but I agree it looks more consistent in this way.
> 
> Changes in v2:
>   - Added documentation files
>   - Changed order of formats
> 
>  Documentation/media/uapi/v4l/pixfmt-sdr-ru08.rst | 17 +++++++++++++++++
>  Documentation/media/uapi/v4l/sdr-formats.rst     |  1 +
>  drivers/media/v4l2-core/v4l2-ioctl.c             |  1 +
>  include/uapi/linux/videodev2.h                   |  1 +
>  4 files changed, 20 insertions(+)
>  create mode 100644 Documentation/media/uapi/v4l/pixfmt-sdr-ru08.rst
> 
> diff --git a/Documentation/media/uapi/v4l/pixfmt-sdr-ru08.rst b/Documentation/media/uapi/v4l/pixfmt-sdr-ru08.rst
> new file mode 100644
> index 0000000..ddd56e1
> --- /dev/null
> +++ b/Documentation/media/uapi/v4l/pixfmt-sdr-ru08.rst
> @@ -0,0 +1,17 @@
> +.. -*- coding: utf-8; mode: rst -*-
> +
> +.. _V4L2-SDR-FMT-RU8:
> +
> +****************************
> +V4L2_SDR_FMT_RU8 ('RU08')
> +****************************
> +
> +
> +Real unsigned 8-bit sample
> +
> +
> +Description
> +===========
> +
> +This format contains a sequence of real number samples. Each sample is
> +represented as a 8 bit unsigned number.
> diff --git a/Documentation/media/uapi/v4l/sdr-formats.rst b/Documentation/media/uapi/v4l/sdr-formats.rst
> index f863c08..a08b5c2 100644
> --- a/Documentation/media/uapi/v4l/sdr-formats.rst
> +++ b/Documentation/media/uapi/v4l/sdr-formats.rst
> @@ -16,4 +16,5 @@ These formats are used for :ref:`SDR <sdr>` interface only.
>      pixfmt-sdr-cu16le
>      pixfmt-sdr-cs08
>      pixfmt-sdr-cs14le
> +    pixfmt-sdr-ru08
>      pixfmt-sdr-ru12le
> diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
> index e5a2187..79140cc 100644
> --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> @@ -1228,6 +1228,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
>  	case V4L2_SDR_FMT_CU16LE:	descr = "Complex U16LE"; break;
>  	case V4L2_SDR_FMT_CS8:		descr = "Complex S8"; break;
>  	case V4L2_SDR_FMT_CS14LE:	descr = "Complex S14LE"; break;
> +	case V4L2_SDR_FMT_RU8:		descr = "Real U8"; break;
>  	case V4L2_SDR_FMT_RU12LE:	descr = "Real U12LE"; break;
>  	case V4L2_TCH_FMT_DELTA_TD16:	descr = "16-bit signed deltas"; break;
>  	case V4L2_TCH_FMT_DELTA_TD08:	descr = "8-bit signed deltas"; break;
> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
> index 2b8feb8..21e9ae3 100644
> --- a/include/uapi/linux/videodev2.h
> +++ b/include/uapi/linux/videodev2.h
> @@ -668,6 +668,7 @@ struct v4l2_pix_format {
>  #define V4L2_SDR_FMT_CU16LE       v4l2_fourcc('C', 'U', '1', '6') /* IQ u16le */
>  #define V4L2_SDR_FMT_CS8          v4l2_fourcc('C', 'S', '0', '8') /* complex s8 */
>  #define V4L2_SDR_FMT_CS14LE       v4l2_fourcc('C', 'S', '1', '4') /* complex s14le */
> +#define V4L2_SDR_FMT_RU8          v4l2_fourcc('R', 'U', '0', '8') /* real u8 */
>  #define V4L2_SDR_FMT_RU12LE       v4l2_fourcc('R', 'U', '1', '2') /* real u12le */
>  
>  /* Touch formats - used for Touch devices */
> 

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

end of thread, other threads:[~2018-03-09 12:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-23 22:45 [PATCH] V4L2 SDR: Add Real U8 format (V4L2_SDR_FMT_RU8) Bertold Van den Bergh
2017-04-24 14:28 ` Philipp Zabel
2017-04-24 17:57   ` [PATCH v2] " Bertold Van den Bergh
2018-03-09 12:12     ` Hans Verkuil

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).