@@ -263,6 +263,21 @@ static const char* drmDetectIntelSpecific(FFGPUResult* gpu, const char* drmKey,
263263 #endif
264264}
265265
266+ static const char * drmDetectNouveauSpecific (FFGPUResult * gpu , const char * drmKey , FFstrbuf * buffer )
267+ {
268+ #if FF_HAVE_DRM
269+ ffStrbufSetS (buffer , "/dev/dri/" );
270+ ffStrbufAppendS (buffer , drmKey );
271+ FF_AUTO_CLOSE_FD int fd = open (buffer -> chars , O_RDONLY | O_CLOEXEC );
272+ if (fd < 0 ) return "Failed to open drm device" ;
273+
274+ return ffDrmDetectNouveau (gpu , fd );
275+ #else
276+ FF_UNUSED (gpu , drmKey , buffer );
277+ return "Fastfetch is not compiled with drm support" ;
278+ #endif
279+ }
280+
266281static const char * detectPci (const FFGPUOptions * options , FFlist * gpus , FFstrbuf * buffer , FFstrbuf * deviceDir , const char * drmKey )
267282{
268283 const uint32_t drmDirPathLength = deviceDir -> length ;
@@ -369,6 +384,11 @@ static const char* detectPci(const FFGPUOptions* options, FFlist* gpus, FFstrbuf
369384 if (options -> driverSpecific && drmKey )
370385 drmDetectIntelSpecific (gpu , drmKey , buffer );
371386 }
387+ else if (gpu -> vendor .chars == FF_GPU_VENDOR_NAME_NVIDIA && ffStrbufEqualS (& gpu -> driver , "nouveau" ))
388+ {
389+ if (options -> driverSpecific && drmKey )
390+ drmDetectNouveauSpecific (gpu , drmKey , buffer );
391+ }
372392 else
373393 {
374394 ffGPUDetectDriverSpecific (options , gpu , (FFGpuDriverPciBusId ) {
0 commit comments