mesa/st: initialize all winsys_handle fields for memory objects
Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reported-by: Eduardo Lima Mitev <elima@igalia.com> Reviewed-by: Eduardo Lima Mitev <elima@igalia.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Cc: <mesa-stable@lists.freedesktop.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4547>
This commit is contained in:
@@ -35,6 +35,10 @@
|
|||||||
#include "pipe/p_context.h"
|
#include "pipe/p_context.h"
|
||||||
#include "pipe/p_screen.h"
|
#include "pipe/p_screen.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBDRM
|
||||||
|
#include "drm-uapi/drm_fourcc.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
static struct gl_memory_object *
|
static struct gl_memory_object *
|
||||||
st_memoryobj_alloc(struct gl_context *ctx, GLuint name)
|
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 st_context *st = st_context(ctx);
|
||||||
struct pipe_context *pipe = st->pipe;
|
struct pipe_context *pipe = st->pipe;
|
||||||
struct pipe_screen *screen = pipe->screen;
|
struct pipe_screen *screen = pipe->screen;
|
||||||
struct winsys_handle whandle;
|
struct winsys_handle whandle = {
|
||||||
|
.type = WINSYS_HANDLE_TYPE_FD,
|
||||||
whandle.type = WINSYS_HANDLE_TYPE_FD;
|
.handle = fd,
|
||||||
whandle.handle = fd;
|
#ifdef HAVE_LIBDRM
|
||||||
whandle.offset = 0;
|
.modifier = DRM_FORMAT_MOD_INVALID,
|
||||||
whandle.layer = 0;
|
#endif
|
||||||
whandle.stride = 0;
|
};
|
||||||
|
|
||||||
st_obj->memory = screen->memobj_create_from_handle(screen,
|
st_obj->memory = screen->memobj_create_from_handle(screen,
|
||||||
&whandle,
|
&whandle,
|
||||||
|
Reference in New Issue
Block a user