Global: cleanups FF_HAVE_DRM macro

This commit is contained in:
Carter Li
2026-06-18 17:45:19 +08:00
parent 49a1e42efd
commit 96685b7ebe
4 changed files with 3 additions and 15 deletions
+1
View File
@@ -13,6 +13,7 @@
#include <nouveau_drm.h>
#include <amdgpu_drm.h>
#else
#define FF_HAVE_DRM 1
#include <drm/drm.h>
#include <drm/radeon_drm.h>
#include <drm/nouveau_drm.h>
-10
View File
@@ -72,7 +72,6 @@ FF_A_UNUSED static const char* drmFindRenderFromCard(const char* drmCardKey, FFs
}
static const char* drmDetectAmdSpecific(const FFGPUOptions* options, FFGPUResult* gpu, const char* drmKey, FFstrbuf* buffer) {
#if FF_HAVE_DRM
const char* error = drmFindRenderFromCard(drmKey, buffer);
if (error) {
return error;
@@ -80,17 +79,8 @@ static const char* drmDetectAmdSpecific(const FFGPUOptions* options, FFGPUResult
if (ffStrbufEqualS(&gpu->driver, "radeon")) {
return ffDrmDetectRadeon(options, gpu, buffer->chars);
} else {
#if FF_HAVE_DRM_AMDGPU
return ffDrmDetectAmdgpu(options, gpu, buffer->chars);
#else
FF_UNUSED(options, gpu, drmKey, buffer);
return "Fastfetch is not compiled with libdrm_amdgpu support";
#endif
}
#else
FF_UNUSED(options, gpu, drmKey, buffer);
return "Fastfetch is not compiled with drm support";
#endif
}
static void pciDetectAmdSpecific(const FFGPUOptions* options, FFGPUResult* gpu, FFstrbuf* pciDir, FFstrbuf* buffer) {