Mesa (staging/21.2): loader/dri3: create linear buffer with scanout support

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jul 28 23:00:07 UTC 2021


Module: Mesa
Branch: staging/21.2
Commit: d06433f883b6a1252c219770d68669483ea9b4a0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d06433f883b6a1252c219770d68669483ea9b4a0

Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date:   Sat Jul 17 17:38:42 2021 +0300

loader/dri3: create linear buffer with scanout support

If we have a different GPU dealing with display, we fallback to
exchanging linear buffers with the compositor. We should specify in
creating the linear buffer that this could be used for display.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4706
Cc: mesa-stable
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11942>
(cherry picked from commit f1a66e7c90ceb4796085989d0d8374689753121e)

---

 .pick_status.json               | 2 +-
 src/loader/loader_dri3_helper.c | 6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 686e7ac0b33..c132863fe56 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -193,7 +193,7 @@
         "description": "loader/dri3: create linear buffer with scanout support",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
diff --git a/src/loader/loader_dri3_helper.c b/src/loader/loader_dri3_helper.c
index 608eff5e11d..6e825f9a898 100644
--- a/src/loader/loader_dri3_helper.c
+++ b/src/loader/loader_dri3_helper.c
@@ -1448,7 +1448,8 @@ dri3_alloc_render_buffer(struct loader_dri3_drawable *draw, unsigned int format,
                                          dri3_linear_format_for_format(draw, format),
                                          __DRI_IMAGE_USE_SHARE |
                                          __DRI_IMAGE_USE_LINEAR |
-                                         __DRI_IMAGE_USE_BACKBUFFER,
+                                         __DRI_IMAGE_USE_BACKBUFFER |
+                                         __DRI_IMAGE_USE_SCANOUT,
                                          buffer);
          pixmap_buffer = linear_buffer_display_gpu;
       }
@@ -1460,7 +1461,8 @@ dri3_alloc_render_buffer(struct loader_dri3_drawable *draw, unsigned int format,
                                          dri3_linear_format_for_format(draw, format),
                                          __DRI_IMAGE_USE_SHARE |
                                          __DRI_IMAGE_USE_LINEAR |
-                                         __DRI_IMAGE_USE_BACKBUFFER,
+                                         __DRI_IMAGE_USE_BACKBUFFER |
+                                         __DRI_IMAGE_USE_SCANOUT,
                                          buffer);
 
          pixmap_buffer = buffer->linear_buffer;



More information about the mesa-commit mailing list