|
|
@ -735,20 +735,24 @@ int InitPlatform(void) |
|
|
|
|
|
|
|
#if defined(DEFAULT_GRAPHIC_DEVICE_DRM) |
|
|
|
platform.fd = open(DEFAULT_GRAPHIC_DEVICE_DRM, O_RDWR); |
|
|
|
if (platform.fd != -1) TRACELOG(LOG_INFO, "DISPLAY: Default graphic device DRM opened successfully"); |
|
|
|
#else |
|
|
|
TRACELOG(LOG_INFO, "DISPLAY: No graphic card set, trying platform-gpu-card"); |
|
|
|
TRACELOG(LOG_WARNING, "DISPLAY: No graphic card set, trying platform-gpu-card"); |
|
|
|
platform.fd = open("/dev/dri/by-path/platform-gpu-card", O_RDWR); // VideoCore VI (Raspberry Pi 4) |
|
|
|
if (platform.fd != -1) TRACELOG(LOG_INFO, "DISPLAY: platform-gpu-card opened successfully"); |
|
|
|
|
|
|
|
if ((platform.fd == -1) || (drmModeGetResources(platform.fd) == NULL)) |
|
|
|
{ |
|
|
|
TRACELOG(LOG_INFO, "DISPLAY: Failed to open platform-gpu-card, trying card1"); |
|
|
|
TRACELOG(LOG_WARNING, "DISPLAY: Failed to open platform-gpu-card, trying card1"); |
|
|
|
platform.fd = open("/dev/dri/card1", O_RDWR); // Other Embedded |
|
|
|
if (platform.fd != -1) TRACELOG(LOG_INFO, "DISPLAY: card1 opened successfully"); |
|
|
|
} |
|
|
|
|
|
|
|
if ((platform.fd == -1) || (drmModeGetResources(platform.fd) == NULL)) |
|
|
|
{ |
|
|
|
TRACELOG(LOG_INFO, "DISPLAY: Failed to open graphic card1, trying card0"); |
|
|
|
TRACELOG(LOG_WARNING, "DISPLAY: Failed to open graphic card1, trying card0"); |
|
|
|
platform.fd = open("/dev/dri/card0", O_RDWR); // VideoCore IV (Raspberry Pi 1-3) |
|
|
|
if (platform.fd != -1) TRACELOG(LOG_INFO, "DISPLAY: card0 opened successfully"); |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
@ -1399,7 +1403,7 @@ static void ConfigureEvdevDevice(char *device) |
|
|
|
int fd = open(device, O_RDONLY | O_NONBLOCK); |
|
|
|
if (fd < 0) |
|
|
|
{ |
|
|
|
TRACELOG(LOG_WARNING, "DRM: Failed to open input device: %s", device); |
|
|
|
TRACELOG(LOG_WARNING, "SYSTEM: Failed to open input device: %s", device); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|