diff --git a/libwayshot/examples/waymirror-egl/src/state.rs b/libwayshot/examples/waymirror-egl/src/state.rs index 2f93c612..81dc501d 100644 --- a/libwayshot/examples/waymirror-egl/src/state.rs +++ b/libwayshot/examples/waymirror-egl/src/state.rs @@ -70,7 +70,11 @@ impl WaylandEGLState { xdg_surface: None, xdg_toplevel: None, wl_compositor: None, - wayshot: WayshotConnection::from_connection_with_dmabuf(server_connection).unwrap(), + wayshot: WayshotConnection::from_connection_with_dmabuf( + server_connection, + "/dev/dri/renderD128", + ) + .unwrap(), }) } diff --git a/libwayshot/examples/waymirror.rs b/libwayshot/examples/waymirror.rs index c89d7cb6..c350131a 100644 --- a/libwayshot/examples/waymirror.rs +++ b/libwayshot/examples/waymirror.rs @@ -18,7 +18,8 @@ fn main() { let display = conn.display(); display.get_registry(&qhandle, ()); - let wayshot = WayshotConnection::from_connection_with_dmabuf(conn).unwrap(); + let wayshot = + WayshotConnection::from_connection_with_dmabuf(conn, "/dev/dri/renderD128").unwrap(); let mut state = State { wayshot, diff --git a/libwayshot/src/lib.rs b/libwayshot/src/lib.rs index 4f6e9bcd..e76bf770 100644 --- a/libwayshot/src/lib.rs +++ b/libwayshot/src/lib.rs @@ -109,11 +109,11 @@ impl WayshotConnection { Ok(initial_state) } - pub fn from_connection_with_dmabuf(conn: Connection) -> Result { + pub fn from_connection_with_dmabuf(conn: Connection, device_path: &str) -> Result { let (globals, evq) = registry_queue_init::(&conn)?; let linux_dmabuf = globals.bind(&evq.handle(), 4..=ZwpLinuxDmabufV1::interface().version, ())?; - let gpu = dispatch::Card::open("/dev/dri/renderD128"); + let gpu = dispatch::Card::open(device_path); // init a GBM device let gbm = GBMDevice::new(gpu).unwrap(); let mut initial_state = Self {