Compiling my video drivers generate the following error:
xilinx-dma.h:51: return container_of(e->pipe, struct xvip_pipeline, pipe);
Found that the following line is removed from the struct media_entity {} defined in ./media/media-entity.h
int stream_count; struct media_pipeline *pipe; In kernel version 6.1.55 (Build in ARM64 architecture)
The video driver is compiled ok under kernel version 5.15.0-131. (Build in x86_64 architecture)
I am wondering the reason of removing *pipe, and how to resolve it?
Thank you, Tiger
That's a kernel policy, documented here.
Long story short: you might know kernel is very-very careful to never break userspace API. Basically, as far as the kernel concerned, you can get an app built at some 1995 year and it will still run fine on today's kernel.
Well, that's different with the insides of the kernel. Kernel is ≈34 years old at this point, and the reason it is still developed just fine and haven't got drown under swaths of legacy is that the insides are being constantly refactored. To facilitate such longevity kernel has established that whoever wants to write a driver should contribute it to the kernel, so that kernel developers would make sure it always works. It is technically possible to write a driver and not to contribute it, but then you're on your own.
With that said…
…you are clearly compiling a 3rd-party driver that was not contributed to the kernel. As explained above, making sure it works requires whoever maintains the driver to update the interfaces for each major kernel release. The driver authors I presume were just lazy to send it upstream, and latter they stopped maintaining the driver altogether (because 6.1 you're compiling for is 3 years old at this point — I mean, not the minor release but the major one), so you'd need to update the driver yourself if you want it to compile for newer kernel.
P.S.: if you are up to updating the driver, to avoid researching you can download NVidia proprietary Linux driver and look at their DKMS code. I'm pretty sure all of the
#ifdef
s you'd need to add for your driver will be there, so you could just replicate what they did.But sending the driver upstream would be best course of action, of course 😊