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-dbg: autodetect stride
Author:  Hans Verkuil <[email protected]>
Date:    Thu Mar 17 12:02:20 2016 +0100

When listing registers v4l2-dbg now queries the first register to detect
the range that should be used. If non-zero that size is used, otherwise the
given stride value is used.

Support for formatting for a stride of 2 is also added, that was missing.

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

 utils/v4l2-dbg/v4l2-dbg.cpp | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=d405cd5a468b2893ddd5faeca1e526e7891ec8d2
diff --git a/utils/v4l2-dbg/v4l2-dbg.cpp b/utils/v4l2-dbg/v4l2-dbg.cpp
index 35a24c6adfd9..b0d0976b96f5 100644
--- a/utils/v4l2-dbg/v4l2-dbg.cpp
+++ b/utils/v4l2-dbg/v4l2-dbg.cpp
@@ -249,14 +249,26 @@ static std::string cap2s(unsigned cap)
 
 static void print_regs(int fd, struct v4l2_dbg_register *reg, unsigned long 
min, unsigned long max, int stride)
 {
-       unsigned long mask = stride > 1 ? 0x1f : 0x0f;
+       unsigned long mask;
        unsigned long i;
        int line = 0;
 
+       /* Query size of the first register */
+       reg->reg = min;
+       if (ioctl(fd, VIDIOC_DBG_G_REGISTER, reg) == 0) {
+               /* If size is set, then use this as the stride */
+               if (reg->size)
+                       stride = reg->size;
+       }
+
+       mask = stride > 2 ? 0x1f : 0x0f;
+
        for (i = min & ~mask; i <= max; i += stride) {
                if ((i & mask) == 0 && line % 32 == 0) {
                        if (stride == 4)
                                printf("\n                00       04       08  
     0C       10       14       18       1C");
+                       else if (stride == 2)
+                               printf("\n            00   02   04   06   08   
0A   0C   0E");
                        else
                                printf("\n          00 01 02 03 04 05 06 07 08 
09 0A 0B 0C 0D 0E 0F");
                }

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

Reply via email to