From 6f7e0c916c306dc6107a711104d502a77202f3e1 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Fri, 6 Oct 2023 00:30:08 +0100 Subject: [PATCH] drm: Fix not locking wlserver around wlserver_set_output_info --- src/drm.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/drm.cpp b/src/drm.cpp index 5771f97..d9a508b 100644 --- a/src/drm.cpp +++ b/src/drm.cpp @@ -83,7 +83,7 @@ inline uint64_t drm_calc_s31_32(float val) uint64_t sign_part : 1; } s31_32_bits; uint64_t s31_32; - } color; + } color;4 color.s31_32_bits.sign_part = val < 0 ? 1 : 0; color.s31_32_bits.integral = uint64_t( integral ); @@ -1166,7 +1166,9 @@ static bool setup_best_connector(struct drm_t *drm, bool force, bool initial) const struct wlserver_output_info wlserver_output_info = { .description = "Virtual screen", }; + wlserver_lock(); wlserver_set_output_info(&wlserver_output_info); + wlserver_unlock(); return true; } @@ -1217,7 +1219,9 @@ static bool setup_best_connector(struct drm_t *drm, bool force, bool initial) .phys_width = (int) best->connector->mmWidth, .phys_height = (int) best->connector->mmHeight, }; + wlserver_lock(); wlserver_set_output_info(&wlserver_output_info); + wlserver_unlock(); if (!initial) create_patched_edid(best->edid_data.data(), best->edid_data.size(), drm, best);