From 5e13eb67993330a678bcb5aafb6bbfaaa69dd185 Mon Sep 17 00:00:00 2001 From: Conn O'Griofa Date: Sat, 3 Oct 2026 23:16:27 +0100 Subject: [PATCH] fix(linux): radv: don't force video_encode on autoprobe (#5849) --- src/platform/linux/misc.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/platform/linux/misc.cpp b/src/platform/linux/misc.cpp index 66a0c784c..1c2eb4b0e 100644 --- a/src/platform/linux/misc.cpp +++ b/src/platform/linux/misc.cpp @@ -1434,10 +1434,16 @@ namespace platf { // https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30039 lizardbyte::common::set_env("AMD_DEBUG", "lowlatencyenc"); - // enable Vulkan video extensions for AMD RADV - lizardbyte::common::set_env("RADV_PERFTEST", "video_encode"); - // Above is deprecated on Mesa 26.1+ and replaced by (keep both to ensure best compatibility): - lizardbyte::common::append_env("RADV_EXPERIMENTAL", "video_encode", ","); + // Overriding the video_encode extension can cause corrupt video due to outdated FW. Override + // only if the user explicitly selects Vulkan so that the autoprobe path will select VAAPI on + // such systems. + // Ref: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/16457 + if (config::video.encoder == "vulkan") { + // enable Vulkan video extensions for AMD RADV + lizardbyte::common::set_env("RADV_PERFTEST", "video_encode"); + // Above is deprecated on Mesa 26.1+ and replaced by (keep both to ensure best compatibility): + lizardbyte::common::append_env("RADV_EXPERIMENTAL", "video_encode", ","); + } // These are allowed to fail. gbm::init();