[Mesa-dev] [PATCH 1/2] radeonsi: fix the R600_RESOURCE_FLAG_UNMAPPABLE check

Nicolai Hähnle nhaehnle at gmail.com
Tue Nov 28 13:44:41 UTC 2017


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

The flag is on the pipe_resource, not the r600_resource.

I don't see an obvious bug related to this, but it could potentially lead
to suboptimal placement of some resources.

Fixes: a41587433c4d ("gallium/radeon: add R600_RESOURCE_FLAG_UNMAPPABLE")
---
 src/gallium/drivers/radeon/r600_buffer_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeon/r600_buffer_common.c b/src/gallium/drivers/radeon/r600_buffer_common.c
index 3e476f745c0..158cabcfaeb 100644
--- a/src/gallium/drivers/radeon/r600_buffer_common.c
+++ b/src/gallium/drivers/radeon/r600_buffer_common.c
@@ -151,21 +151,21 @@ void si_init_resource_fields(struct r600_common_screen *rscreen,
 		 * ensures all CPU writes finish before the GPU
 		 * executes a command stream.
 		 */
 		if (rscreen->info.drm_major == 2 &&
 		    rscreen->info.drm_minor < 40)
 			res->domains = RADEON_DOMAIN_GTT;
 	}
 
 	/* Tiled textures are unmappable. Always put them in VRAM. */
 	if ((res->b.b.target != PIPE_BUFFER && !rtex->surface.is_linear) ||
-	    res->flags & R600_RESOURCE_FLAG_UNMAPPABLE) {
+	    res->b.b.flags & R600_RESOURCE_FLAG_UNMAPPABLE) {
 		res->domains = RADEON_DOMAIN_VRAM;
 		res->flags |= RADEON_FLAG_NO_CPU_ACCESS |
 			 RADEON_FLAG_GTT_WC;
 	}
 
 	/* 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;
-- 
2.11.0



More information about the mesa-dev mailing list