From e2cef238ece108186caec9b16a8970971c7d7dd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Sat, 1 Jul 2023 20:10:32 +0800 Subject: [PATCH] Revert "GPU (Windows): add debug logs for #484" This reverts commit 1f799d16c99c7b245a23e6328b1312003d5635c0. --- src/detection/gpu/gpu.c | 5 ----- src/detection/gpu/gpu_windows.c | 12 ------------ src/modules/gpu/gpu.c | 5 ----- 3 files changed, 22 deletions(-) diff --git a/src/detection/gpu/gpu.c b/src/detection/gpu/gpu.c index 28040cd5c..9300b2484 100644 --- a/src/detection/gpu/gpu.c +++ b/src/detection/gpu/gpu.c @@ -32,20 +32,15 @@ const char* ffGetGPUVendorString(unsigned vendorId) const char* ffDetectGPU(const FFGPUOptions* options, FFlist* result) { - fputs("ffDetectGPU start\n", stderr); if (!options->forceVulkan) { const char* error = ffDetectGPUImpl(options, result); - fputs("ffDetectGPU end 1\n", stderr); if (!error) return NULL; } - fputs("ffDetectVulkan start\n", stderr); FFVulkanResult* vulkan = ffDetectVulkan(); - fputs("ffDetectVulkan end\n", stderr); if (vulkan->error) return "GPU detection failed"; ffListDestroy(result); ffListInitMove(result, &vulkan->gpus); - fputs("ffDetectGPU end 2\n", stderr); return NULL; } diff --git a/src/detection/gpu/gpu_windows.c b/src/detection/gpu/gpu_windows.c index ee1f9abf2..621681e62 100644 --- a/src/detection/gpu/gpu_windows.c +++ b/src/detection/gpu/gpu_windows.c @@ -6,7 +6,6 @@ const char* ffDetectGPUImpl(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist* gpus) { - fputs("ffDetectGPUImpl: start\n", stderr); DISPLAY_DEVICEW displayDevice = { .cb = sizeof(displayDevice) }; wchar_t regKey[MAX_PATH] = L"SYSTEM\\CurrentControlSet\\Control\\Video\\{"; const uint32_t regKeyPrefixLength = (uint32_t) wcslen(regKey); @@ -16,12 +15,9 @@ const char* ffDetectGPUImpl(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist* { if (displayDevice.StateFlags & DISPLAY_DEVICE_MIRRORING_DRIVER) continue; - fwprintf(stderr, L"ffDetectGPUImpl EnumDisplayDevicesW %ls\n", displayDevice.DeviceKey); const uint32_t deviceKeyLength = (uint32_t) wcslen(displayDevice.DeviceKey); - fprintf(stderr, "ffDetectGPUImpl deviceKeyLength %d\n", (int) deviceKeyLength); if (deviceKeyLength != 100 || wmemcmp(&displayDevice.DeviceKey[deviceKeyLength - 4], L"0000", 4) != 0) continue; - fputs("ffDetectGPUImpl ffListAdd\n", stderr); FFGPUResult* gpu = (FFGPUResult*)ffListAdd(gpus); ffStrbufInit(&gpu->vendor); ffStrbufInitWS(&gpu->name, displayDevice.DeviceString); @@ -33,17 +29,12 @@ const char* ffDetectGPUImpl(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist* if (displayDevice.DeviceKey[deviceKeyPrefixLength - 1] == '{') { - fputs("ffDetectGPUImpl displayDevice.DeviceKey[deviceKeyPrefixLength - 1]\n", stderr); wmemcpy(regKey + regKeyPrefixLength, displayDevice.DeviceKey + deviceKeyPrefixLength, 100 - regKeyPrefixLength + 1); FF_HKEY_AUTO_DESTROY hKey = NULL; - fputs("ffDetectGPUImpl ffRegOpenKeyForRead start\n", stderr); if (!ffRegOpenKeyForRead(HKEY_LOCAL_MACHINE, regKey, &hKey, NULL)) continue; - fputs("ffDetectGPUImpl ffRegOpenKeyForRead end\n", stderr); ffRegReadStrbuf(hKey, L"DriverVersion", &gpu->driver, NULL); - fputs("ffDetectGPUImpl DriverVersion end\n", stderr); ffRegReadStrbuf(hKey, L"ProviderName", &gpu->vendor, NULL); - fputs("ffDetectGPUImpl ProviderName end\n", stderr); if(ffStrbufContainS(&gpu->vendor, "AMD") || ffStrbufContainS(&gpu->vendor, "ATI")) ffStrbufSetS(&gpu->vendor, FF_GPU_VENDOR_NAME_AMD); @@ -52,10 +43,8 @@ const char* ffDetectGPUImpl(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist* else if(ffStrbufContainS(&gpu->vendor, "NVIDIA")) ffStrbufSetS(&gpu->vendor, FF_GPU_VENDOR_NAME_NVIDIA); - fputs("ffDetectGPUImpl HardwareInformation.qwMemorySize start\n", stderr); if (!ffRegReadUint64(hKey, L"HardwareInformation.qwMemorySize", &gpu->dedicated.total, NULL)) { - fputs("ffDetectGPUImpl HardwareInformation.MemorySize start\n", stderr); uint32_t vmem = 0; if (ffRegReadUint(hKey, L"HardwareInformation.MemorySize", &vmem, NULL)) gpu->dedicated.total = vmem; @@ -63,7 +52,6 @@ const char* ffDetectGPUImpl(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist* gpu->type = gpu->dedicated.total > 1024 * 1024 * 1024 ? FF_GPU_TYPE_DISCRETE : FF_GPU_TYPE_INTEGRATED; } } - fputs("ffDetectGPUImpl end\n", stderr); return NULL; } diff --git a/src/modules/gpu/gpu.c b/src/modules/gpu/gpu.c index 35571a1dd..d7ec2d246 100644 --- a/src/modules/gpu/gpu.c +++ b/src/modules/gpu/gpu.c @@ -79,7 +79,6 @@ static void printGPUResult(FFGPUOptions* options, uint8_t index, const FFGPUResu void ffPrintGPU(FFGPUOptions* options) { - fputs("ffPrintGPU start\n", stderr); FF_LIST_AUTO_DESTROY gpus = ffListCreate(sizeof (FFGPUResult)); const char* error = ffDetectGPU(options, &gpus); if (error) @@ -87,7 +86,6 @@ void ffPrintGPU(FFGPUOptions* options) ffPrintError(FF_GPU_MODULE_NAME, 0, &options->moduleArgs, "%s", error); return; } - fputs("ffPrintGPU 1\n", stderr); FF_LIST_AUTO_DESTROY selectedGPUs; ffListInitA(&selectedGPUs, sizeof(const FFGPUResult*), gpus.length); @@ -102,15 +100,12 @@ void ffPrintGPU(FFGPUOptions* options) * (const FFGPUResult**) ffListAdd(&selectedGPUs) = gpu; } - fputs("ffPrintGPU 2\n", stderr); for(uint32_t i = 0; i < selectedGPUs.length; i++) printGPUResult(options, selectedGPUs.length == 1 ? 0 : (uint8_t) (i + 1), * (const FFGPUResult**) ffListGet(&selectedGPUs, i)); - fputs("ffPrintGPU 3\n", stderr); if(selectedGPUs.length == 0) ffPrintError(FF_GPU_MODULE_NAME, 0, &options->moduleArgs, "No GPUs found"); - fputs("ffPrintGPU 4\n", stderr); FF_LIST_FOR_EACH(FFGPUResult, gpu, gpus) {