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-tracer: fix autogen script for AV1
Author:  Deborah Brouwer <deborah.brou...@collabora.com>
Date:    Tue Oct 17 09:58:19 2023 -0700

The AV1 uAPI introduced some new enums and also defined
two array sizes arithmetically e.g.
__u32 mi_col_starts[V4L2_AV1_MAX_TILE_COLS + 1];

Adjust the autogeneration scripts to handle these changes.

Signed-off-by: Deborah Brouwer <deborah.brou...@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-ci...@xs4all.nl>

 utils/v4l2-tracer/v4l2-tracer-gen.pl | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=e1a55dc8c989d79277d71ba8179841951d789c90
diff --git a/utils/v4l2-tracer/v4l2-tracer-gen.pl 
b/utils/v4l2-tracer/v4l2-tracer-gen.pl
index cbfdfbe06730..e8f9d71ead5c 100755
--- a/utils/v4l2-tracer/v4l2-tracer-gen.pl
+++ b/utils/v4l2-tracer/v4l2-tracer-gen.pl
@@ -32,7 +32,9 @@ EOF
 
 sub convert_type_to_json_type {
        my $type = shift;
-       if ($type eq __u8 || $type eq char || $type eq __u16 || $type eq __s8 
|| $type eq __s16 || $type eq __s32 || $type eq 'int') {
+       if ($type eq __u8 || $type eq char || $type eq __u16 || $type eq __s8 
|| $type eq __s16 || $type eq __s32 || $type eq 'int' ||
+               $type eq 'v4l2_av1_warp_model' || $type eq 
'v4l2_av1_frame_restoration_type' || $type eq 'v4l2_av1_frame_type' ||
+               $type eq 'v4l2_av1_interpolation_filter' || $type eq 
'v4l2_av1_tx_mode') {
                return "int";
        }
        if ($type eq __u32 || $type eq __le32 || $type eq __s64) {
@@ -658,19 +660,29 @@ sub struct_gen_ctrl {
                @words = grep  {!/\]/} @words; # remove values with brackets 
e.g. V4L2_H264_REF_LIST_LEN]
 
                ($type) = $words[0];
+               if ($type eq 'enum') {
+                       $type = $words[1];
+               }
                $json_type = convert_type_to_json_type($type);
 
                ($member) = $words[scalar @words - 1];
 
                # generate members that are arrays
                if ($line =~ /.*\[.*/) {
+
+                       # e.g. two dimensional array [x][y]
+                       my @dimensions = ($line) =~ /\[(.*?)\]/g;
+
+                       #for struct v4l2_av1_tile_info [V4L2_AV1_MAX_TILE_ROWS 
+ 1]
+                       if (grep {$_ =~ /\+/} @dimensions) {
+                               $member = $words[scalar @words - 3];
+                       }
+
                        printf $fh_trace_cpp "\t\/\* %s \*\/\n", $line; # add 
comment
                        printf $fh_trace_cpp "\tjson_object *%s_obj = 
json_object_new_array();\n", $member;
                        printf $fh_retrace_cpp "\n\t\/\* %s \*\/\n", $line; # 
add comment
 
-                       my @dimensions = ($line) =~ /\[(\w+)\]/g;
                        $dimensions_count = scalar @dimensions;
-
                        if ($dimensions_count > 1) {
                                printf $fh_retrace_cpp "\tint count_%s = 0;\n", 
$member;
                        }

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to