diff mbox

s5p-mfc: Amend initial min, max values of HEVC hierarchical coding QP controls

Message ID 20180319142958.21569-1-s.nawrocki@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Valid range for those controls is specified in documentation as [0, 51],
so initialize the controls to such range rather than [INT_MIN, INT_MAX].

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

Comments

Hans Verkuil March 19, 2018, 2:36 p.m. UTC | #1
On 03/19/2018 03:29 PM, Sylwester Nawrocki wrote:
> Valid range for those controls is specified in documentation as [0, 51],
> so initialize the controls to such range rather than [INT_MIN, INT_MAX].
> 
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>

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

Huh, I missed this when I reviewed this earlier. Thanks for catching this!

Regards,

	Hans

> ---
>  drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 28 ++++++++++++++--------------
>  1 file changed, 14 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
> index 810dabe2f1b9..7382b41f4f6d 100644
> --- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
> @@ -856,56 +856,56 @@ static struct mfc_control controls[] = {
>  	{
>  		.id = V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L0_QP,
>  		.type = V4L2_CTRL_TYPE_INTEGER,
> -		.minimum = INT_MIN,
> -		.maximum = INT_MAX,
> +		.minimum = 0,
> +		.maximum = 51,
>  		.step = 1,
>  		.default_value = 0,
>  	},
>  	{
>  		.id = V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L1_QP,
>  		.type = V4L2_CTRL_TYPE_INTEGER,
> -		.minimum = INT_MIN,
> -		.maximum = INT_MAX,
> +		.minimum = 0,
> +		.maximum = 51,
>  		.step = 1,
>  		.default_value = 0,
>  	},
>  	{
>  		.id = V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L2_QP,
>  		.type = V4L2_CTRL_TYPE_INTEGER,
> -		.minimum = INT_MIN,
> -		.maximum = INT_MAX,
> +		.minimum = 0,
> +		.maximum = 51,
>  		.step = 1,
>  		.default_value = 0,
>  	},
>  	{
>  		.id = V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L3_QP,
>  		.type = V4L2_CTRL_TYPE_INTEGER,
> -		.minimum = INT_MIN,
> -		.maximum = INT_MAX,
> +		.minimum = 0,
> +		.maximum = 51,
>  		.step = 1,
>  		.default_value = 0,
>  	},
>  	{
>  		.id = V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L4_QP,
>  		.type = V4L2_CTRL_TYPE_INTEGER,
> -		.minimum = INT_MIN,
> -		.maximum = INT_MAX,
> +		.minimum = 0,
> +		.maximum = 51,
>  		.step = 1,
>  		.default_value = 0,
>  	},
>  	{
>  		.id = V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L5_QP,
>  		.type = V4L2_CTRL_TYPE_INTEGER,
> -		.minimum = INT_MIN,
> -		.maximum = INT_MAX,
> +		.minimum = 0,
> +		.maximum = 51,
>  		.step = 1,
>  		.default_value = 0,
>  	},
>  	{
>  		.id = V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L6_QP,
>  		.type = V4L2_CTRL_TYPE_INTEGER,
> -		.minimum = INT_MIN,
> -		.maximum = INT_MAX,
> +		.minimum = 0,
> +		.maximum = 51,
>  		.step = 1,
>  		.default_value = 0,
>  	},
>
diff mbox

Patch

diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
index 810dabe2f1b9..7382b41f4f6d 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
@@ -856,56 +856,56 @@  static struct mfc_control controls[] = {
 	{
 		.id = V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L0_QP,
 		.type = V4L2_CTRL_TYPE_INTEGER,
-		.minimum = INT_MIN,
-		.maximum = INT_MAX,
+		.minimum = 0,
+		.maximum = 51,
 		.step = 1,
 		.default_value = 0,
 	},
 	{
 		.id = V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L1_QP,
 		.type = V4L2_CTRL_TYPE_INTEGER,
-		.minimum = INT_MIN,
-		.maximum = INT_MAX,
+		.minimum = 0,
+		.maximum = 51,
 		.step = 1,
 		.default_value = 0,
 	},
 	{
 		.id = V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L2_QP,
 		.type = V4L2_CTRL_TYPE_INTEGER,
-		.minimum = INT_MIN,
-		.maximum = INT_MAX,
+		.minimum = 0,
+		.maximum = 51,
 		.step = 1,
 		.default_value = 0,
 	},
 	{
 		.id = V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L3_QP,
 		.type = V4L2_CTRL_TYPE_INTEGER,
-		.minimum = INT_MIN,
-		.maximum = INT_MAX,
+		.minimum = 0,
+		.maximum = 51,
 		.step = 1,
 		.default_value = 0,
 	},
 	{
 		.id = V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L4_QP,
 		.type = V4L2_CTRL_TYPE_INTEGER,
-		.minimum = INT_MIN,
-		.maximum = INT_MAX,
+		.minimum = 0,
+		.maximum = 51,
 		.step = 1,
 		.default_value = 0,
 	},
 	{
 		.id = V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L5_QP,
 		.type = V4L2_CTRL_TYPE_INTEGER,
-		.minimum = INT_MIN,
-		.maximum = INT_MAX,
+		.minimum = 0,
+		.maximum = 51,
 		.step = 1,
 		.default_value = 0,
 	},
 	{
 		.id = V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L6_QP,
 		.type = V4L2_CTRL_TYPE_INTEGER,
-		.minimum = INT_MIN,
-		.maximum = INT_MAX,
+		.minimum = 0,
+		.maximum = 51,
 		.step = 1,
 		.default_value = 0,
 	},