EDIT: Looks like the Arch maintainers have included the necessary build flags so this wont be necessary, but this is still useful as a basic guide to easily building mesa with additional flags
This year Mesa made some changes to 22.2 that effectively removes hardware encode/decode support from AMD and Intel GPUs/ Mesa in the default configuration.
This means there is a high chance that unless Arch devs decide to not care and add the flags for the codecs back or you decide to use AMDGPU-Pro going forward you may not have support for H264/H265(HEVC)/VC1 hardware encoding/decoding on a GPU using Mesa/VAAPI.
The problem with this comes down to apparently nobody knowing who tf is supposed to pay the license fee/ if its paid for most GPUs in regards to Mesa. In theory your AMD/Intel/Nvidia GPU should already be paid for license wise but this may not trickle down to the OSS drivers and overall its just a fat mess of stupid thanks to MPEG-LA being giant pieces of shit.
So, what to do then? how can you actually use all your GPU and its features? Well since licenses dont apply to the code itself they can have support in the code and you compile it yourself.
Currently the Arch Repo isnt on 22.2 so this isnt needed yet, if you folow these directions as of 08/18/2022 you will not get mesa 22.2
- First, you need to get the package build from Arch repos here https://github.com/archlinux/svntogit-packages/tree/packages/mesa you can click Code and download zip OR using git clone in a directory you made for building it. I believe EOS includes git on default so you should be able to just run this
builddir is just a generic name for what ever you name the directory youll be building in, i wouldnt call it builddir personally but you do you.
I.E
mkdir builddir
cd builddir
git clone --single-branch --branch packages/mesa https://github.com/archlinux/svntogit-packages.git
- Now you need to navigate to the pkgbuild for this, we will use terminal but you can use your file manager of choice and open a terminal there. assuming you followed the initial steps you should already be in your builddir
cd svntogit-packages/trunk
- Now you need to edit the pkgbuild, Ill be using nano in this example but use w/e editor youre comfortable with and know how to use. This wont include how to use nano though
nano PKGBUILD
navigate to the section of the pkgbuild just above
# Print config
meson configure build
youll see build flags like -D valgrind=enabled
add this just after valgrind
-D video-codecs=h264dec,h264enc,h265dec,h265enc,vc1dec
it should now look like
-D shared-glapi=enabled \
-D microsoft-clc=disabled \
-D valgrind=enabled \
-D video-codecs=h264dec,h264enc,h265dec,h265enc,vc1dec
- after editing the pkgbuild you may now run
makepkg -si
from inside the same directory as the pkgbuild, this will pull in needed depends and build/install the package.
This all may not even end up being needed based on how things go, but luckily Arch PKGBUILDs make fixing the issue incredibly easy. If not being needed, great! otherwise its going to require you as the user to do the work yourself. Since this will likely also propagate to Flatpaks also I look into how best handle that situation and add a guide here for that also.