From 02401bbc93939803cbe0f12adcb956c77f648b21 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sun, 15 Jun 2025 19:43:33 -0700 Subject: drm_fb: suppress drmAvailable() checks This is preventing --video=drm from working on my X230 today for no good reason. It seems libdrm is assuming /dev/dri/card0 will be present if drm's available. But for some reason my X230 only has /dev/dri/card1 presently. It didn't used to be this way, something is weird, but I'm not going to dig into it. If it happened here, it may happen elsewhere, and drmAvailable() is proving actively harmful. For now I'm just disabling the check w/#if 0 --- src/drm_fb.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/drm_fb.c b/src/drm_fb.c index 8ba097c..7ac6f3f 100644 --- a/src/drm_fb.c +++ b/src/drm_fb.c @@ -339,12 +339,19 @@ static int drm_fb_init(const char *title, const til_video_setup_t *setup, void * int r; assert(setup); - +#if 0 + /* This has proven to produce false negatives - on my X230 now I for some reason + * only have /dev/dri/card1, no card0, and this is causing libdrm to fail here. + * But if I disable this check, and specify /dev/dri/card1 instead of card0, I'm + * able to use rototiller on drm. I don't have time to investigate why libdrm + * is broken in this check, so I'm just disabling this check. + * FIXME + */ if (!drmAvailable()) { r = -errno; goto _err; } - +#endif if (!s->dev || !s->connector || !s->mode) { r = -EINVAL; goto _err; @@ -592,10 +599,11 @@ static int drm_fb_setup(const til_settings_t *settings, til_setting_t **res_sett .func = mode_desc_generator }, }; - +#if 0 + /* FIXME: see comment above by other drmAvailable() call. */ if (!drmAvailable()) return -ENOSYS; - +#endif if (!setup) return -ENOMEM; -- cgit v1.2.3