From 18c38bf78fc33d4197f2e2ca9386e6e8bccf8193 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Tue, 1 Feb 2022 17:40:55 +0100 Subject: [PATCH] gallium: rename PIPE_BIND_DRI_PRIME The new name PIPE_BIND_PRIME_BLIT_DST is more precise. Reviewed-by: Kenneth Graunke Part-of: --- src/gallium/drivers/radeonsi/si_blit.c | 2 +- src/gallium/drivers/radeonsi/si_texture.c | 2 +- src/gallium/frontends/dri/dri2.c | 4 ++-- src/gallium/include/pipe/p_defines.h | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium/drivers/radeonsi/si_blit.c index 2c0fd024b3d..80e7af2832e 100644 --- a/src/gallium/drivers/radeonsi/si_blit.c +++ b/src/gallium/drivers/radeonsi/si_blit.c @@ -1234,7 +1234,7 @@ static void si_blit(struct pipe_context *ctx, const struct pipe_blit_info *info) return; } - if ((info->dst.resource->bind & PIPE_BIND_DRI_PRIME) && sdst->surface.is_linear && + if ((info->dst.resource->bind & PIPE_BIND_PRIME_BLIT_DST) && sdst->surface.is_linear && sctx->chip_class >= GFX7 && sdst->surface.flags & RADEON_SURF_IMPORTED) { struct si_texture *ssrc = (struct si_texture *)info->src.resource; /* Use SDMA or async compute when copying to a DRI_PRIME imported linear surface. */ diff --git a/src/gallium/drivers/radeonsi/si_texture.c b/src/gallium/drivers/radeonsi/si_texture.c index 752321f8644..c95ebd1dfd8 100644 --- a/src/gallium/drivers/radeonsi/si_texture.c +++ b/src/gallium/drivers/radeonsi/si_texture.c @@ -1647,7 +1647,7 @@ static struct pipe_resource *si_texture_from_handle(struct pipe_screen *screen, buf = sscreen->ws->buffer_from_handle(sscreen->ws, whandle, sscreen->info.max_alignment, - templ->bind & PIPE_BIND_DRI_PRIME); + templ->bind & PIPE_BIND_PRIME_BLIT_DST); if (!buf) return NULL; diff --git a/src/gallium/frontends/dri/dri2.c b/src/gallium/frontends/dri/dri2.c index 09a3af4385e..673e11c135f 100644 --- a/src/gallium/frontends/dri/dri2.c +++ b/src/gallium/frontends/dri/dri2.c @@ -1100,7 +1100,7 @@ dri2_create_image_common(__DRIscreen *_screen, if (use & __DRI_IMAGE_USE_PROTECTED) tex_usage |= PIPE_BIND_PROTECTED; if (use & __DRI_IMAGE_USE_PRIME_BUFFER) - tex_usage |= PIPE_BIND_DRI_PRIME; + tex_usage |= PIPE_BIND_PRIME_BLIT_DST; img = CALLOC_STRUCT(__DRIimageRec); if (!img) @@ -1530,7 +1530,7 @@ dri2_from_fds2(__DRIscreen *screen, int width, int height, int fourcc, if (flags & __DRI_IMAGE_PROTECTED_CONTENT_FLAG) bind |= PIPE_BIND_PROTECTED; if (flags & __DRI_IMAGE_PRIME_LINEAR_BUFFER) - bind |= PIPE_BIND_DRI_PRIME; + bind |= PIPE_BIND_PRIME_BLIT_DST; return dri2_create_image_from_fd(screen, width, height, fourcc, DRM_FORMAT_MOD_INVALID, fds, num_fds, diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index 7efd4542790..f3671e9fe00 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -515,7 +515,8 @@ enum pipe_flush_flags #define PIPE_BIND_LINEAR (1 << 21) #define PIPE_BIND_PROTECTED (1 << 22) /* Resource will be protected/encrypted */ #define PIPE_BIND_SAMPLER_REDUCTION_MINMAX (1 << 23) /* PIPE_CAP_SAMPLER_REDUCTION_MINMAX */ -#define PIPE_BIND_DRI_PRIME (1 << 24) +/* Resource is the DRI_PRIME blit destination. Only set on on the render GPU. */ +#define PIPE_BIND_PRIME_BLIT_DST (1 << 24) /**