Mesa (master): mesa/st_vdpau: set surface winsys handle modifier

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Nov 29 23:46:08 UTC 2020


Module: Mesa
Branch: master
Commit: 3a90641b0d642589c31963200e256953a96ac325
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3a90641b0d642589c31963200e256953a96ac325

Author: Leo Liu <leo.liu at amd.com>
Date:   Thu Nov 26 13:34:14 2020 -0500

mesa/st_vdpau: set surface winsys handle modifier

The VDPAU interop was broken without setting it explicitly

Fixes: c786150d ("radeonsi: Add modifier support")
Cc: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

Signed-off-by: Leo Liu <leo.liu at amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7803>

---

 src/mesa/state_tracker/st_vdpau.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/mesa/state_tracker/st_vdpau.c b/src/mesa/state_tracker/st_vdpau.c
index e519ce9a1d9..641f553e92b 100644
--- a/src/mesa/state_tracker/st_vdpau.c
+++ b/src/mesa/state_tracker/st_vdpau.c
@@ -55,6 +55,8 @@
 #include "frontend/vdpau_funcs.h"
 #include "frontend/drm_driver.h"
 
+#include "drm-uapi/drm_fourcc.h"
+
 static struct pipe_resource *
 st_vdpau_video_surface_gallium(struct gl_context *ctx, const void *vdpSurface,
                                GLuint index)
@@ -129,6 +131,7 @@ st_vdpau_resource_from_description(struct gl_context *ctx,
    memset(&whandle, 0, sizeof(whandle));
    whandle.type = WINSYS_HANDLE_TYPE_FD;
    whandle.handle = desc->handle;
+   whandle.modifier = DRM_FORMAT_MOD_INVALID;
    whandle.offset = desc->offset;
    whandle.stride = desc->stride;
 
@@ -218,6 +221,7 @@ st_vdpau_map_surface(struct gl_context *ctx, GLenum target, GLenum access,
           res->screen->get_param(res->screen, PIPE_CAP_DMABUF) &&
           res->screen->resource_get_handle(res->screen, NULL, res, &whandle,
                                            usage)) {
+         whandle.modifier = DRM_FORMAT_MOD_INVALID;
          new_res = screen->resource_from_handle(screen, res, &whandle, usage);
          close(whandle.handle);
       }



More information about the mesa-commit mailing list