Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 166037
b: refs/heads/master
c: c715089
h: refs/heads/master
i:
  166035: a73daad
v: v3
  • Loading branch information
Chris Wilson authored and Eric Anholt committed Sep 23, 2009
1 parent e17d837 commit 1c73fbf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 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: ab18282d58ce67ee5cd720d99a91c1a2bbf3e693
refs/heads/master: c715089f49844260f1eeae8e3b55af9468ba1325
29 changes: 12 additions & 17 deletions trunk/drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1200,45 +1200,40 @@ int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
mutex_lock(&dev->struct_mutex);
if (!obj_priv->gtt_space) {
ret = i915_gem_object_bind_to_gtt(obj, 0);
if (ret) {
mutex_unlock(&dev->struct_mutex);
return VM_FAULT_SIGBUS;
}
if (ret)
goto unlock;

list_add_tail(&obj_priv->list, &dev_priv->mm.inactive_list);

ret = i915_gem_object_set_to_gtt_domain(obj, write);
if (ret) {
mutex_unlock(&dev->struct_mutex);
return VM_FAULT_SIGBUS;
}
if (ret)
goto unlock;
}

/* Need a new fence register? */
if (obj_priv->tiling_mode != I915_TILING_NONE) {
ret = i915_gem_object_get_fence_reg(obj);
if (ret) {
mutex_unlock(&dev->struct_mutex);
return VM_FAULT_SIGBUS;
}
if (ret)
goto unlock;
}

pfn = ((dev->agp->base + obj_priv->gtt_offset) >> PAGE_SHIFT) +
page_offset;

/* Finally, remap it using the new GTT offset */
ret = vm_insert_pfn(vma, (unsigned long)vmf->virtual_address, pfn);

unlock:
mutex_unlock(&dev->struct_mutex);

switch (ret) {
case 0:
case -ERESTARTSYS:
return VM_FAULT_NOPAGE;
case -ENOMEM:
case -EAGAIN:
return VM_FAULT_OOM;
case -EFAULT:
case -EINVAL:
return VM_FAULT_SIGBUS;
default:
return VM_FAULT_NOPAGE;
return VM_FAULT_SIGBUS;
}
}

Expand Down

0 comments on commit 1c73fbf

Please sign in to comment.