Mesa (main): gallium: rename PIPE_BIND_DRI_PRIME
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Feb 8 00:50:26 UTC 2022
Module: Mesa
Branch: main
Commit: 18c38bf78fc33d4197f2e2ca9386e6e8bccf8193
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=18c38bf78fc33d4197f2e2ca9386e6e8bccf8193
Author: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Date: Tue Feb 1 17:40:55 2022 +0100
gallium: rename PIPE_BIND_DRI_PRIME
The new name PIPE_BIND_PRIME_BLIT_DST is more precise.
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14615>
---
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)
/**
More information about the mesa-commit
mailing list