Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242318
b: refs/heads/master
c: d4aeee7
h: refs/heads/master
v: v3
  • Loading branch information
Chris Wilson committed Mar 23, 2011
1 parent 8f6ae2a commit 81080aa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 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: ed0291fd16f6349ef43d3f25a4626c2f7baf568b
refs/heads/master: d4aeee776017b6da6dcd12f453cd82a3c951a0dc
21 changes: 17 additions & 4 deletions trunk/drivers/gpu/drm/i915/i915_gem_execbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,10 @@ i915_gem_execbuffer_relocate_entry(struct drm_i915_gem_object *obj,
uint32_t __iomem *reloc_entry;
void __iomem *reloc_page;

/* We can't wait for rendering with pagefaults disabled */
if (obj->active && in_atomic())
return -EFAULT;

ret = i915_gem_object_set_to_gtt_domain(obj, 1);
if (ret)
return ret;
Expand Down Expand Up @@ -440,15 +444,24 @@ i915_gem_execbuffer_relocate(struct drm_device *dev,
struct list_head *objects)
{
struct drm_i915_gem_object *obj;
int ret;

int ret = 0;

/* This is the fast path and we cannot handle a pagefault whilst
* holding the struct mutex lest the user pass in the relocations
* contained within a mmaped bo. For in such a case we, the page
* fault handler would call i915_gem_fault() and we would try to
* acquire the struct mutex again. Obviously this is bad and so
* lockdep complains vehemently.
*/
pagefault_disable();
list_for_each_entry(obj, objects, exec_list) {
ret = i915_gem_execbuffer_relocate_object(obj, eb);
if (ret)
return ret;
break;
}
pagefault_enable();

return 0;
return ret;
}

static int
Expand Down

0 comments on commit 81080aa

Please sign in to comment.