Merge pull request #15071 from JosJuice/android-remove-custom-driver-check

Android: Allow custom drivers regardless of GPU vendor
This commit is contained in:
Jordan Woyak authored and GitHub committed 2026-12-02 15:13:07 -06:00
commit 6b78bcf360
3 files changed
+5 -77

No files matched your search

@@ -35,17 +35,6 @@ interface GpuDriverHelper {
*/
external fun supportsCustomDriverLoading(): Boolean
/**
* Queries the driver for manual max clock forcing support
*/
external fun supportsForceMaxGpuClocks(): Boolean
/**
* Calls into the driver to force the GPU to run at the maximum possible clock speed
* @param force Whether to enable or disable the forced clocks
*/
external fun forceMaxGpuClocks(enable: Boolean)
/**
* Uninstalls the currently installed custom driver
*/
-51
View File
@@ -24,8 +24,6 @@
extern "C" {
#if defined(_M_ARM_64)
JNIEXPORT jobjectArray JNICALL
Java_org_dolphinemu_dolphinemu_utils_GpuDriverHelper_00024Companion_getSystemDriverInfo(JNIEnv* env,
jobject)
@@ -96,55 +94,6 @@ JNIEXPORT jboolean JNICALL
Java_org_dolphinemu_dolphinemu_utils_GpuDriverHelper_00024Companion_supportsCustomDriverLoading(
JNIEnv* env, jobject instance)
{
// If the KGSL (Adreno) or kbase (Mali) device exists custom drivers can be loaded using
// adrenotools
return Vulkan::SupportsCustomDriver();
}
JNIEXPORT jboolean JNICALL
Java_org_dolphinemu_dolphinemu_utils_GpuDriverHelper_00024Companion_supportsForceMaxGpuClocks(
JNIEnv* env, jobject instance)
{
// If the KGSL device exists adrenotools can be used to set GPU turbo mode
return Vulkan::SupportsCustomDriver();
}
JNIEXPORT void JNICALL
Java_org_dolphinemu_dolphinemu_utils_GpuDriverHelper_00024Companion_forceMaxGpuClocks(
JNIEnv* env, jobject instance, jboolean enable)
{
adrenotools_set_turbo(enable);
}
#else
JNIEXPORT jobjectArray JNICALL
Java_org_dolphinemu_dolphinemu_utils_GpuDriverHelper_00024Companion_getSystemDriverInfo(
JNIEnv* env, jobject instance)
{
auto array = env->NewObjectArray(0, env->FindClass("java/lang/String"), nullptr);
return array;
}
JNIEXPORT jboolean JNICALL
Java_org_dolphinemu_dolphinemu_utils_GpuDriverHelper_00024Companion_supportsCustomDriverLoading(
JNIEnv* env, jobject instance)
{
return false;
}
JNIEXPORT jboolean JNICALL
Java_org_dolphinemu_dolphinemu_utils_GpuDriverHelper_00024Companion_supportsForceMaxGpuClocks(
JNIEnv* env, jobject instance)
{
return false;
}
JNIEXPORT void JNICALL
Java_org_dolphinemu_dolphinemu_utils_GpuDriverHelper_00024Companion_forceMaxGpuClocks(
JNIEnv* env, jobject instance, jboolean enable)
{
}
#endif
}
@@ -247,23 +247,13 @@ void LogVulkanResult(Common::Log::LogLevel level, const char* func_name, const i
}
#ifdef ANDROID
static bool CheckKgslPresent()
{
constexpr auto KgslPath{"/dev/kgsl-3d0"};
return access(KgslPath, F_OK) == 0;
}
static bool CheckKbasePresent()
{
constexpr auto KbasePath{"/dev/mali0"};
return access(KbasePath, F_OK) == 0;
}
bool SupportsCustomDriver()
{
return android_get_device_api_level() >= 28 && (CheckKgslPresent() || CheckKbasePresent());
#if _M_ARM_64
return android_get_device_api_level() >= 28;
#else
return false;
#endif
}
#endif