Skip to content

Commit 8aef78f

Browse files
committed
fix: don't use drmIsKMS
libdrm's drmIsKMS was added in libdrm 2.4.105: https://gitlab.freedesktop.org/mesa/libdrm/-/commit/523b3658aa8efa746417e916c987de23740ce313 Debian bullseye is still on 2.4.104, so it's unfortunately not present there.
1 parent 5f0be92 commit 8aef78f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/kms/drmdev.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,16 @@ static bool is_kms_device(const char *path, const struct drmdev_file_interface *
110110
return false;
111111
}
112112

113-
if (!drmIsKMS(fd)) {
113+
// Ideally we'd use drmIsKMS() here, but it's not available everywhere.
114+
115+
struct drm_mode_card_res res = { 0 };
116+
if (drmIoctl(fd, DRM_IOCTL_MODE_GETRESOURCES, &res) != 0) {
114117
interface->close(fd, fd_metadata, userdata);
115118
return false;
116119
}
117120

118121
interface->close(fd, fd_metadata, userdata);
119-
return true;
122+
return res.count_crtcs > 0 && res.count_connectors > 0 && res.count_encoders > 0;
120123
}
121124

122125
static void assert_rotations_work() {

0 commit comments

Comments
 (0)