r600g,radeonsi: Preserve existing buffer flags
authorMichel Dänzer <michel.daenzer@amd.com>
Tue, 2 Sep 2014 08:52:30 +0000 (17:52 +0900)
committerMichel Dänzer <michel@daenzer.net>
Wed, 3 Sep 2014 03:49:59 +0000 (12:49 +0900)
The default case was accidentally clearing RADEON_FLAG_CPU_ACCESS from the
previous fall-through cases.

Reported-by: Mathias Fröhlich <Mathias.Froehlich@gmx.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeon/r600_buffer_common.c

index c4e87a0cd08de1fcba7d24753d8f341673edf1e4..d85b64b457fd471147a62dadc6c3123e684b7601 100644 (file)
@@ -121,17 +121,17 @@ bool r600_init_resource(struct r600_common_screen *rscreen,
                 */
                if (rscreen->info.drm_minor < 40) {
                        res->domains = RADEON_DOMAIN_GTT;
-                       flags = RADEON_FLAG_GTT_WC;
+                       flags |= RADEON_FLAG_GTT_WC;
                        break;
                }
-               flags = RADEON_FLAG_CPU_ACCESS;
+               flags |= RADEON_FLAG_CPU_ACCESS;
                /* fall through */
        case PIPE_USAGE_DEFAULT:
        case PIPE_USAGE_IMMUTABLE:
        default:
                /* Not listing GTT here improves performance in some apps. */
                res->domains = RADEON_DOMAIN_VRAM;
-               flags = RADEON_FLAG_GTT_WC;
+               flags |= RADEON_FLAG_GTT_WC;
                break;
        }