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>
This commit is contained in:
Chris Wilson 2011-07-02 23:16:04 +01:00
parent f91ee24b2d
commit 3f80f7edb8
1 changed files with 6 additions and 0 deletions

View File

@ -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;
}