aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>2024-02-20 17:46:05 +0100
committerMarge Bot <emma+marge@anholt.net>2024-02-28 12:47:54 +0000
commit224ff116178f8ca18008c2cdbc6a8feab1eb0a81 (patch)
tree89fde153376da45e2bc9421ce9aeb986dd1f7b16
parent55e99728e03cc8a290db4d1b97d7d512361b362c (diff)
downloadmesa3d-224ff116178f8ca18008c2cdbc6a8feab1eb0a81.tar.gz
egl/wayland: use __DRI_IMAGE_PRIME_LINEAR_BUFFER in get_back_bo
Some drivers (radeonsi, iris) relies on this hint to detect DRI_PRIME blits and implement a special path (eg: SDMA copy for radeonsi). Reviewed-by: Daniel Stone <daniels@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27719>
-rw-r--r--src/egl/drivers/dri2/platform_wayland.c4
-rw-r--r--src/gallium/frontends/dri/dri2.c10
2 files changed, 9 insertions, 5 deletions
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index ab530fb78d6..306ca9440fa 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -1131,8 +1131,8 @@ get_back_bo(struct dri2_egl_surface *dri2_surf)
&buffer_fds[0], num_planes, &strides[0], &offsets[0],
__DRI_YUV_COLOR_SPACE_UNDEFINED,
__DRI_YUV_RANGE_UNDEFINED, __DRI_YUV_CHROMA_SITING_UNDEFINED,
- __DRI_YUV_CHROMA_SITING_UNDEFINED, 0, &error,
- dri2_surf->back);
+ __DRI_YUV_CHROMA_SITING_UNDEFINED, __DRI_IMAGE_PRIME_LINEAR_BUFFER,
+ &error, dri2_surf->back);
for (i = 0; i < num_planes; ++i) {
if (buffer_fds[i] != -1)
diff --git a/src/gallium/frontends/dri/dri2.c b/src/gallium/frontends/dri/dri2.c
index 3da0d755121..5ce777f3708 100644
--- a/src/gallium/frontends/dri/dri2.c
+++ b/src/gallium/frontends/dri/dri2.c
@@ -1808,13 +1808,17 @@ dri2_from_dma_bufs3(__DRIscreen *screen,
unsigned *error,
void *loaderPrivate)
{
+ unsigned bind = 0;
__DRIimage *img;
+ if (flags & __DRI_IMAGE_PROTECTED_CONTENT_FLAG)
+ bind |= PIPE_BIND_PROTECTED;
+ if (flags & __DRI_IMAGE_PRIME_LINEAR_BUFFER)
+ bind |= PIPE_BIND_PRIME_BLIT_DST;
+
img = dri2_create_image_from_fd(screen, width, height, fourcc,
modifier, fds, num_fds, strides, offsets,
- (flags & __DRI_IMAGE_PROTECTED_CONTENT_FLAG) ?
- PIPE_BIND_PROTECTED : 0,
- error, loaderPrivate);
+ bind, error, loaderPrivate);
if (img == NULL)
return NULL;