gpu: Disable Mali Vulkan protected memory

To support L1 HWDRM, Mali DDK now builds with protected memory feature
enabled on some platforms e.g. Geralt, but we are not ready to advertise
this feature to the guest side on those platforms.

Add an environment variable to disable the feature at runtime.

BUG=b:339766043
TEST=CtsDeqpTestCases dEQP-VK.protected_memory.* pass

Change-Id: I2903bf629ff81721cacb1fd5671062d0dfbaca53
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5619355
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org>
Auto-Submit: Fei Shao <fshao@chromium.org>
This commit is contained in:
Fei Shao 2024-06-11 11:28:38 +00:00 committed by crosvm LUCI
parent 7970be1c63
commit bebcc4e4a8

View file

@ -268,6 +268,14 @@ fn get_gpu_render_server_environment(
}
}
// TODO(b/339766043): workaround to disable Vulkan protected memory feature in Mali
if !env.contains_key("MALI_HAL_DISABLE_PROTECTED_MODE") {
env.insert(
"MALI_HAL_DISABLE_PROTECTED_MODE".to_string(),
"1".to_string(),
);
}
Ok(env.iter().map(|(k, v)| format!("{}={}", k, v)).collect())
}