diff options
author | Marek Olšák <[email protected]> | 2017-12-31 20:42:27 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2018-01-27 02:09:09 +0100 |
commit | e553cb5a68c812e33c61fdc4c6837b31089f89c2 (patch) | |
tree | 4b2b48a6988597f1b6d9e0fb3196432fdd9b6583 /src/gallium/drivers/radeon | |
parent | 041b18cf23a0acf7b0eddf63cd7a2a10192432a1 (diff) |
gallium/radeon: simplify radeon_flags_from_heap
Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeon')
-rw-r--r-- | src/gallium/drivers/radeon/radeon_winsys.h | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/gallium/drivers/radeon/radeon_winsys.h b/src/gallium/drivers/radeon/radeon_winsys.h index 307f8efaec0..6e87f75b81d 100644 --- a/src/gallium/drivers/radeon/radeon_winsys.h +++ b/src/gallium/drivers/radeon/radeon_winsys.h @@ -687,30 +687,24 @@ static inline enum radeon_bo_domain radeon_domain_from_heap(enum radeon_heap hea static inline unsigned radeon_flags_from_heap(enum radeon_heap heap) { + unsigned flags = RADEON_FLAG_NO_INTERPROCESS_SHARING | + (heap != RADEON_HEAP_GTT ? RADEON_FLAG_GTT_WC : 0); + switch (heap) { case RADEON_HEAP_VRAM_NO_CPU_ACCESS: - return RADEON_FLAG_GTT_WC | - RADEON_FLAG_NO_CPU_ACCESS | - RADEON_FLAG_NO_INTERPROCESS_SHARING; + return flags | + RADEON_FLAG_NO_CPU_ACCESS; case RADEON_HEAP_VRAM_READ_ONLY: - return RADEON_FLAG_GTT_WC | - RADEON_FLAG_NO_INTERPROCESS_SHARING | + case RADEON_HEAP_GTT_WC_READ_ONLY: + return flags | RADEON_FLAG_READ_ONLY; case RADEON_HEAP_VRAM: case RADEON_HEAP_GTT_WC: - return RADEON_FLAG_GTT_WC | - RADEON_FLAG_NO_INTERPROCESS_SHARING; - - case RADEON_HEAP_GTT_WC_READ_ONLY: - return RADEON_FLAG_GTT_WC | - RADEON_FLAG_NO_INTERPROCESS_SHARING | - RADEON_FLAG_READ_ONLY; - case RADEON_HEAP_GTT: default: - return RADEON_FLAG_NO_INTERPROCESS_SHARING; + return flags; } } |