summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/winsys
diff options
context:
space:
mode:
authorFredrik Höglund <[email protected]>2016-10-27 02:49:59 +0200
committerDave Airlie <[email protected]>2016-10-28 12:27:49 +1000
commit044ef54d65e5f64126755503eefa411b1bdb8816 (patch)
tree17f229cfd1412c1ef162dbd0eaa425ac7294c65c /src/amd/vulkan/winsys
parentc9675b4e17e10abef9886b0aacb84e196655e510 (diff)
radv: split the device local memory heap into two
Advertise two device local memory heaps; one that is host visible and one that is not. This makes it possible for clients to tell how much host visible vs. non-host visible memory is available. Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/vulkan/winsys')
-rw-r--r--src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c
index 04561007258..b2e171a082a 100644
--- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c
+++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c
@@ -116,7 +116,7 @@ static bool
do_winsys_init(struct radv_amdgpu_winsys *ws, int fd)
{
struct amdgpu_buffer_size_alignments alignment_info = {};
- struct amdgpu_heap_info vram, gtt;
+ struct amdgpu_heap_info vram, visible_vram, gtt;
struct drm_amdgpu_info_hw_ip dma = {};
drmDevicePtr devinfo;
int r;
@@ -152,6 +152,13 @@ do_winsys_init(struct radv_amdgpu_winsys *ws, int fd)
goto fail;
}
+ r = amdgpu_query_heap_info(ws->dev, AMDGPU_GEM_DOMAIN_VRAM,
+ AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED, &visible_vram);
+ if (r) {
+ fprintf(stderr, "amdgpu: amdgpu_query_heap_info(visible_vram) failed.\n");
+ goto fail;
+ }
+
r = amdgpu_query_heap_info(ws->dev, AMDGPU_GEM_DOMAIN_GTT, 0, &gtt);
if (r) {
fprintf(stderr, "amdgpu: amdgpu_query_heap_info(gtt) failed.\n");
@@ -270,6 +277,7 @@ do_winsys_init(struct radv_amdgpu_winsys *ws, int fd)
ws->info.name = get_chip_name(ws->info.family);
ws->info.gart_size = gtt.heap_size;
ws->info.vram_size = vram.heap_size;
+ ws->info.visible_vram_size = visible_vram.heap_size;
/* convert the shader clock from KHz to MHz */
ws->info.max_shader_clock = ws->amdinfo.max_engine_clk / 1000;
ws->info.max_se = ws->amdinfo.num_shader_engines;