summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/radeon
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-12-01 00:06:34 +0100
committerMarek Olšák <[email protected]>2017-12-05 13:30:34 +0100
commit9ac5504df5c31e60801d9d37c1f3d547c486bf0a (patch)
tree4a0f57e7d6e6a7d72df76b7af23bdae3ba47e3aa /src/gallium/winsys/radeon
parent5e805cc74bc52f97de8f6308fc06bc96623e7e09 (diff)
gallium/radeon: move setting VRAM|GTT into winsyses
The combined VRAM|GTT heap will be removed. Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/winsys/radeon')
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_bo.c7
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_cs.c8
2 files changed, 15 insertions, 0 deletions
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
index 87c3f1e1006..fc95a98620b 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
@@ -609,6 +609,13 @@ static struct radeon_bo *radeon_create_bo(struct radeon_drm_winsys *rws,
args.initial_domain = initial_domains;
args.flags = 0;
+ /* If VRAM is just stolen system memory, allow both VRAM and
+ * GTT, whichever has free space. If a buffer is evicted from
+ * VRAM to GTT, it will stay there.
+ */
+ if (!rws->info.has_dedicated_vram)
+ args.initial_domain |= RADEON_DOMAIN_GTT;
+
if (flags & RADEON_FLAG_GTT_WC)
args.flags |= RADEON_GEM_GTT_WC;
if (flags & RADEON_FLAG_NO_CPU_ACCESS)
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c
index c3398d0f589..92452e47fb1 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c
@@ -338,6 +338,14 @@ static unsigned radeon_drm_cs_add_buffer(struct radeon_winsys_cs *rcs,
struct radeon_drm_cs *cs = radeon_drm_cs(rcs);
struct radeon_bo *bo = (struct radeon_bo*)buf;
enum radeon_bo_domain added_domains;
+
+ /* If VRAM is just stolen system memory, allow both VRAM and
+ * GTT, whichever has free space. If a buffer is evicted from
+ * VRAM to GTT, it will stay there.
+ */
+ if (!cs->ws->info.has_dedicated_vram)
+ domains |= RADEON_DOMAIN_GTT;
+
enum radeon_bo_domain rd = usage & RADEON_USAGE_READ ? domains : 0;
enum radeon_bo_domain wd = usage & RADEON_USAGE_WRITE ? domains : 0;
struct drm_radeon_cs_reloc *reloc;