summaryrefslogtreecommitdiff
path: root/src/sna/kgem.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-07-01 16:13:47 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-07-01 18:07:23 +0100
commitcce2351056eda1282a521b96f90ba12436e86492 (patch)
tree8c13eead993be2e0b51bd60cfdee2a7c0a2b9136 /src/sna/kgem.c
parent7aff6beb37c91df85c46372d44ae4a5fefae5ae8 (diff)
sna: Debug options for forcing mmap syncs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/kgem.c')
-rw-r--r--src/sna/kgem.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index e905f209..e0925b2f 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -76,6 +76,8 @@ search_snoop_cache(struct kgem *kgem, unsigned int num_pages, unsigned flags);
#define DBG_NO_HANDLE_LUT 0
#define DBG_DUMP 0
+#define FORCE_MMAP_SYNC 0 /* ((1 << DOMAIN_CPU) | (1 << DOMAIN_GTT)) */
+
#ifndef DEBUG_SYNC
#define DEBUG_SYNC 0
#endif
@@ -4768,7 +4770,7 @@ void *kgem_bo_map(struct kgem *kgem, struct kgem_bo *bo)
DBG(("%s: caching GTT vma for %d\n", __FUNCTION__, bo->handle));
}
- if (bo->domain != DOMAIN_GTT) {
+ if (bo->domain != DOMAIN_GTT || FORCE_MMAP_SYNC & (1 << DOMAIN_GTT)) {
struct drm_i915_gem_set_domain set_domain;
DBG(("%s: sync: needs_flush? %d, domain? %d, busy? %d\n", __FUNCTION__,
@@ -5039,7 +5041,7 @@ void kgem_bo_sync__cpu(struct kgem *kgem, struct kgem_bo *bo)
while (bo->proxy)
bo = bo->proxy;
- if (bo->domain != DOMAIN_CPU) {
+ if (bo->domain != DOMAIN_CPU || FORCE_MMAP_SYNC & (1 << DOMAIN_CPU)) {
struct drm_i915_gem_set_domain set_domain;
DBG(("%s: SYNC: handle=%d, needs_flush? %d, domain? %d, busy? %d\n",
@@ -5070,7 +5072,7 @@ void kgem_bo_sync__cpu_full(struct kgem *kgem, struct kgem_bo *bo, bool write)
while (bo->proxy)
bo = bo->proxy;
- if (bo->domain != DOMAIN_CPU) {
+ if (bo->domain != DOMAIN_CPU || FORCE_MMAP_SYNC & (1 << DOMAIN_CPU)) {
struct drm_i915_gem_set_domain set_domain;
DBG(("%s: SYNC: handle=%d, needs_flush? %d, domain? %d, busy? %d\n",
@@ -5097,7 +5099,7 @@ void kgem_bo_sync__gtt(struct kgem *kgem, struct kgem_bo *bo)
assert(bo->proxy == NULL);
kgem_bo_submit(kgem, bo);
- if (bo->domain != DOMAIN_GTT) {
+ if (bo->domain != DOMAIN_GTT || FORCE_MMAP_SYNC & (1 << DOMAIN_GTT)) {
struct drm_i915_gem_set_domain set_domain;
DBG(("%s: SYNC: handle=%d, needs_flush? %d, domain? %d, busy? %d\n",