Linux Media Controller development
 help / color / mirror / Atom feed
From: Deborah Brouwer <deborah.brouwer@collabora.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: v4l2-tracer fails to compile after syncing to latest kernel headers
Date: Tue, 17 Oct 2023 09:54:00 -0700	[thread overview]
Message-ID: <ZS68KKvhnq+QNXkN@mz550> (raw)
In-Reply-To: <0af44b62-4c18-4ec1-ba83-cca712a53acb@xs4all.nl>

On Tue, Oct 17, 2023 at 10:40:42AM +0200, Hans Verkuil wrote:
> 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.

Hi Hans,
Thanks for letting me know.  The autogeneration scripts actually handled
a lot of AV1 really nicely.  There are just two small changes which I
will send a patch for that should let you compile.  Changes to actually
trace AV1 will follow later. And I promise that improving the readability of
the autogeneration script is on my todo list :)

Deborah

> 
> 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:
> 
> 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:
> 
> 
> 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

      reply	other threads:[~2023-10-17 16:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-17  8:40 v4l2-tracer fails to compile after syncing to latest kernel headers Hans Verkuil
2023-10-17 16:54 ` Deborah Brouwer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZS68KKvhnq+QNXkN@mz550 \
    --to=deborah.brouwer@collabora.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox