From 03815ec4fe0676030838bb91907bf211b178e86e Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 22 Apr 2021 21:01:48 +0200 Subject: [PATCH] RPI4: Improve DRM card check #1723 --- src/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core.c b/src/core.c index 247a79322..f4bd6acc4 100644 --- a/src/core.c +++ b/src/core.c @@ -3810,7 +3810,7 @@ static bool InitGraphicsDevice(int width, int height) #else TRACELOG(LOG_INFO, "DISPLAY: No graphic card set, trying card1"); CORE.Window.fd = open("/dev/dri/card1", O_RDWR); // VideoCore VI (Raspberry Pi 4) - if (-1 == CORE.Window.fd) + if ((-1 == CORE.Window.fd) || (drmModeGetResources(CORE.Window.fd) == NULL)) { TRACELOG(LOG_INFO, "DISPLAY: Failed to open graphic card1, trying card0"); CORE.Window.fd = open("/dev/dri/card0", O_RDWR); // VideoCore IV (Raspberry Pi 1-3)