diff options
author | Mark Kettenis <kettenis@openbsd.org> | 2013-03-04 22:18:47 +0100 |
---|---|---|
committer | Mark Kettenis <kettenis@openbsd.org> | 2013-03-04 22:18:47 +0100 |
commit | 85ef5c9012ed11ea9bb73d0666d76b21a6bc1fc5 (patch) | |
tree | aa30dca962d6f8f803599f4518f64e02b21cbe57 | |
parent | 1e545b739ed278feea98c0aa29cf293ebb757a80 (diff) |
move i915_gem_fault a bit closer to Linux 3.4.33
-rw-r--r-- | sys/dev/pci/drm/i915_gem.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/sys/dev/pci/drm/i915_gem.c b/sys/dev/pci/drm/i915_gem.c index df5862fbbb0..afa68270e14 100644 --- a/sys/dev/pci/drm/i915_gem.c +++ b/sys/dev/pci/drm/i915_gem.c @@ -603,20 +603,21 @@ i915_gem_fault(struct drm_obj *gem_obj, struct uvm_faultinfo *ufi, printf("%s: failed to bind\n", __func__); goto error; } + + ret = i915_gem_object_set_to_gtt_domain(obj, write); + if (ret) { + panic("%s: failed to set to gtt (%d)\n", + __func__, ret); + goto error; + } } - /* - * We could only do this on bind so allow for map_buffer_range - * unsynchronised objects (where buffer suballocation - * is done by the GL application), however it gives coherency problems - * normally. - */ - ret = i915_gem_object_set_to_gtt_domain(obj, write); - if (ret) { - panic("%s: failed to set to gtt (%d)\n", - __func__, ret); + if (obj->tiling_mode == I915_TILING_NONE) + ret = i915_gem_object_put_fence(obj); + else + ret = i915_gem_object_get_fence(obj); + if (ret) goto error; - } if (i915_gem_object_is_inactive(obj)) list_move_tail(&obj->mm_list, &dev_priv->mm.inactive_list); |