unl0kr: select an available DRM device instead of a hard-coded one
This commit is contained in:
parent
72a4220fea
commit
c57913819c
2 changed files with 19 additions and 1 deletions
|
|
@ -19,6 +19,7 @@ If a change only affects particular applications, they are listed in parentheses
|
|||
- misc: Make scdoc a native dependency to enable cross-compilation (!30, thanks @uninsane)
|
||||
- fix: Use usleep to release CPU when possible (!31, thanks @uninsane)
|
||||
- feat(buffyboard): Add a buffyboard.service systemd service (!34, @uninsane)
|
||||
- fix(unl0kr): Select an available DRM device instead of a hard-coded one (!35, thanks @Sorcus)
|
||||
|
||||
## 3.2.0 (2024-06-03)
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
#include <unistd.h>
|
||||
|
||||
#include <sys/reboot.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
|
||||
|
|
@ -420,7 +421,23 @@ int main(int argc, char *argv[]) {
|
|||
case UL_BACKENDS_BACKEND_DRM:
|
||||
bbx_log(BBX_LOG_LEVEL_VERBOSE, "Using DRM backend");
|
||||
disp = lv_linux_drm_create();
|
||||
lv_linux_drm_set_file(disp, "/dev/dri/card0", -1);
|
||||
|
||||
char *format_string = "/dev/dri/card%d";
|
||||
char drm_path[16] = {0};
|
||||
struct stat buffer;
|
||||
|
||||
for (size_t i = 0; i < 9; i++) {
|
||||
sprintf(drm_path, format_string, i);
|
||||
|
||||
if (stat(drm_path, &buffer) != 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
lv_linux_drm_set_file(disp, drm_path, -1);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
#endif /* LV_USE_LINUX_DRM */
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue