From 24a51f721dd92f6651762963e5c33fbee89c9202 Mon Sep 17 00:00:00 2001 From: Victor Brekenfeld Date: Sun, 19 Apr 2020 22:54:38 +0200 Subject: [PATCH] anvil: use fallback-device for atomic/legacy --- anvil/Cargo.toml | 2 +- anvil/src/udev.rs | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/anvil/Cargo.toml b/anvil/Cargo.toml index a67e24d..fc92bf5 100644 --- a/anvil/Cargo.toml +++ b/anvil/Cargo.toml @@ -29,5 +29,5 @@ gl_generator = "0.14" default = [ "winit", "egl", "udev", "logind" ] egl = [ "smithay/use_system_lib" ] winit = [ "smithay/backend_winit" ] -udev = [ "smithay/backend_libinput", "smithay/backend_udev", "smithay/backend_drm_atomic", "smithay/backend_drm_gbm", "smithay/backend_drm_egl", "smithay/backend_session", "input" ] +udev = [ "smithay/backend_libinput", "smithay/backend_udev", "smithay/backend_drm_atomic", "smithay/backend_drm_legacy", "smithay/backend_drm_gbm", "smithay/backend_drm_egl", "smithay/backend_session", "input" ] logind = [ "smithay/backend_session_logind" ] diff --git a/anvil/src/udev.rs b/anvil/src/udev.rs index 282f39d..03917cc 100644 --- a/anvil/src/udev.rs +++ b/anvil/src/udev.rs @@ -19,15 +19,13 @@ use smithay::backend::egl::{display::EGLBufferReader, EGLGraphicsBackend}; use smithay::{ backend::{ drm::{ + atomic::AtomicDrmDevice, + common::fallback::FallbackDevice, device_bind, egl::{EglDevice, EglSurface}, gbm::{egl::Gbm as EglGbmBackend, GbmDevice}, - atomic::AtomicDrmDevice, - //legacy::LegacyDrmDevice, - DevPath, - Device, - DeviceHandler, - Surface, + legacy::LegacyDrmDevice, + DevPath, Device, DeviceHandler, Surface, }, graphics::CursorBackend, input::InputBackend, @@ -72,6 +70,7 @@ use crate::shell::{init_shell, MyWindowMap, Roles}; use crate::AnvilState; use smithay::backend::drm::gbm::GbmSurface; +#[derive(Clone)] pub struct SessionFd(RawFd); impl AsRawFd for SessionFd { fn as_raw_fd(&self) -> RawFd { @@ -79,10 +78,12 @@ impl AsRawFd for SessionFd { } } -type RenderDevice = - EglDevice>, GbmDevice>>; +type RenderDevice = EglDevice< + EglGbmBackend, LegacyDrmDevice>>, + GbmDevice, LegacyDrmDevice>>, +>; type RenderSurface = - EglSurface>>; + EglSurface, LegacyDrmDevice>>>; pub fn run_udev(mut display: Display, mut event_loop: EventLoop, log: Logger) -> Result<(), ()> { let name = display.add_socket_auto().unwrap().into_string().unwrap(); @@ -417,7 +418,7 @@ impl UdevHandler for UdevHandlerImpl ) .ok() .and_then( - |fd| match AtomicDrmDevice::new(SessionFd(fd), self.logger.clone()) { + |fd| match FallbackDevice::new(SessionFd(fd), self.logger.clone()) { Ok(drm) => Some(drm), Err(err) => { error!(self.logger, "Skipping drm device, because of error: {}", err);