drm/i915: fall back to shmem pwrite when the buffer is not accessible
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Sun, 25 Mar 2012 17:47:38 +0000 (19:47 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 27 Mar 2012 11:29:08 +0000 (13:29 +0200)
It's too expensive to move it around just for that pwrite, especially
when we're trashing on the mappable gtt part like crazy.

Tested-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem.c

index 83dfb4407c8f78ae15f66badad5910fc5729c801..7f33e6af6ecbeb3fa413dd57c3a72baca6a4abeb 100644 (file)
@@ -771,6 +771,7 @@ i915_gem_pwrite_ioctl(struct drm_device *dev, void *data,
 
        if (obj->gtt_space &&
            obj->cache_level == I915_CACHE_NONE &&
+           obj->map_and_fenceable &&
            obj->base.write_domain != I915_GEM_DOMAIN_CPU) {
                ret = i915_gem_gtt_pwrite_fast(dev, obj, args, file);
                /* Note that the gtt paths might fail with non-page-backed user