Module: Mesa
Branch: master
Commit: f70f6baaa3bb0f8b280ac2eaea69bbffaf7de840
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f70f6baaa3bb0f8b280ac2eaea69bbffaf7de840

Author: Marek Olšák <marek.ol...@amd.com>
Date:   Mon Sep 18 18:04:25 2017 +0200

gallium/radeon: consolidate PIPE_BIND_SHARED/SCANOUT handling

Reviewed-by: Nicolai Hähnle <nicolai.haeh...@amd.com>

---

 src/gallium/drivers/radeon/r600_buffer_common.c | 13 ++++---------
 src/gallium/drivers/radeon/r600_texture.c       |  4 ----
 2 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/src/gallium/drivers/radeon/r600_buffer_common.c 
b/src/gallium/drivers/radeon/r600_buffer_common.c
index 706c7485c3..b3e60a46e4 100644
--- a/src/gallium/drivers/radeon/r600_buffer_common.c
+++ b/src/gallium/drivers/radeon/r600_buffer_common.c
@@ -167,12 +167,10 @@ void si_init_resource_fields(struct r600_common_screen 
*rscreen,
                         RADEON_FLAG_GTT_WC;
        }
 
-       /* Only displayable single-sample textures can be shared between
-        * processes. */
-       if (!(res->b.b.bind & (PIPE_BIND_SHARED | PIPE_BIND_SCANOUT)) &&
-           (res->b.b.target == PIPE_BUFFER ||
-            res->b.b.nr_samples >= 2 ||
-            rtex->surface.micro_tile_mode != RADEON_MICRO_MODE_DISPLAY))
+       /* Displayable and shareable surfaces are not suballocated. */
+       if (res->b.b.bind & (PIPE_BIND_SHARED | PIPE_BIND_SCANOUT))
+               res->flags |= RADEON_FLAG_NO_SUBALLOC; /* shareable */
+       else
                res->flags |= RADEON_FLAG_NO_INTERPROCESS_SHARING;
 
        /* If VRAM is just stolen system memory, allow both VRAM and
@@ -192,9 +190,6 @@ void si_init_resource_fields(struct r600_common_screen 
*rscreen,
        if (rscreen->debug_flags & DBG_NO_WC)
                res->flags &= ~RADEON_FLAG_GTT_WC;
 
-       if (res->b.b.bind & PIPE_BIND_SHARED)
-               res->flags |= RADEON_FLAG_NO_SUBALLOC;
-
        /* Set expected VRAM and GART usage for the buffer. */
        res->vram_usage = 0;
        res->gart_usage = 0;
diff --git a/src/gallium/drivers/radeon/r600_texture.c 
b/src/gallium/drivers/radeon/r600_texture.c
index 829d105827..a9a1b2627e 100644
--- a/src/gallium/drivers/radeon/r600_texture.c
+++ b/src/gallium/drivers/radeon/r600_texture.c
@@ -1219,10 +1219,6 @@ r600_texture_create_object(struct pipe_screen *screen,
                si_init_resource_fields(rscreen, resource, rtex->size,
                                          rtex->surface.surf_alignment);
 
-               /* Displayable surfaces are not suballocated. */
-               if (resource->b.b.bind & PIPE_BIND_SCANOUT)
-                       resource->flags |= RADEON_FLAG_NO_SUBALLOC;
-
                if (!si_alloc_resource(rscreen, resource)) {
                        FREE(rtex);
                        return NULL;

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to