main: use UTERM_VIDEO_DUMB as fallback when DRM is not available

If the uterm video object fails to initialize the DRM device, then we try
again with the dumb device. Only if both devices fail, we drop the device
and continue.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
David Herrmann 2012-07-01 14:31:50 +02:00
parent de02874bf6
commit ffd543f41d

View File

@ -168,8 +168,17 @@ static void seat_add_video(struct kmscon_seat *seat,
mode = UTERM_VIDEO_DRM;
ret = uterm_video_new(&seat->video, seat->app->eloop, mode, node);
if (ret)
return;
if (ret) {
if (mode == UTERM_VIDEO_DRM) {
log_info("cannot create drm device; trying dumb drm mode");
ret = uterm_video_new(&seat->video, seat->app->eloop,
UTERM_VIDEO_DUMB, node);
if (ret)
return;
} else {
return;
}
}
ret = kmscon_ui_new(&seat->ui, seat->app->eloop, seat->video,
seat->input);