radeonsi: fix the R600_RESOURCE_FLAG_UNMAPPABLE check
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Thu, 23 Nov 2017 09:25:34 +0000 (10:25 +0100)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 6 Dec 2017 10:18:14 +0000 (11:18 +0100)
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")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
src/gallium/drivers/radeon/r600_buffer_common.c

index ec282d55aaf98a886fb0166b582e52510292d5fc..f1c4780dfeabb2e43e7b649ac38e9705c721de1e 100644 (file)
@@ -159,7 +159,7 @@ void si_init_resource_fields(struct si_screen *sscreen,
 
        /* 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;