From 37e08683ffe3625c666fd292595d4460f21579e4 Mon Sep 17 00:00:00 2001 From: Sasha Finkelstein Date: Tue, 5 Nov 2024 17:53:46 +0100 Subject: [PATCH] x11bridge: Downgrade DRI3 to 1.3 1.4 introduced syncobj support, and we do not support those yet Signed-off-by: Sasha Finkelstein --- crates/muvm/src/x11bridge/bin/muvm-x11bridge.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/muvm/src/x11bridge/bin/muvm-x11bridge.rs b/crates/muvm/src/x11bridge/bin/muvm-x11bridge.rs index 74335b2..c656c00 100644 --- a/crates/muvm/src/x11bridge/bin/muvm-x11bridge.rs +++ b/crates/muvm/src/x11bridge/bin/muvm-x11bridge.rs @@ -59,6 +59,7 @@ const X11_OPCODE_QUERY_EXTENSION: u8 = 98; const X11_OPCODE_NOP: u8 = 127; const X11_REPLY: u8 = 1; const X11_GENERIC_EVENT: u8 = 35; +const DRI3_OPCODE_VERSION: u8 = 0; const DRI3_OPCODE_OPEN: u8 = 1; const DRI3_OPCODE_PIXMAP_FROM_BUFFER: u8 = 2; const DRI3_OPCODE_FENCE_FROM_FD: u8 = 4; @@ -950,7 +951,9 @@ impl Client { self.present_qe_resp_seq = Some(self.seq_no); } } else if Some(buf[ptr]) == self.dri3_ext_opcode { - if buf[ptr + 1] == DRI3_OPCODE_OPEN { + if buf[ptr + 1] == DRI3_OPCODE_VERSION { + buf[ptr + 8] = buf[ptr + 8].min(3); + } else if buf[ptr + 1] == DRI3_OPCODE_OPEN { buf[ptr] = X11_OPCODE_NOP; let mut reply = vec![1, 1, (self.seq_no & 0xff) as u8, (self.seq_no >> 8) as u8];