Mesa (master): wsi/x11: Use wsi_x11_get_connection in x11_present_to_x11_dri3

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jan 11 14:09:52 UTC 2021


Module: Mesa
Branch: master
Commit: c316fbe6258826ab85a8eab0b362d1f2315a1fae
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c316fbe6258826ab85a8eab0b362d1f2315a1fae

Author: Michel Dänzer <mdaenzer at redhat.com>
Date:   Fri Jan  8 18:49:20 2021 +0100

wsi/x11: Use wsi_x11_get_connection in x11_present_to_x11_dri3

Instead of creating a new wsi_x11_connection every time.

Fixes memory leak and bad performance.

Fixes: 4292fb213928 "wsi/x11: Use PresentOptionAsync for MAILBOX present mode with Xwayland"
Reported-by: Chris Rankin <rankincj at yahoo.com>
Reviewed-by: Adam Jackson <ajax at redhat.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Tested-by: Dieter Nützel <Dieter at nuetzel-hh.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8393>

---

 src/vulkan/wsi/wsi_common_x11.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c
index dcad48ca612..95bf7504db7 100644
--- a/src/vulkan/wsi/wsi_common_x11.c
+++ b/src/vulkan/wsi/wsi_common_x11.c
@@ -1060,7 +1060,7 @@ x11_present_to_x11_dri3(struct x11_swapchain *chain, uint32_t image_index,
    int64_t remainder = 0;
 
    struct wsi_x11_connection *wsi_conn =
-      wsi_x11_connection_create((struct wsi_device*)chain->base.wsi, chain->conn);
+      wsi_x11_get_connection((struct wsi_device*)chain->base.wsi, chain->conn);
    if (!wsi_conn)
       return VK_ERROR_OUT_OF_HOST_MEMORY;
 



More information about the mesa-commit mailing list