summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-07-02 23:16:04 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-07-04 17:13:47 +0100
commit3f80f7edb8c511b94e66159cd59ba9362c3f69a2 (patch)
tree12012a7aa448aa52cfa4af24f58249b7d284307e /src
parentf91ee24b2dabb48288d6e81dcdd82191f158e312 (diff)
sna: Manually set to the GTT domain for mmap
...since the kernel no longer does strict coherency. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/kgem.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 38cf582c..40f35bd4 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -120,6 +120,7 @@ static int gem_set_tiling(int fd, uint32_t handle, int tiling, int stride)
static void *gem_mmap(int fd, uint32_t handle, int size, int prot)
{
struct drm_i915_gem_mmap_gtt mmap_arg;
+ struct drm_i915_gem_set_domain set_domain;
void *ptr;
DBG(("%s(handle=%d, size=%d, prot=%s)\n", __FUNCTION__,
@@ -137,6 +138,11 @@ static void *gem_mmap(int fd, uint32_t handle, int size, int prot)
ptr = NULL;
}
+ set_domain.handle = handle;
+ set_domain.read_domains = I915_GEM_DOMAIN_GTT;
+ set_domain.write_domain = prot & PROT_WRITE ? I915_GEM_DOMAIN_GTT : 0;
+ drmIoctl(fd, DRM_IOCTL_I915_GEM_SET_DOMAIN, &set_domain);
+
return ptr;
}