summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/sna/kgem.c13
-rw-r--r--src/sna/kgem.h1
2 files changed, 14 insertions, 0 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index e59811fa..c528fe76 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -697,12 +697,22 @@ void kgem_init(struct kgem *kgem, int fd, struct pci_device *dev, int gen)
kgem->wedged = 1;
}
+ kgem->has_relaxed_delta =
+ gem_param(kgem, I915_PARAM_HAS_RELAXED_DELTA) > 0;
+ DBG(("%s: has relaxed delta? %d\n", __FUNCTION__,
+ kgem->has_relaxed_delta));
+
kgem->batch_size = ARRAY_SIZE(kgem->batch);
if (gen == 22)
/* 865g cannot handle a batch spanning multiple pages */
kgem->batch_size = PAGE_SIZE / sizeof(uint32_t);
if (gen == 70)
kgem->batch_size = 16*1024;
+ if (!kgem->has_relaxed_delta)
+ kgem->batch_size = 4*1024;
+
+ DBG(("%s: maximum batch size? %d\n", __FUNCTION__,
+ kgem->batch_size));
kgem->min_alignment = 4;
if (gen < 40)
@@ -1877,6 +1887,9 @@ static int compact_batch_surface(struct kgem *kgem)
{
int size, shrink, n;
+ if (!kgem->has_relaxed_delta)
+ return kgem->batch_size;
+
/* See if we can pack the contents into one or two pages */
n = ALIGN(kgem->batch_size, 1024);
size = n - kgem->surface + kgem->nbatch;
diff --git a/src/sna/kgem.h b/src/sna/kgem.h
index ba110b6f..75963264 100644
--- a/src/sna/kgem.h
+++ b/src/sna/kgem.h
@@ -154,6 +154,7 @@ struct kgem {
uint32_t has_vmap :1;
uint32_t has_relaxed_fencing :1;
+ uint32_t has_relaxed_delta :1;
uint32_t has_semaphores :1;
uint32_t has_cache_level :1;
uint32_t has_llc :1;