aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTapani Pälli <[email protected]>2020-04-14 12:05:46 +0300
committerMarge Bot <[email protected]>2020-04-16 11:25:29 +0000
commita934c8e7edd820ebb7286d0927090578cd6a3080 (patch)
treedfad556f400d4c3da3da8c3769e122ca21da9089 /src
parente3e704c7e7e46dfda820ea2e96fa4a32d63ef796 (diff)
mesa/st: initialize all winsys_handle fields for memory objects
Signed-off-by: Tapani Pälli <[email protected]> Reported-by: Eduardo Lima Mitev <[email protected]> Reviewed-by: Eduardo Lima Mitev <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Cc: <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4547>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/state_tracker/st_cb_memoryobjects.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/mesa/state_tracker/st_cb_memoryobjects.c b/src/mesa/state_tracker/st_cb_memoryobjects.c
index 6a2f524836d..5176df68e78 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,