summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMyy <myy@miouyouyou.fr>2017-01-12 14:28:36 +0000
committerMyy <myy@miouyouyou.fr>2017-01-12 14:28:36 +0000
commit9bb2f0547189fed7414ac0c5452d2e8a3f7e4285 (patch)
tree27a96a98d047f8ce8ab0ff8636261ac1ee514237
parent905627dab2afa27f4b88193257847240f21e456e (diff)
Don't check for every kind of DRM driver. Just use the CARD !
The DRM checks are WAY too fragile. Testing every potential DRM driver available goes against what device drivers are for. They're supposed to provide transparent abstractions. Currently the patch uses only card0. Some people *might* have multiple graphics cards. In this case, feel free to add options to choose the right DRM device entry (/dev/dri/cardX). Signed-off-by: Myy <myy@miouyouyou.fr>
-rw-r--r--kmscube.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/kmscube.c b/kmscube.c
index e1e3569..2427cd9 100644
--- a/kmscube.c
+++ b/kmscube.c
@@ -121,34 +121,12 @@ static uint32_t find_crtc_for_connector(const drmModeRes *resources,
static int init_drm(void)
{
- static const char *modules[] = {
- "rockchip",
- "exynos",
- "i915",
- "msm",
- "nouveau",
- "omapdrm",
- "radeon",
- "tegra",
- "vc4",
- "virtio_gpu",
- "vmwgfx",
- };
drmModeRes *resources;
drmModeConnector *connector = NULL;
drmModeEncoder *encoder = NULL;
int i, area;
- for (i = 0; i < ARRAY_SIZE(modules); i++) {
- printf("trying to load module %s...", modules[i]);
- drm.fd = drmOpen(modules[i], NULL);
- if (drm.fd < 0) {
- printf("failed.\n");
- } else {
- printf("success.\n");
- break;
- }
- }
+ drm.fd = open("/dev/dri/card0", O_RDWR);
if (drm.fd < 0) {
printf("could not open drm device\n");