Skip to content

Commit

Permalink
Fixed bug 4624 - KMS/DRM fails on FreeBSD because /dev/dri/card* node…
Browse files Browse the repository at this point in the history
…s are symlinks

Jan Martin Mikkelsen

Patch to scan /dev/dri based on names rather than file type

Loading KMS/DRM on FreeBSD fails because the "available" code in the driver checks for character device nodes under /dev/dri and the /dev/dri/card* files are symlinks rather than device nodes nodes on FreeBSD. The symlink points to /dev/drm/0.

The attached patch counts /dev/dri/card* entries rather than directory entries which are character devices.
  • Loading branch information
slouken committed Jun 18, 2019
1 parent d3bedda commit 99abcbb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/video/kmsdrm/SDL_kmsdrmvideo.c
Expand Up @@ -101,7 +101,7 @@ static int get_dricount(void)
folder = opendir(KMSDRM_DRI_PATH);
if (folder) {
while ((res = readdir(folder))) {
if (res->d_type == DT_CHR) {
if (res->d_namlen > 4 && strncmp(res->d_name, "card", 4)) {
devcount++;
}
}
Expand Down

0 comments on commit 99abcbb

Please sign in to comment.