Linux-Rockchip Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] v4l2-compliance: skip dimentions tests for media bus format MEDIA_BUS_FMT_METADATA_FIXED
@ 2020-09-22 17:19 Dafna Hirschfeld
  2020-10-14 20:41 ` Helen Koike
  0 siblings, 1 reply; 3+ messages in thread
From: Dafna Hirschfeld @ 2020-09-22 17:19 UTC (permalink / raw)
  To: linux-media
  Cc: mchehab, dafna.hirschfeld, dafna3, tfiga, hverkuil,
	linux-rockchip, helen.koike, laurent.pinchart, sakari.ailus,
	kernel, ezequiel

The media bus format code MEDIA_BUS_FMT_METADATA_FIXED
is used for metadata formats that are not configurable
from userspace and therefore may have any value for
width and height. So skip width and height tests for
this format.

Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
---
note, this patch should be applied after updating the header
include/linux/media-bus-format.h to include that new format.
---
 utils/v4l2-compliance/v4l2-test-subdevs.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/utils/v4l2-compliance/v4l2-test-subdevs.cpp b/utils/v4l2-compliance/v4l2-test-subdevs.cpp
index ec3ef169..f60853e3 100644
--- a/utils/v4l2-compliance/v4l2-test-subdevs.cpp
+++ b/utils/v4l2-compliance/v4l2-test-subdevs.cpp
@@ -300,8 +300,10 @@ int testSubDevFrameInterval(struct node *node, unsigned pad)
 static int checkMBusFrameFmt(struct node *node, struct v4l2_mbus_framefmt &fmt)
 {
 	fail_on_test(check_0(fmt.reserved, sizeof(fmt.reserved)));
-	fail_on_test(fmt.width == 0 || fmt.width > 65536);
-	fail_on_test(fmt.height == 0 || fmt.height > 65536);
+	if (fmt.code != MEDIA_BUS_FMT_METADATA_FIXED) {
+		fail_on_test(fmt.width == 0 || fmt.width > 65536);
+		fail_on_test(fmt.height == 0 || fmt.height > 65536);
+	}
 	fail_on_test(fmt.code == 0 || fmt.code == ~0U);
 	fail_on_test(fmt.field == ~0U);
 	if (!node->is_passthrough_subdev) {
-- 
2.17.1


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH] v4l2-compliance: skip dimentions tests for media bus format MEDIA_BUS_FMT_METADATA_FIXED
  2020-09-22 17:19 [PATCH] v4l2-compliance: skip dimentions tests for media bus format MEDIA_BUS_FMT_METADATA_FIXED Dafna Hirschfeld
@ 2020-10-14 20:41 ` Helen Koike
  2020-10-20  7:23   ` Hans Verkuil
  0 siblings, 1 reply; 3+ messages in thread
From: Helen Koike @ 2020-10-14 20:41 UTC (permalink / raw)
  To: Dafna Hirschfeld, linux-media
  Cc: mchehab, dafna3, tfiga, hverkuil, linux-rockchip,
	laurent.pinchart, sakari.ailus, kernel, ezequiel



On 9/22/20 2:19 PM, Dafna Hirschfeld wrote:
> The media bus format code MEDIA_BUS_FMT_METADATA_FIXED
> is used for metadata formats that are not configurable
> from userspace and therefore may have any value for
> width and height. So skip width and height tests for
> this format.
> 
> Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>

lgtm

Reviewed-by: Helen Koike <helen.koike@collabora.com>

Thanks
Helen

> ---
> note, this patch should be applied after updating the header
> include/linux/media-bus-format.h to include that new format.
> ---
>  utils/v4l2-compliance/v4l2-test-subdevs.cpp | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/utils/v4l2-compliance/v4l2-test-subdevs.cpp b/utils/v4l2-compliance/v4l2-test-subdevs.cpp
> index ec3ef169..f60853e3 100644
> --- a/utils/v4l2-compliance/v4l2-test-subdevs.cpp
> +++ b/utils/v4l2-compliance/v4l2-test-subdevs.cpp
> @@ -300,8 +300,10 @@ int testSubDevFrameInterval(struct node *node, unsigned pad)
>  static int checkMBusFrameFmt(struct node *node, struct v4l2_mbus_framefmt &fmt)
>  {
>  	fail_on_test(check_0(fmt.reserved, sizeof(fmt.reserved)));
> -	fail_on_test(fmt.width == 0 || fmt.width > 65536);
> -	fail_on_test(fmt.height == 0 || fmt.height > 65536);
> +	if (fmt.code != MEDIA_BUS_FMT_METADATA_FIXED) {
> +		fail_on_test(fmt.width == 0 || fmt.width > 65536);
> +		fail_on_test(fmt.height == 0 || fmt.height > 65536);
> +	}
>  	fail_on_test(fmt.code == 0 || fmt.code == ~0U);
>  	fail_on_test(fmt.field == ~0U);
>  	if (!node->is_passthrough_subdev) {
> 

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH] v4l2-compliance: skip dimentions tests for media bus format MEDIA_BUS_FMT_METADATA_FIXED
  2020-10-14 20:41 ` Helen Koike
@ 2020-10-20  7:23   ` Hans Verkuil
  0 siblings, 0 replies; 3+ messages in thread
From: Hans Verkuil @ 2020-10-20  7:23 UTC (permalink / raw)
  To: Helen Koike, Dafna Hirschfeld, linux-media
  Cc: mchehab, dafna3, tfiga, linux-rockchip, laurent.pinchart,
	sakari.ailus, kernel, ezequiel

On 14/10/2020 22:41, Helen Koike wrote:
> 
> 
> On 9/22/20 2:19 PM, Dafna Hirschfeld wrote:
>> The media bus format code MEDIA_BUS_FMT_METADATA_FIXED
>> is used for metadata formats that are not configurable
>> from userspace and therefore may have any value for
>> width and height. So skip width and height tests for
>> this format.
>>
>> Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
> 
> lgtm
> 
> Reviewed-by: Helen Koike <helen.koike@collabora.com>
> 
> Thanks
> Helen
> 
>> ---
>> note, this patch should be applied after updating the header
>> include/linux/media-bus-format.h to include that new format.
>> ---
>>  utils/v4l2-compliance/v4l2-test-subdevs.cpp | 6 ++++--
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/utils/v4l2-compliance/v4l2-test-subdevs.cpp b/utils/v4l2-compliance/v4l2-test-subdevs.cpp
>> index ec3ef169..f60853e3 100644
>> --- a/utils/v4l2-compliance/v4l2-test-subdevs.cpp
>> +++ b/utils/v4l2-compliance/v4l2-test-subdevs.cpp
>> @@ -300,8 +300,10 @@ int testSubDevFrameInterval(struct node *node, unsigned pad)
>>  static int checkMBusFrameFmt(struct node *node, struct v4l2_mbus_framefmt &fmt)
>>  {
>>  	fail_on_test(check_0(fmt.reserved, sizeof(fmt.reserved)));
>> -	fail_on_test(fmt.width == 0 || fmt.width > 65536);
>> -	fail_on_test(fmt.height == 0 || fmt.height > 65536);
>> +	if (fmt.code != MEDIA_BUS_FMT_METADATA_FIXED) {
>> +		fail_on_test(fmt.width == 0 || fmt.width > 65536);
>> +		fail_on_test(fmt.height == 0 || fmt.height > 65536);
>> +	}

I would always fail if width or height != 0 for this format.

Regards,

	Hans

>>  	fail_on_test(fmt.code == 0 || fmt.code == ~0U);
>>  	fail_on_test(fmt.field == ~0U);
>>  	if (!node->is_passthrough_subdev) {
>>


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-22 17:19 [PATCH] v4l2-compliance: skip dimentions tests for media bus format MEDIA_BUS_FMT_METADATA_FIXED Dafna Hirschfeld
2020-10-14 20:41 ` Helen Koike
2020-10-20  7:23   ` Hans Verkuil

Linux-Rockchip Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-rockchip/0 linux-rockchip/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-rockchip linux-rockchip/ https://lore.kernel.org/linux-rockchip \
		linux-rockchip@lists.infradead.org
	public-inbox-index linux-rockchip

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-rockchip


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git