Creating/Using a custom radeon driver

I’ve just recently switched to Fedora, and a kernel patch required to make my system operate correctly is not in the kernel, and apparently due to political issues, is unlikely to be. I’m looking for advice on what options I have from here.

An issue I previously encountered on Debian was with my Ultrawide screen 2560x1080@60Hz was that I had to manually set the resolution using lots of hacky commands with xrandr to get it to work at a reduced refresh rate.

After switching to fedora, I had another look at trying to solve this, as xrandr isn’t available on wayland, and the recommended way to get the correct resolution, is to get your kernel to actually display the correct resolution.

I found this really useful blog post:

Which showed how you are able to overclock the clock frequency of your hdmi cable in order to get the required resolution to be used. In the nvidia noveau drivers, this capability already is provided via the noveau.hdmimhz boot option.

As far as I can tell, this is perfectly safe, and many people including me for a few days, have used it without any issue, and in most cases only very minimal overclocking is required.
The following links show the blog post’s author trying to get their patch merged into the kernel:
https://bugzilla.kernel.org/show_bug.cgi?id=172421

They believe the reason that they are unable to get it merged, is because the maintainers of the radeon driver for linux, are in AMD’s payrole, so they want you to buy the newer cards (which use the amdgpu driver) instead.

Their patch was slightly outdated for the 6.2.0 kernel that fedora ships with so I took it upon myself and successfully ported it to the 6.2.0 kernel, adding a displayport → hdmi adaptor support, and consequently fixing my display and allowing me to run wayland / GDM displaying in the correct resolution.

From here, I’m not sure where to go. It seems that getting the patch actually merged into the kernel is going to be very difficult so I’ve come up with some other options.

Try to get in merged into the kernel

I’m not really sure how to approach this - Unless the way shown through 172421 – radeon: allow to set the TMDS frequency by a special kernel parameter is not the correct starting point, then I think this is unfortunately a dead end

Build a driver only package that me and others can install on fedora (Best option)

Is it possible to just build the radeon driver, then apply it to kernels? I would have thought so since drivers can be installed via rpm fusion, but I don’t really know how this works.
If I am able to build just the radeon module, then I don’t need rebuild the entire kernel all the time. I think this could be done with a “copr” repo under my name, so I am solely responsible for it. This would definitely be the best option if its not possible to get it merged into the linux kernel.

Other options

  1. Fork fedora’s kernel and keep updating the driver in it
    While this is an option, it is a struggle to justify rebuilding the entire kernel every 6 months when fedora updates

  2. Try to get the patch merged into fedora only ##
    Given: Fedora Linux Kernel Overview :: Fedora Docs
    I think that it doesn’t really qualify for “has an upstream developer actively trying to get their code merged into linus’s tree”, however it could be argued that since radeon drivers are so old and only used for very old cards, the maintenance burden would be very low.

Is there any other good options I’ve missed? Please could someone provide me guidance on how I would go about converting a patch to the linux kernel i’ve developed, into a (rpm) package that others can install.

So I’ve managed to improve many of the issues I had:
By just copying out the radeon module, I am able to execute:
make -C /usr/src/kernels/$(uname -r)/ M=$(pwd) install_modules (needs current kernel headers installed, may need to sudo dnf upgrade as kernel headers aren’t kept around into the repos
This puts modules in /lib/modules/kernel_version/…
Originally this seemed to work by itself, but when I upgraded to Fedora 38 today I needed an additional step:
dracut --regenerate-all --force which takes whats in /lib/modules and remakes the initramfs.

The dracut --regenerate-all --force is definitely overkill since it rebuilds all kernel versions, but I didn’t want to bother figuring out how to only regenerate one, and I knew that i hadn’t changed /lib/modules anywhere else.

Only having to keep around the radeon module, under 200MB works fine for me, and I’m not too bothered about redoing it each kernel upgrade, though they do seem to be quite frequent.