GPU (OpenBSD): adds DRM method

This commit is contained in:
李通洲
2026-06-12 21:37:06 +08:00
parent 265c334399
commit 14dfe171fb
3 changed files with 19 additions and 2 deletions
+14 -1
View File
@@ -27,7 +27,7 @@ static inline int pciReadConf(int fd, uint8_t bus, uint8_t device, uint8_t func,
return 0;
}
const char* ffDetectGPUImpl(FF_A_UNUSED const FFGPUOptions* options, FFlist* gpus) {
const char* detectByPci(FF_A_UNUSED const FFGPUOptions* options, FFlist* gpus) {
char pciDevPath[] = "/dev/pci0";
FF_AUTO_CLOSE_FD int pcifd = open(pciDevPath, O_RDONLY | O_CLOEXEC);
if (pcifd < 0) {
@@ -99,3 +99,16 @@ const char* ffDetectGPUImpl(FF_A_UNUSED const FFGPUOptions* options, FFlist* gpu
return NULL;
}
const char* ffDetectGPUImpl(const FFGPUOptions* options, FFlist* gpus) {
#if FF_HAVE_DRM
if (options->detectionMethod == FF_GPU_DETECTION_METHOD_AUTO) {
ffGPUDetectByDrmBSD(options, gpus);
if (gpus->length > 0) {
return NULL;
}
}
#endif
return detectByPci(options, gpus);
}