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
-3
View File
@@ -214,9 +214,6 @@ void ffListFeatures(void) {
#if FF_HAVE_DRM
"drm\n"
#endif
#if FF_HAVE_DRM_AMDGPU
"drm_amdgpu\n"
#endif
#if FF_HAVE_GIO
"gio\n"
#endif
+2 -2
View File
@@ -1,6 +1,6 @@
#include "codec.h"
#if (FF_HAVE_DRM && FF_HAVE_VA) || FF_HAVE_VDPAU
#if FF_HAVE_VA || FF_HAVE_VDPAU
#include "common/library.h"
#include "common/mallocHelper.h"
@@ -388,7 +388,7 @@ static const char* ffDetectCodecByVdpau(FFCodecOptions* options, FFlist* result)
const char* ffDetectCodecNative(FFCodecOptions* options, FFlist* result /* list of FFCodecResult */) {
FF_SUPPRESS_IO();
#if FF_HAVE_DRM && FF_HAVE_VA
#if FF_HAVE_VA
if (ffDetectCodecByVa(options, result) == NULL) {
return NULL;
}
+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) {