2012-08-29 12:32:22

by Prabhakar Lad

[permalink] [raw]
Subject: [PATCH] media: v4l2-ctrls: add control for dpcm predictor

From: Lad, Prabhakar <[email protected]>

add V4L2_CID_DPCM_PREDICTOR control of type menu, which
determines the dpcm predictor. The predictor can be either
simple or advanced.

Signed-off-by: Lad, Prabhakar <[email protected]>
Signed-off-by: Manjunath Hadli <[email protected]>
Cc: Sakari Ailus <[email protected]>
Cc: Hans Verkuil <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Hans de Goede <[email protected]>
Cc: Kyungmin Park <[email protected]>
---
This patches has one checkpatch warning for line over
80 characters altough it can be avoided I have kept it
for consistency.

drivers/media/v4l2-core/v4l2-ctrls.c | 9 +++++++++
include/linux/videodev2.h | 5 +++++
2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
index b6a2ee7..2d7bc15 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -425,6 +425,11 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
"Gray",
NULL,
};
+ static const char * const dpcm_predictor[] = {
+ "Simple Predictor",
+ "Advanced Predictor",
+ NULL,
+ };

switch (id) {
case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ:
@@ -502,6 +507,8 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
return mpeg4_profile;
case V4L2_CID_JPEG_CHROMA_SUBSAMPLING:
return jpeg_chroma_subsampling;
+ case V4L2_CID_DPCM_PREDICTOR:
+ return dpcm_predictor;

default:
return NULL;
@@ -732,6 +739,7 @@ const char *v4l2_ctrl_get_name(u32 id)
case V4L2_CID_IMAGE_PROC_CLASS: return "Image Processing Controls";
case V4L2_CID_LINK_FREQ: return "Link Frequency";
case V4L2_CID_PIXEL_RATE: return "Pixel Rate";
+ case V4L2_CID_DPCM_PREDICTOR: return "DPCM Predictor";

default:
return NULL;
@@ -832,6 +840,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
case V4L2_CID_ISO_SENSITIVITY_AUTO:
case V4L2_CID_EXPOSURE_METERING:
case V4L2_CID_SCENE_MODE:
+ case V4L2_CID_DPCM_PREDICTOR:
*type = V4L2_CTRL_TYPE_MENU;
break;
case V4L2_CID_LINK_FREQ:
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 6d6dfa7..4edb941 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -2000,6 +2000,11 @@ enum v4l2_jpeg_chroma_subsampling {

#define V4L2_CID_LINK_FREQ (V4L2_CID_IMAGE_PROC_CLASS_BASE + 1)
#define V4L2_CID_PIXEL_RATE (V4L2_CID_IMAGE_PROC_CLASS_BASE + 2)
+#define V4L2_CID_DPCM_PREDICTOR (V4L2_CID_IMAGE_PROC_CLASS_BASE + 3)
+enum v4l2_dpcm_predictor {
+ V4L2_DPCM_PREDICTOR_SIMPLE = 0,
+ V4L2_DPCM_PREDICTOR_ADVANCE = 1,
+};

/*
* T U N I N G
--
1.7.0.4


2012-08-29 12:43:12

by Sylwester Nawrocki

[permalink] [raw]
Subject: Re: [PATCH] media: v4l2-ctrls: add control for dpcm predictor

Hi Prabhakar,

On 08/29/2012 02:31 PM, Prabhakar Lad wrote:
> From: Lad, Prabhakar <[email protected]>
>
> add V4L2_CID_DPCM_PREDICTOR control of type menu, which
> determines the dpcm predictor. The predictor can be either
> simple or advanced.

Thanks for the patch. I was expecting to find some information about
this new control in its DocBook documentation, but this part seems
to be missing here. :) Could you please add relevant entries in
Documentation/DocBook/media/v4l/controls.xml as well ?

--

Regards,
Sylwester

2012-08-29 12:58:32

by Prabhakar Lad

[permalink] [raw]
Subject: Re: [PATCH] media: v4l2-ctrls: add control for dpcm predictor

Hi Sylwester,

On Wednesday 29 August 2012 06:13 PM, Sylwester Nawrocki wrote:
> Hi Prabhakar,
>
> On 08/29/2012 02:31 PM, Prabhakar Lad wrote:
>> From: Lad, Prabhakar <[email protected]>
>>
>> add V4L2_CID_DPCM_PREDICTOR control of type menu, which
>> determines the dpcm predictor. The predictor can be either
>> simple or advanced.
>
> Thanks for the patch. I was expecting to find some information about
> this new control in its DocBook documentation, but this part seems
> to be missing here. :) Could you please add relevant entries in
> Documentation/DocBook/media/v4l/controls.xml as well ?
>
Thanks for the catch :) I'll add it for v2.

Thanks and Regards,
--Prabhakar

> --
>
> Regards,
> Sylwester
>

2012-08-29 14:21:45

by Sakari Ailus

[permalink] [raw]
Subject: Re: [PATCH] media: v4l2-ctrls: add control for dpcm predictor

Hi Prabhakar,

Thanks for the patch.

On Wed, Aug 29, 2012 at 06:01:07PM +0530, Prabhakar Lad wrote:
> From: Lad, Prabhakar <[email protected]>
>
> add V4L2_CID_DPCM_PREDICTOR control of type menu, which
> determines the dpcm predictor. The predictor can be either
> simple or advanced.
>
> Signed-off-by: Lad, Prabhakar <[email protected]>
> Signed-off-by: Manjunath Hadli <[email protected]>
> Cc: Sakari Ailus <[email protected]>
> Cc: Hans Verkuil <[email protected]>
> Cc: Laurent Pinchart <[email protected]>
> Cc: Mauro Carvalho Chehab <[email protected]>
> Cc: Sylwester Nawrocki <[email protected]>
> Cc: Hans de Goede <[email protected]>
> Cc: Kyungmin Park <[email protected]>
> ---
> This patches has one checkpatch warning for line over
> 80 characters altough it can be avoided I have kept it
> for consistency.
>
> drivers/media/v4l2-core/v4l2-ctrls.c | 9 +++++++++
> include/linux/videodev2.h | 5 +++++
> 2 files changed, 14 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
> index b6a2ee7..2d7bc15 100644
> --- a/drivers/media/v4l2-core/v4l2-ctrls.c
> +++ b/drivers/media/v4l2-core/v4l2-ctrls.c
> @@ -425,6 +425,11 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
> "Gray",
> NULL,
> };
> + static const char * const dpcm_predictor[] = {
> + "Simple Predictor",
> + "Advanced Predictor",
> + NULL,
> + };
>
> switch (id) {
> case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ:
> @@ -502,6 +507,8 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
> return mpeg4_profile;
> case V4L2_CID_JPEG_CHROMA_SUBSAMPLING:
> return jpeg_chroma_subsampling;
> + case V4L2_CID_DPCM_PREDICTOR:
> + return dpcm_predictor;
>
> default:
> return NULL;
> @@ -732,6 +739,7 @@ const char *v4l2_ctrl_get_name(u32 id)
> case V4L2_CID_IMAGE_PROC_CLASS: return "Image Processing Controls";
> case V4L2_CID_LINK_FREQ: return "Link Frequency";
> case V4L2_CID_PIXEL_RATE: return "Pixel Rate";
> + case V4L2_CID_DPCM_PREDICTOR: return "DPCM Predictor";
>
> default:
> return NULL;
> @@ -832,6 +840,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
> case V4L2_CID_ISO_SENSITIVITY_AUTO:
> case V4L2_CID_EXPOSURE_METERING:
> case V4L2_CID_SCENE_MODE:
> + case V4L2_CID_DPCM_PREDICTOR:
> *type = V4L2_CTRL_TYPE_MENU;
> break;
> case V4L2_CID_LINK_FREQ:
> diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
> index 6d6dfa7..4edb941 100644
> --- a/include/linux/videodev2.h
> +++ b/include/linux/videodev2.h
> @@ -2000,6 +2000,11 @@ enum v4l2_jpeg_chroma_subsampling {
>
> #define V4L2_CID_LINK_FREQ (V4L2_CID_IMAGE_PROC_CLASS_BASE + 1)
> #define V4L2_CID_PIXEL_RATE (V4L2_CID_IMAGE_PROC_CLASS_BASE + 2)
> +#define V4L2_CID_DPCM_PREDICTOR (V4L2_CID_IMAGE_PROC_CLASS_BASE + 3)
> +enum v4l2_dpcm_predictor {
> + V4L2_DPCM_PREDICTOR_SIMPLE = 0,
> + V4L2_DPCM_PREDICTOR_ADVANCE = 1,
> +};

s/ADVANCE/ADVANCED/ perhaps?

To add to Sylwester's comment on the documentation, I think this control
belongs to the image processing controls class.

Kind regards,

--
Sakari Ailus
e-mail: [email protected] XMPP: [email protected]

2012-08-29 14:51:38

by Lad, Prabhakar

[permalink] [raw]
Subject: Re: [PATCH] media: v4l2-ctrls: add control for dpcm predictor

Hi Sakari,

Thanks for the review.

On Wed, Aug 29, 2012 at 7:51 PM, Sakari Ailus <[email protected]> wrote:
> Hi Prabhakar,
>
> Thanks for the patch.
>
> On Wed, Aug 29, 2012 at 06:01:07PM +0530, Prabhakar Lad wrote:
>> From: Lad, Prabhakar <[email protected]>
>>
>> add V4L2_CID_DPCM_PREDICTOR control of type menu, which
>> determines the dpcm predictor. The predictor can be either
>> simple or advanced.
>>
>> Signed-off-by: Lad, Prabhakar <[email protected]>
>> Signed-off-by: Manjunath Hadli <[email protected]>
>> Cc: Sakari Ailus <[email protected]>
>> Cc: Hans Verkuil <[email protected]>
>> Cc: Laurent Pinchart <[email protected]>
>> Cc: Mauro Carvalho Chehab <[email protected]>
>> Cc: Sylwester Nawrocki <[email protected]>
>> Cc: Hans de Goede <[email protected]>
>> Cc: Kyungmin Park <[email protected]>
>> ---
>> This patches has one checkpatch warning for line over
>> 80 characters altough it can be avoided I have kept it
>> for consistency.
>>
>> drivers/media/v4l2-core/v4l2-ctrls.c | 9 +++++++++
>> include/linux/videodev2.h | 5 +++++
>> 2 files changed, 14 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
>> index b6a2ee7..2d7bc15 100644
>> --- a/drivers/media/v4l2-core/v4l2-ctrls.c
>> +++ b/drivers/media/v4l2-core/v4l2-ctrls.c
>> @@ -425,6 +425,11 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
>> "Gray",
>> NULL,
>> };
>> + static const char * const dpcm_predictor[] = {
>> + "Simple Predictor",
>> + "Advanced Predictor",
>> + NULL,
>> + };
>>
>> switch (id) {
>> case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ:
>> @@ -502,6 +507,8 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
>> return mpeg4_profile;
>> case V4L2_CID_JPEG_CHROMA_SUBSAMPLING:
>> return jpeg_chroma_subsampling;
>> + case V4L2_CID_DPCM_PREDICTOR:
>> + return dpcm_predictor;
>>
>> default:
>> return NULL;
>> @@ -732,6 +739,7 @@ const char *v4l2_ctrl_get_name(u32 id)
>> case V4L2_CID_IMAGE_PROC_CLASS: return "Image Processing Controls";
>> case V4L2_CID_LINK_FREQ: return "Link Frequency";
>> case V4L2_CID_PIXEL_RATE: return "Pixel Rate";
>> + case V4L2_CID_DPCM_PREDICTOR: return "DPCM Predictor";
>>
>> default:
>> return NULL;
>> @@ -832,6 +840,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
>> case V4L2_CID_ISO_SENSITIVITY_AUTO:
>> case V4L2_CID_EXPOSURE_METERING:
>> case V4L2_CID_SCENE_MODE:
>> + case V4L2_CID_DPCM_PREDICTOR:
>> *type = V4L2_CTRL_TYPE_MENU;
>> break;
>> case V4L2_CID_LINK_FREQ:
>> diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
>> index 6d6dfa7..4edb941 100644
>> --- a/include/linux/videodev2.h
>> +++ b/include/linux/videodev2.h
>> @@ -2000,6 +2000,11 @@ enum v4l2_jpeg_chroma_subsampling {
>>
>> #define V4L2_CID_LINK_FREQ (V4L2_CID_IMAGE_PROC_CLASS_BASE + 1)
>> #define V4L2_CID_PIXEL_RATE (V4L2_CID_IMAGE_PROC_CLASS_BASE + 2)
>> +#define V4L2_CID_DPCM_PREDICTOR (V4L2_CID_IMAGE_PROC_CLASS_BASE + 3)
>> +enum v4l2_dpcm_predictor {
>> + V4L2_DPCM_PREDICTOR_SIMPLE = 0,
>> + V4L2_DPCM_PREDICTOR_ADVANCE = 1,
>> +};
>
> s/ADVANCE/ADVANCED/ perhaps?
>
Ok I'll make it ADVANCED.

> To add to Sylwester's comment on the documentation, I think this control
> belongs to the image processing controls class.
>
I have added it as part of image processing control class itself
(#define V4L2_CID_DPCM_PREDICTOR (V4L2_CID_IMAGE_PROC_CLASS_BASE + 3)),
I'll include the same in documentation as well.

Thanks and Regards,
--Prabhakar Lad

> Kind regards,
>
> --
> Sakari Ailus
> e-mail: [email protected] XMPP: [email protected]
> _______________________________________________
> Davinci-linux-open-source mailing list
> [email protected]
> http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source