Mesa (main): radeonsi: create prime buffers as uncached

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Feb 8 00:50:26 UTC 2022


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

Author: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Date:   Wed Jan 19 11:36:45 2022 +0100

radeonsi: create prime buffers as uncached

8791e831b11 marked imported prime buffers as uncached (useful when prime
buffer is allocated by the display GPU), but they should also be created
as uncached (useful when allocated by the render GPU).

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14615>

---

 src/gallium/drivers/radeonsi/si_texture.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/gallium/drivers/radeonsi/si_texture.c b/src/gallium/drivers/radeonsi/si_texture.c
index c95ebd1dfd8..05e21f23c6a 100644
--- a/src/gallium/drivers/radeonsi/si_texture.c
+++ b/src/gallium/drivers/radeonsi/si_texture.c
@@ -1015,6 +1015,8 @@ static struct si_texture *si_texture_create_object(struct pipe_screen *screen,
    } else if (!(surface->flags & RADEON_SURF_IMPORTED)) {
       if (base->flags & PIPE_RESOURCE_FLAG_SPARSE)
          resource->b.b.flags |= SI_RESOURCE_FLAG_UNMAPPABLE;
+      if (base->bind & PIPE_BIND_PRIME_BLIT_DST)
+         resource->b.b.flags |= SI_RESOURCE_FLAG_UNCACHED;
 
       /* Create the backing buffer. */
       si_init_resource_fields(sscreen, resource, alloc_size, alignment);



More information about the mesa-commit mailing list