summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2016-06-22 11:22:33 +0200
committerNicolai Hähnle <[email protected]>2016-06-24 12:36:03 +0200
commitbc4b7ebbfd1cab4a88f9349289dc7480b48b8291 (patch)
tree8782ffc1661a6ddc729c76beac109713230e2655 /src/gallium/winsys
parent49c0b4a0db2178a1a4e0c39076070cb45a4f09c7 (diff)
winsys/radeon: add guard pages when R600_DEBUG=check_vm is enabled
This should help flush out GPU VM faults. Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_bo.c4
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_winsys.c4
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_winsys.h1
3 files changed, 7 insertions, 2 deletions
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
index 2c10e2eb622..58b52a402c7 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
@@ -555,8 +555,10 @@ static struct radeon_bo *radeon_create_bo(struct radeon_drm_winsys *rws,
if (rws->info.has_virtual_memory) {
struct drm_radeon_gem_va va;
+ unsigned va_gap_size;
- bo->va = radeon_bomgr_find_va(rws, size, alignment);
+ va_gap_size = rws->check_vm ? MAX2(4 * alignment, 64 * 1024) : 0;
+ bo->va = radeon_bomgr_find_va(rws, size + va_gap_size, alignment);
va.handle = bo->handle;
va.vm_id = 0;
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
index f5f9d420722..11c4ef77172 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
@@ -527,6 +527,8 @@ static boolean do_winsys_init(struct radeon_drm_winsys *ws)
(ws->info.family == CHIP_HAWAII &&
ws->accel_working2 < 3);
+ ws->check_vm = strstr(debug_get_option("R600_DEBUG", ""), "check_vm") != NULL;
+
return TRUE;
}
@@ -742,7 +744,7 @@ radeon_drm_winsys_create(int fd, radeon_screen_create_t screen_create)
if (!do_winsys_init(ws))
goto fail1;
- pb_cache_init(&ws->bo_cache, 500000, 2.0f, 0,
+ pb_cache_init(&ws->bo_cache, 500000, ws->check_vm ? 1.0f : 2.0f, 0,
MIN2(ws->info.vram_size, ws->info.gart_size),
radeon_bo_destroy,
radeon_bo_can_reclaim);
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.h b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.h
index c429aba9305..fdbaebe67b5 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.h
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.h
@@ -91,6 +91,7 @@ struct radeon_drm_winsys {
uint64_t va_offset;
struct list_head va_holes;
+ bool check_vm;
struct radeon_surface_manager *surf_man;