Mesa (staging/22.1): egl/x11: add missing put_image cookie cleanups

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 23 16:19:37 UTC 2022


Module: Mesa
Branch: staging/22.1
Commit: 37c256c0debb30639e7a6ff4b559041f351ce295
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=37c256c0debb30639e7a6ff4b559041f351ce295

Author: Dave Airlie <airlied at redhat.com>
Date:   Wed Jun 22 05:49:44 2022 +1000

egl/x11: add missing put_image cookie cleanups

These might not be required but be consistent with the wsi code.

Cc: mesa-stable
Reviewed-by: Adam Jackson <ajax at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17155>
(cherry picked from commit c5dbb1139c5e5bff0dc52fc2e4c3c19da1cdb4bf)

---

 .pick_status.json                   |  2 +-
 src/egl/drivers/dri2/platform_x11.c | 16 +++++++++-------
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 0ac9602bfb4..6bd1354ff03 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -625,7 +625,7 @@
         "description": "egl/x11: add missing put_image cookie cleanups",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c
index e9a22ba7cfc..53302981fc2 100644
--- a/src/egl/drivers/dri2/platform_x11.c
+++ b/src/egl/drivers/dri2/platform_x11.c
@@ -159,7 +159,7 @@ swrastPutImage(__DRIdrawable * draw, int op,
    uint64_t max_req_len = xcb_get_maximum_request_length(dri2_dpy->conn);
 
    xcb_gcontext_t gc;
-
+   xcb_void_cookie_t cookie;
    switch (op) {
    case __DRI_SWRAST_IMAGE_OP_DRAW:
       gc = dri2_surf->gc;
@@ -172,18 +172,20 @@ swrastPutImage(__DRIdrawable * draw, int op,
    }
 
    if (size < max_req_len) {
-      xcb_put_image(dri2_dpy->conn, XCB_IMAGE_FORMAT_Z_PIXMAP, dri2_surf->drawable,
-                    gc, w, h, x, y, 0, dri2_surf->depth,
-                    h * stride_b, (const uint8_t *)data);
+      cookie = xcb_put_image(dri2_dpy->conn, XCB_IMAGE_FORMAT_Z_PIXMAP, dri2_surf->drawable,
+                             gc, w, h, x, y, 0, dri2_surf->depth,
+                             h * stride_b, (const uint8_t *)data);
+      xcb_discard_reply(dri2_dpy->conn, cookie.sequence);
    } else {
       int num_lines = ((max_req_len << 2) - hdr_len) / stride_b;
       int y_start = 0;
       int y_todo = h;
       while (y_todo) {
          int this_lines = MIN2(num_lines, y_todo);
-         xcb_put_image(dri2_dpy->conn, XCB_IMAGE_FORMAT_Z_PIXMAP, dri2_surf->drawable,
-                       gc, w, this_lines, x, y_start, 0, dri2_surf->depth,
-                       this_lines * stride_b, ((const uint8_t *)data + y_start * stride_b));
+         cookie = xcb_put_image(dri2_dpy->conn, XCB_IMAGE_FORMAT_Z_PIXMAP, dri2_surf->drawable,
+                                gc, w, this_lines, x, y_start, 0, dri2_surf->depth,
+                                this_lines * stride_b, ((const uint8_t *)data + y_start * stride_b));
+         xcb_discard_reply(dri2_dpy->conn, cookie.sequence);
          y_start += this_lines;
          y_todo -= this_lines;
       }



More information about the mesa-commit mailing list