summaryrefslogtreecommitdiff
path: root/src/sna
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-12-16 17:37:32 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-12-16 17:37:32 +0000
commitf1aec676810c4a4c180b342d9a83254e08dd55da (patch)
tree6b7c122131108c82b78a8899e773f206eb03d109 /src/sna
parentc7ac12003bd0c7d85fa47d43ee2734b222d84a61 (diff)
sna: Precompute the base set of batch-flags
This is to make it easier to extend in future. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna')
-rw-r--r--src/sna/kgem.c12
-rw-r--r--src/sna/kgem.h1
2 files changed, 8 insertions, 5 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index fc977379..15d56426 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -1138,6 +1138,12 @@ void kgem_init(struct kgem *kgem, int fd, struct pci_device *dev, unsigned gen)
if ((int)kgem->fence_max < 0)
kgem->fence_max = 5; /* minimum safe value for all hw */
DBG(("%s: max fences=%d\n", __FUNCTION__, kgem->fence_max));
+
+ kgem->batch_flags_base = 0;
+ if (kgem->has_no_reloc)
+ kgem->batch_flags_base |= LOCAL_I915_EXEC_NO_RELOC;
+ if (kgem->has_handle_lut)
+ kgem->batch_flags_base |= LOCAL_I915_EXEC_HANDLE_LUT;
}
/* XXX hopefully a good approximation */
@@ -2303,11 +2309,7 @@ void kgem_reset(struct kgem *kgem)
kgem->surface = kgem->batch_size;
kgem->mode = KGEM_NONE;
kgem->flush = 0;
- kgem->batch_flags = 0;
- if (kgem->has_no_reloc)
- kgem->batch_flags |= LOCAL_I915_EXEC_NO_RELOC;
- if (kgem->has_handle_lut)
- kgem->batch_flags |= LOCAL_I915_EXEC_HANDLE_LUT;
+ kgem->batch_flags = kgem->batch_flags_base;
kgem->next_request = __kgem_request_alloc();
diff --git a/src/sna/kgem.h b/src/sna/kgem.h
index 53e252dc..59be858b 100644
--- a/src/sna/kgem.h
+++ b/src/sna/kgem.h
@@ -144,6 +144,7 @@ struct kgem {
} vma[NUM_MAP_TYPES];
uint32_t batch_flags;
+ uint32_t batch_flags_base;
#define I915_EXEC_SECURE (1<<9)
#define LOCAL_EXEC_OBJECT_WRITE (1<<2)