From patchwork Tue Oct 17 08:40:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 13424798 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BCD3FCDB482 for ; Tue, 17 Oct 2023 08:40:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234673AbjJQIkt (ORCPT ); Tue, 17 Oct 2023 04:40:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233882AbjJQIks (ORCPT ); Tue, 17 Oct 2023 04:40:48 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98B3AB0 for ; Tue, 17 Oct 2023 01:40:45 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5256C433C8; Tue, 17 Oct 2023 08:40:44 +0000 (UTC) Message-ID: <0af44b62-4c18-4ec1-ba83-cca712a53acb@xs4all.nl> Date: Tue, 17 Oct 2023 10:40:42 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US, nl To: Deborah Brouwer Cc: Linux Media Mailing List From: Hans Verkuil Subject: v4l2-tracer fails to compile after syncing to latest kernel headers Autocrypt: addr=hverkuil@xs4all.nl; keydata= xsFNBFQ84W0BEAC7EF1iL4s3tY8cRTVkJT/297h0Hz0ypA+ByVM4CdU9sN6ua/YoFlr9k0K4 BFUlg7JzJoUuRbKxkYb8mmqOe722j7N3HO8+ofnio5cAP5W0WwDpM0kM84BeHU0aPSTsWiGR yw55SOK2JBSq7hueotWLfJLobMWhQii0Zd83hGT9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q9LWFIZhQ7TA1WD/9yxJvQrpf6LcNrr8uMlQWCg2iz2q1LGt1Itkuu KaavEF9nqHmoqhSfZeAIKAPn6xuYbGxXDrpN7dXCOH92fscLodZqZtK5FtbLvO572EPfxneY UT7JzDc/5LT9cFFugTMOhq1BG62vUm/F6V91+unyp4dRlyryAeqEuISykhvjZCVHk/woaMZv c1Dm4Uvkv0Ilelt3Pb9J7zhcx6sm5T7v16VceF96jG61bnJ2GFS+QZerZp3PY27XgtPxRxYj AmFUeF486PHx/2Yi4u1rQpIpC5inPxIgR1+ZFvQrAV36SvLFfuMhyCAxV6WBlQc85ArOiQZB Wm7L0repwr7zEJFEkdy8C81WRhMdPvHkAIh3RoY1SGcdB7rB3wCzfYkAuCBqaF7Zgfw8xkad KEiQTexRbM1sc/I8ACpla3N26SfQwrfg6V7TIoweP0RwDrcf5PVvwSWsRQp2LxFCkwnCXOra gYmkrmv0duG1FStpY+IIQn1TOkuXrciTVfZY1cZD0aVxwlxXBnUNZZNslldvXFtndxR0SFat sflovhDxKyhFwXOP0Rv8H378/+14TaykknRBIKEc0+lcr+EMOSUR5eg4aURb8Gc3Uc7fgQ6q UssTXzHPyj1hAyDpfu8DzAwlh4kKFTodxSsKAjI45SLjadSc94/5Gy8645Y1KgBzBPTH7Q== Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Hi Deb, I wanted to sync the kernel headers used in v4l-utils to the latest versions, but that caused v4l2-tracer to fail on the new AV1 struct. To test this yourself, go to your checked out kernel git repo and run make headers_install: cd kernel-repo-dir make headers_install Next to go the v4l-utils directory and run: sync-with-kernel.sh path-to-kernel-repo-dir Next build v4l-utils. There are two issues: 1) v4l2-trace doesn't support the new AV1 struct, at least this patch is needed: And even with that it fails to compile: $ ninja -C build ninja: Entering directory `build' [1/5] Compiling C++ object utils/v4l2-tracer/libv4l2tracer.so.p/meson-generated_.._trace-gen.cpp.o FAILED: utils/v4l2-tracer/libv4l2tracer.so.p/meson-generated_.._trace-gen.cpp.o ccache c++ -Iutils/v4l2-tracer/libv4l2tracer.so.p -Iutils/v4l2-tracer -I../utils/v4l2-tracer -I../utils/common -I../lib/include -I../include -I/usr/include/json-c -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu++11 -O2 -g -Wpointer-arith -D_GNU_SOURCE -DPROMOTED_MODE_T=int -DENABLE_NLS -include /home/hans/work/src/v4l/v4l-utils/build/config.h -fPIC -U_FILE_OFFSET_BITS -D_FILE_OFFSET_BITS=32 -D_LARGEFILE64_SOURCE -MD -MQ utils/v4l2-tracer/libv4l2tracer.so.p/meson-generated_.._trace-gen.cpp.o -MF utils/v4l2-tracer/libv4l2tracer.so.p/meson-generated_.._trace-gen.cpp.o.d -o utils/v4l2-tracer/libv4l2tracer.so.p/meson-generated_.._trace-gen.cpp.o -c utils/v4l2-tracer/trace-gen.cpp utils/v4l2-tracer/trace-gen.cpp: In function ‘void trace_v4l2_av1_global_motion_gen(void*, json_object*)’: utils/v4l2-tracer/trace-gen.cpp:1193:49: error: ‘json_object_new_’ was not declared in this scope; did you mean ‘json_object_new_int’? 1193 | json_object_array_add(type_obj, json_object_new_(p->type[i])); | ^~~~~~~~~~~~~~~~ | json_object_new_int utils/v4l2-tracer/trace-gen.cpp: In function ‘void trace_v4l2_av1_loop_restoration_gen(void*, json_object*)’: utils/v4l2-tracer/trace-gen.cpp:1220:67: error: ‘json_object_new_’ was not declared in this scope; did you mean ‘json_object_new_int’? 1220 | json_object_array_add(frame_restoration_type_obj, json_object_new_(p->frame_restoration_type[i])); | ^~~~~~~~~~~~~~~~ | json_object_new_int ... I suspect the parsing of the header failed here. So either the parser or the v4l2-controls.h header (or both!) likely need work. Can you take a look? Regards, Hans diff --git a/utils/v4l2-tracer/retrace.cpp b/utils/v4l2-tracer/retrace.cpp index 88e70ea9..06d4f62a 100644 --- a/utils/v4l2-tracer/retrace.cpp +++ b/utils/v4l2-tracer/retrace.cpp @@ -872,6 +872,18 @@ struct v4l2_ext_control *retrace_v4l2_ext_control(json_object *parent_obj, int c case V4L2_CID_STATELESS_MPEG2_QUANTISATION: p->ptr = retrace_v4l2_ctrl_mpeg2_quantisation_gen(v4l2_ext_control_obj); break; + case V4L2_CID_STATELESS_AV1_SEQUENCE: + p->ptr = retrace_v4l2_ctrl_av1_sequence_gen(v4l2_ext_control_obj); + break; + case V4L2_CID_STATELESS_AV1_TILE_GROUP_ENTRY: + p->ptr = retrace_v4l2_ctrl_av1_tile_group_entry_gen(v4l2_ext_control_obj); + break; + case V4L2_CID_STATELESS_AV1_FRAME: + p->ptr = retrace_v4l2_ctrl_av1_frame_gen(v4l2_ext_control_obj); + break; + case V4L2_CID_STATELESS_AV1_FILM_GRAIN: + p->ptr = retrace_v4l2_ctrl_av1_film_grain_gen(v4l2_ext_control_obj); + break; default: line_info("\n\tWarning: cannot retrace control: %s", val2s(p->id, control_val_def).c_str()); diff --git a/utils/v4l2-tracer/trace.cpp b/utils/v4l2-tracer/trace.cpp index 0e8531ff..4ddac491 100644 --- a/utils/v4l2-tracer/trace.cpp +++ b/utils/v4l2-tracer/trace.cpp @@ -407,6 +407,18 @@ void trace_v4l2_ext_control(void *arg, json_object *parent_obj, std::string key_ case V4L2_CID_STATELESS_MPEG2_QUANTISATION: trace_v4l2_ctrl_mpeg2_quantisation_gen(p->p_mpeg2_quantisation, v4l2_ext_control_obj); break; + case V4L2_CID_STATELESS_AV1_SEQUENCE: + trace_v4l2_ctrl_av1_sequence_gen(p->p_av1_sequence, v4l2_ext_control_obj); + break; + case V4L2_CID_STATELESS_AV1_TILE_GROUP_ENTRY: + trace_v4l2_ctrl_av1_tile_group_entry_gen(p->p_av1_tile_group_entry, v4l2_ext_control_obj); + break; + case V4L2_CID_STATELESS_AV1_FRAME: + trace_v4l2_ctrl_av1_frame_gen(p->p_av1_frame, v4l2_ext_control_obj); + break; + case V4L2_CID_STATELESS_AV1_FILM_GRAIN: + trace_v4l2_ctrl_av1_film_grain_gen(p->p_av1_film_grain, v4l2_ext_control_obj); + break; case V4L2_CID_MPEG_VIDEO_DEC_PTS: case V4L2_CID_MPEG_VIDEO_DEC_FRAME: case V4L2_CID_MPEG_VIDEO_DEC_CONCEAL_COLOR: