* [PATCH v2] v4l2-compliance: fail if format MEDIA_BUS_FMT_METADATA_FIXED has width/height not equal 0
@ 2020-10-20 15:56 Dafna Hirschfeld
0 siblings, 0 replies; only message in thread
From: Dafna Hirschfeld @ 2020-10-20 15:56 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. This format should have width and height
set to 0.
Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Reviewed-by: Helen Koike <helen.koike@collabora.com>
---
The patch should be applied together with the kernel patch
https://patchwork.kernel.org/project/linux-media/patch/20201020154522.654-1-dafna.hirschfeld@collabora.com/
changes from v1:
add a test that check if the mbus format is MEDIA_BUS_FMT_METADATA_FIXED
and the width or height are not 0
utils/v4l2-compliance/v4l2-test-subdevs.cpp | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/utils/v4l2-compliance/v4l2-test-subdevs.cpp b/utils/v4l2-compliance/v4l2-test-subdevs.cpp
index ec3ef169..4dedc7a9 100644
--- a/utils/v4l2-compliance/v4l2-test-subdevs.cpp
+++ b/utils/v4l2-compliance/v4l2-test-subdevs.cpp
@@ -300,8 +300,12 @@ 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);
+ } else {
+ fail_on_test(fmt.width != 0 || fmt.height != 0);
+ }
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 related [flat|nested] only message in thread
only message in thread, other threads:[~2020-10-20 15:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-20 15:56 [PATCH v2] v4l2-compliance: fail if format MEDIA_BUS_FMT_METADATA_FIXED has width/height not equal 0 Dafna Hirschfeld
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).