From 069c20be40b30ae3cc3fee5b51399ff2177b9b08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Sat, 19 Aug 2023 02:16:04 -0400 Subject: [PATCH] Brightness: don't make DDC/CI a slow operation --- src/detection/brightness/brightness_apple.c | 4 +++- src/detection/brightness/brightness_linux.c | 9 +++------ src/detection/brightness/brightness_windows.cpp | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/detection/brightness/brightness_apple.c b/src/detection/brightness/brightness_apple.c index eaa21cdf0..e7e19fed2 100644 --- a/src/detection/brightness/brightness_apple.c +++ b/src/detection/brightness/brightness_apple.c @@ -108,8 +108,10 @@ const char* ffDetectBrightness(FFlist* result) detectWithDisplayServices(displayServer, result); - if (instance.config.allowSlowOperations && displayServer->displays.length > result->length) + #ifdef __aarch64__ + if (displayServer->displays.length > result->length) detectWithDdcci(result); + #endif return NULL; } diff --git a/src/detection/brightness/brightness_linux.c b/src/detection/brightness/brightness_linux.c index 5168dd0d6..8ab4e5f86 100644 --- a/src/detection/brightness/brightness_linux.c +++ b/src/detection/brightness/brightness_linux.c @@ -139,12 +139,9 @@ const char* ffDetectBrightness(FFlist* result) detectWithBacklight(result); #ifdef FF_HAVE_DDCUTIL - if (instance.config.allowSlowOperations) - { - const FFDisplayServerResult* displayServer = ffConnectDisplayServer(); - if (result->length < displayServer->displays.length) - detectWithDdcci(result); - } + const FFDisplayServerResult* displayServer = ffConnectDisplayServer(); + if (result->length < displayServer->displays.length) + detectWithDdcci(result); #endif return NULL; diff --git a/src/detection/brightness/brightness_windows.cpp b/src/detection/brightness/brightness_windows.cpp index dcde38502..28f489b96 100644 --- a/src/detection/brightness/brightness_windows.cpp +++ b/src/detection/brightness/brightness_windows.cpp @@ -76,7 +76,7 @@ const char* ffDetectBrightness(FFlist* result) if (hasBuiltinDisplay(displayServer)) detectWithWmi(result); - if (instance.config.allowSlowOperations && result->length < displayServer->displays.length) + if (result->length < displayServer->displays.length) detectWithDdcci(displayServer, result); return NULL; }