Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 345487
b: refs/heads/master
c: c983930
h: refs/heads/master
i:
  345485: aff1db1
  345483: 75aa4c8
  345479: 78c3d8b
  345471: 221be98
v: v3
  • Loading branch information
Chris Wilson authored and Daniel Vetter committed Nov 21, 2012
1 parent e5e9652 commit 1dc439a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fbdda6fb5ee5da401af42226878880069a6b8615
refs/heads/master: c9839303d186d6270f570ff3c5f56c2327958086
29 changes: 9 additions & 20 deletions trunk/drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1345,30 +1345,17 @@ int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
trace_i915_gem_object_fault(obj, page_offset, true, write);

/* Now bind it into the GTT if needed */
if (!obj->map_and_fenceable) {
ret = i915_gem_object_unbind(obj);
if (ret)
goto unlock;
}
if (!obj->gtt_space) {
ret = i915_gem_object_bind_to_gtt(obj, 0, true, false);
if (ret)
goto unlock;

ret = i915_gem_object_set_to_gtt_domain(obj, write);
if (ret)
goto unlock;
}
ret = i915_gem_object_pin(obj, 0, true, false);
if (ret)
goto unlock;

if (!obj->has_global_gtt_mapping)
i915_gem_gtt_bind_object(obj, obj->cache_level);
ret = i915_gem_object_set_to_gtt_domain(obj, write);
if (ret)
goto unpin;

ret = i915_gem_object_get_fence(obj);
if (ret)
goto unlock;

if (i915_gem_object_is_inactive(obj))
list_move_tail(&obj->mm_list, &dev_priv->mm.inactive_list);
goto unpin;

obj->fault_mappable = true;

Expand All @@ -1377,6 +1364,8 @@ int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)

/* Finally, remap it using the new GTT offset */
ret = vm_insert_pfn(vma, (unsigned long)vmf->virtual_address, pfn);
unpin:
i915_gem_object_unpin(obj);
unlock:
mutex_unlock(&dev->struct_mutex);
out:
Expand Down

0 comments on commit 1dc439a

Please sign in to comment.