aboutsummaryrefslogtreecommitdiff
path: root/backend/drm
diff options
context:
space:
mode:
authorScott Anderson <scott@anderso.nz>2019-06-24 13:52:23 +1200
committerSimon Ser <contact@emersion.fr>2019-06-24 09:09:36 +0300
commit46dc4100d66567f77a413627a0a0b046ccf8094b (patch)
treee2c2e9e74ee75721e29badb75e5382f0f9171999 /backend/drm
parentb3f42548d068996995490585e27e16c191b4a64c (diff)
backend/drm: Exit-early if 0 crtcs
This fixes an assertion failure if we're using a device that has 0 crtcs as a renderer. This would happen on some laptops with discrete GPUs.
Diffstat (limited to 'backend/drm')
-rw-r--r--backend/drm/drm.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index 7ff8c7f5..a2bfb261 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -1140,6 +1140,14 @@ static uint32_t get_possible_crtcs(int fd, drmModeRes *res,
}
void scan_drm_connectors(struct wlr_drm_backend *drm) {
+ /*
+ * This GPU is not really a modesetting device.
+ * It's just being used as a renderer.
+ */
+ if (drm->num_crtcs == 0) {
+ return;
+ }
+
wlr_log(WLR_INFO, "Scanning DRM connectors");
drmModeRes *res = drmModeGetResources(drm->fd);