linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [media] exynos-gsc: Avoid spamming the log on VIDIOC_TRY_FMT
@ 2017-01-24 21:42 Javier Martinez Canillas
  2017-02-02  2:25 ` Shuah Khan
  0 siblings, 1 reply; 3+ messages in thread
From: Javier Martinez Canillas @ 2017-01-24 21:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Shuah Khan, Javier Martinez Canillas, Mauro Carvalho Chehab,
	Marek Szyprowski, Kukjin Kim, linux-samsung-soc,
	Sylwester Nawrocki, linux-media, Krzysztof Kozlowski,
	linux-arm-kernel, Ulf Hansson

There isn't an ioctl to enum the supported field orders, so a user-space
application can call VIDIOC_TRY_FMT using different field orders to know
if one is supported. For example, GStreamer does this so during playback
dozens of the following messages appear in the kernel log buffer:

[ 442.143393] Not supported field order(4)

Instead of printing this as an error, just keep it as debug information.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>

---

 drivers/media/platform/exynos-gsc/gsc-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c
index 8524fe15fa80..678b600f0500 100644
--- a/drivers/media/platform/exynos-gsc/gsc-core.c
+++ b/drivers/media/platform/exynos-gsc/gsc-core.c
@@ -408,7 +408,7 @@ int gsc_try_fmt_mplane(struct gsc_ctx *ctx, struct v4l2_format *f)
 	if (pix_mp->field == V4L2_FIELD_ANY)
 		pix_mp->field = V4L2_FIELD_NONE;
 	else if (pix_mp->field != V4L2_FIELD_NONE) {
-		pr_err("Not supported field order(%d)\n", pix_mp->field);
+		pr_debug("Not supported field order(%d)\n", pix_mp->field);
 		return -EINVAL;
 	}
 
-- 
2.7.4

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

* Re: [PATCH] [media] exynos-gsc: Avoid spamming the log on VIDIOC_TRY_FMT
  2017-01-24 21:42 [PATCH] [media] exynos-gsc: Avoid spamming the log on VIDIOC_TRY_FMT Javier Martinez Canillas
@ 2017-02-02  2:25 ` Shuah Khan
  2017-02-02 12:21   ` Javier Martinez Canillas
  0 siblings, 1 reply; 3+ messages in thread
From: Shuah Khan @ 2017-02-02  2:25 UTC (permalink / raw)
  To: Javier Martinez Canillas, linux-kernel
  Cc: Mauro Carvalho Chehab, Marek Szyprowski, Kukjin Kim,
	linux-samsung-soc, Sylwester Nawrocki, linux-media,
	Krzysztof Kozlowski, linux-arm-kernel, Ulf Hansson, Shuah Khan

On 01/24/2017 02:42 PM, Javier Martinez Canillas wrote:
> There isn't an ioctl to enum the supported field orders, so a user-space
> application can call VIDIOC_TRY_FMT using different field orders to know
> if one is supported. For example, GStreamer does this so during playback
> dozens of the following messages appear in the kernel log buffer:
> 
> [ 442.143393] Not supported field order(4)
> 
> Instead of printing this as an error, just keep it as debug information.
> 
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
> 
> ---
> 
>  drivers/media/platform/exynos-gsc/gsc-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c
> index 8524fe15fa80..678b600f0500 100644
> --- a/drivers/media/platform/exynos-gsc/gsc-core.c
> +++ b/drivers/media/platform/exynos-gsc/gsc-core.c
> @@ -408,7 +408,7 @@ int gsc_try_fmt_mplane(struct gsc_ctx *ctx, struct v4l2_format *f)
>  	if (pix_mp->field == V4L2_FIELD_ANY)
>  		pix_mp->field = V4L2_FIELD_NONE;
>  	else if (pix_mp->field != V4L2_FIELD_NONE) {
> -		pr_err("Not supported field order(%d)\n", pix_mp->field);
> +		pr_debug("Not supported field order(%d)\n", pix_mp->field);

It make sense to leave it as an error, but print only once perhaps.
The down side to making this debug is that it becomes harder to
figure out when we run into this case.

thanks,
-- Shuah

>  		return -EINVAL;
>  	}
>  
> 

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

* Re: [PATCH] [media] exynos-gsc: Avoid spamming the log on VIDIOC_TRY_FMT
  2017-02-02  2:25 ` Shuah Khan
@ 2017-02-02 12:21   ` Javier Martinez Canillas
  0 siblings, 0 replies; 3+ messages in thread
From: Javier Martinez Canillas @ 2017-02-02 12:21 UTC (permalink / raw)
  To: Shuah Khan, linux-kernel
  Cc: Mauro Carvalho Chehab, Marek Szyprowski, Kukjin Kim,
	linux-samsung-soc, Sylwester Nawrocki, linux-media,
	Krzysztof Kozlowski, linux-arm-kernel, Ulf Hansson

Hello Shuah,

On 02/01/2017 11:25 PM, Shuah Khan wrote:
> On 01/24/2017 02:42 PM, Javier Martinez Canillas wrote:
>> There isn't an ioctl to enum the supported field orders, so a user-space
>> application can call VIDIOC_TRY_FMT using different field orders to know
>> if one is supported. For example, GStreamer does this so during playback
>> dozens of the following messages appear in the kernel log buffer:
>>
>> [ 442.143393] Not supported field order(4)
>>
>> Instead of printing this as an error, just keep it as debug information.
>>
>> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
>>
>> ---
>>
>>  drivers/media/platform/exynos-gsc/gsc-core.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c
>> index 8524fe15fa80..678b600f0500 100644
>> --- a/drivers/media/platform/exynos-gsc/gsc-core.c
>> +++ b/drivers/media/platform/exynos-gsc/gsc-core.c
>> @@ -408,7 +408,7 @@ int gsc_try_fmt_mplane(struct gsc_ctx *ctx, struct v4l2_format *f)
>>  	if (pix_mp->field == V4L2_FIELD_ANY)
>>  		pix_mp->field = V4L2_FIELD_NONE;
>>  	else if (pix_mp->field != V4L2_FIELD_NONE) {
>> -		pr_err("Not supported field order(%d)\n", pix_mp->field);
>> +		pr_debug("Not supported field order(%d)\n", pix_mp->field);
> 
> It make sense to leave it as an error, but print only once perhaps.
> The down side to making this debug is that it becomes harder to
> figure out when we run into this case.
>

I disagree. User-space trying different field orders doesn't sound like an
error to me since as mentioned there isn't an ioctl to enum supported ones.

In fact other drivers don't print anything in their try_fmt handler for the
same case, for example [0] and [1].

> thanks,
> -- Shuah
> 

[0]: http://lxr.free-electrons.com/source/drivers/media/platform/mx2_emmaprp.c#L496
[1]: http://lxr.free-electrons.com/source/drivers/media/platform/exynos4-is/fimc-m2m.c#L297

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America

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

end of thread, other threads:[~2017-02-02 12:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-24 21:42 [PATCH] [media] exynos-gsc: Avoid spamming the log on VIDIOC_TRY_FMT Javier Martinez Canillas
2017-02-02  2:25 ` Shuah Khan
2017-02-02 12:21   ` Javier Martinez Canillas

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