This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/v4l-utils.git tree:

Subject: v4l2-compliance: improve fmtdesc.description check
Author:  Hans Verkuil <[email protected]>
Date:    Thu Mar 11 17:59:28 2021 +0100

Check that the driver doesn't make up pixelformat descriptions.
It should be left to the v4l2 core.

Signed-off-by: Hans Verkuil <[email protected]>

 utils/v4l2-compliance/v4l2-test-formats.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=f53c2fa1a95154f75cf4a510113179ff39d548e7
diff --git a/utils/v4l2-compliance/v4l2-test-formats.cpp 
b/utils/v4l2-compliance/v4l2-test-formats.cpp
index 61bb317debac..60ebf559a5cc 100644
--- a/utils/v4l2-compliance/v4l2-test-formats.cpp
+++ b/utils/v4l2-compliance/v4l2-test-formats.cpp
@@ -255,6 +255,14 @@ static int testEnumFormatsType(struct node *node, unsigned 
type)
                        return fail("fmtdesc.description not set\n");
                if (!fmtdesc.pixelformat)
                        return fail("fmtdesc.pixelformat not set\n");
+
+               // Check that the driver does not overwrites the kernel 
pixelformat description
+               std::string descr = pixfmt2s(fmtdesc.pixelformat);
+               if (strcmp(descr.c_str(), (const char *)fmtdesc.description) &&
+                   memcmp(descr.c_str(), "Unknown", 7))
+                       return fail("fmtdesc.description mismatch: was '%s', 
expected '%s'\n",
+                                   fmtdesc.description, descr.c_str());
+
                if (node->g_direct() && (fmtdesc.flags & 
V4L2_FMT_FLAG_EMULATED))
                        return fail("drivers must never set the emulated 
flag\n");
                if (fmtdesc.flags & ~(V4L2_FMT_FLAG_COMPRESSED | 
V4L2_FMT_FLAG_EMULATED |

_______________________________________________
linuxtv-commits mailing list
[email protected]
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to