diff mbox

[media] s5p-mfc: Fix encoder control 15 issue

Message ID 1362575757-22839-1-git-send-email-arun.kk@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Arun Kumar K March 6, 2013, 1:15 p.m. UTC
mfc-encoder is not working in the latest kernel giving the
erorr "Adding control (15) failed". Adding the missing step
parameter in this control to fix the issue.

Signed-off-by: Arun Kumar K <arun.kk@samsung.com>
---
 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c |    1 +
 1 file changed, 1 insertion(+)

Comments

Sylwester Nawrocki March 6, 2013, 10:10 p.m. UTC | #1
Hi Arun,

On 03/06/2013 02:15 PM, Arun Kumar K wrote:
> mfc-encoder is not working in the latest kernel giving the
> erorr "Adding control (15) failed". Adding the missing step
> parameter in this control to fix the issue.

Do you mean this problem was not observed in 3.8 kernel and something
has changed in the v4l2 core so it fails in 3.9-rc now ? Or is it
related to some change in the driver itself ?

> Signed-off-by: Arun Kumar K<arun.kk@samsung.com>
> ---
>   drivers/media/platform/s5p-mfc/s5p_mfc_enc.c |    1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
> index 2356fd5..4f6b553 100644
> --- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
> @@ -232,6 +232,7 @@ static struct mfc_control controls[] = {
>   		.minimum = 0,
>   		.maximum = 1,
>   		.default_value = 0,
> +		.step = 1,
>   		.menu_skip_mask = 0,
>   	},
>   	{

Regards,
Sylwester
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Shaik Ameer Basha March 7, 2013, 2:20 a.m. UTC | #2
Hi Sylwester,

On Thu, Mar 7, 2013 at 3:40 AM, Sylwester Nawrocki
<sylvester.nawrocki@gmail.com> wrote:
> Hi Arun,
>
>
> On 03/06/2013 02:15 PM, Arun Kumar K wrote:
>>
>> mfc-encoder is not working in the latest kernel giving the
>> erorr "Adding control (15) failed". Adding the missing step
>> parameter in this control to fix the issue.
>
>
> Do you mean this problem was not observed in 3.8 kernel and something
> has changed in the v4l2 core so it fails in 3.9-rc now ? Or is it
> related to some change in the driver itself ?

v4l2_ctrl_new() uses check_range() for control range checking (which
is added newly).
This function expects 'step' value for V4L2_CTRL_TYPE_BOOLEAN type control.
If 'step' value doesn't match to '1', it returns -ERANGE error.

Its a change in v4l2 core.

Regards,
Shaik Ameer Basha

>
>
>> Signed-off-by: Arun Kumar K<arun.kk@samsung.com>
>> ---
>>   drivers/media/platform/s5p-mfc/s5p_mfc_enc.c |    1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
>> b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
>> index 2356fd5..4f6b553 100644
>> --- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
>> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
>> @@ -232,6 +232,7 @@ static struct mfc_control controls[] = {
>>                 .minimum = 0,
>>                 .maximum = 1,
>>                 .default_value = 0,
>> +               .step = 1,
>>                 .menu_skip_mask = 0,
>>         },
>>         {
>
>
> Regards,
> Sylwester
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Arun Kumar K March 7, 2013, 4:23 a.m. UTC | #3
Hi Sylwester,

> Do you mean this problem was not observed in 3.8 kernel and something
> has changed in the v4l2 core so it fails in 3.9-rc now ? Or is it
> related to some change in the driver itself ?

I saw this problem in 3.9rc1 and also in 3.8 stable.
But I havent seen this in media-tree v3.9 staging branch.
I didnt dig in much into what changed in v4l2 framework for this to happen now.

Regards
Arun
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
On 03/07/2013 03:20 AM, Shaik Ameer Basha wrote:
> v4l2_ctrl_new() uses check_range() for control range checking (which
> is added newly).
> This function expects 'step' value for V4L2_CTRL_TYPE_BOOLEAN type control.
> If 'step' value doesn't match to '1', it returns -ERANGE error.
> 
> Its a change in v4l2 core.

Yes, I suspected the issue appeared after recent change

commit 88e85861b4f77ae29495ee05574c98dd0c6c3037
[media] v4l2-ctrl: Add helper function for the controls range update

Then it is related to to 3.9-rc1+ kernels only. I have verified it on
3.8 based kernel and there is no issue with drivers that do not
initialize step value for boolean type controls properly. It only
appears after the above commit is applied.

I've picked your fixup patches into v3.9-fixes branch and will try
to send them out this week, together with other patches from our side.


Regards,
Sylwester
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
On 03/07/2013 05:23 AM, Arun Kumar K wrote:
>> Do you mean this problem was not observed in 3.8 kernel and something
>> has changed in the v4l2 core so it fails in 3.9-rc now ? Or is it
>> related to some change in the driver itself ?
> 
> I saw this problem in 3.9rc1 and also in 3.8 stable.
> But I havent seen this in media-tree v3.9 staging branch.
> I didnt dig in much into what changed in v4l2 framework for this to happen now.

Thanks Arun. This is strange though, I haven't observe the problem
in 3.8. The issue seems to be related to

commit 88e85861b4f77ae29495ee05574c98dd0c6c3037
[media] v4l2-ctrl: Add helper function for the controls range update

which appeared in 3.9-rc1 only.

Regards,
Sylwester
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
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 2356fd5..4f6b553 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
@@ -232,6 +232,7 @@  static struct mfc_control controls[] = {
 		.minimum = 0,
 		.maximum = 1,
 		.default_value = 0,
+		.step = 1,
 		.menu_skip_mask = 0,
 	},
 	{