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>
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2024-02-20 17:46:05 +01:00 committed by Marge Bot
parent 55e99728e0
commit 224ff11617
2 changed files with 9 additions and 5 deletions

View file

@ -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)

View file

@ -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;