Mesa (staging/20.0): mesa/st: initialize all winsys_handle fields for memory objects

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Apr 20 18:56:30 UTC 2020


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

Author: Tapani Pälli <tapani.palli at intel.com>
Date:   Tue Apr 14 12:05:46 2020 +0300

mesa/st: initialize all winsys_handle fields for memory objects

Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
Reported-by: Eduardo Lima Mitev <elima at igalia.com>
Reviewed-by: Eduardo Lima Mitev <elima at igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Cc: <mesa-stable at lists.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4547>
(cherry picked from commit a934c8e7edd820ebb7286d0927090578cd6a3080)

---

 .pick_status.json                            |  2 +-
 src/mesa/state_tracker/st_cb_memoryobjects.c | 18 +++++++++++-------
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 51c4acce413..b1106b6ace6 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1894,7 +1894,7 @@
         "description": "mesa/st: initialize all winsys_handle fields for memory objects",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": null
     },
diff --git a/src/mesa/state_tracker/st_cb_memoryobjects.c b/src/mesa/state_tracker/st_cb_memoryobjects.c
index 7e5cd2a04cb..f2ee6ddf126 100644
--- a/src/mesa/state_tracker/st_cb_memoryobjects.c
+++ b/src/mesa/state_tracker/st_cb_memoryobjects.c
@@ -35,6 +35,10 @@
 #include "pipe/p_context.h"
 #include "pipe/p_screen.h"
 
+#ifdef HAVE_LIBDRM
+#include "drm-uapi/drm_fourcc.h"
+#endif
+
 static struct gl_memory_object *
 st_memoryobj_alloc(struct gl_context *ctx, GLuint name)
 {
@@ -64,13 +68,13 @@ st_import_memoryobj_fd(struct gl_context *ctx,
    struct st_context *st = st_context(ctx);
    struct pipe_context *pipe = st->pipe;
    struct pipe_screen *screen = pipe->screen;
-   struct winsys_handle whandle;
-
-   whandle.type = WINSYS_HANDLE_TYPE_FD;
-   whandle.handle = fd;
-   whandle.offset = 0;
-   whandle.layer = 0;
-   whandle.stride = 0;
+   struct winsys_handle whandle = {
+      .type = WINSYS_HANDLE_TYPE_FD,
+      .handle = fd,
+#ifdef HAVE_LIBDRM
+      .modifier = DRM_FORMAT_MOD_INVALID,
+#endif
+   };
 
    st_obj->memory = screen->memobj_create_from_handle(screen,
                                                       &whandle,



More information about the mesa-commit mailing list