diff options
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_execbuffer.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_execbuffer.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index 7ff7f933ddf..20a4cc5b818 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c | |||
@@ -367,6 +367,10 @@ i915_gem_execbuffer_relocate_entry(struct drm_i915_gem_object *obj, | |||
367 | uint32_t __iomem *reloc_entry; | 367 | uint32_t __iomem *reloc_entry; |
368 | void __iomem *reloc_page; | 368 | void __iomem *reloc_page; |
369 | 369 | ||
370 | /* We can't wait for rendering with pagefaults disabled */ | ||
371 | if (obj->active && in_atomic()) | ||
372 | return -EFAULT; | ||
373 | |||
370 | ret = i915_gem_object_set_to_gtt_domain(obj, 1); | 374 | ret = i915_gem_object_set_to_gtt_domain(obj, 1); |
371 | if (ret) | 375 | if (ret) |
372 | return ret; | 376 | return ret; |
@@ -440,15 +444,24 @@ i915_gem_execbuffer_relocate(struct drm_device *dev, | |||
440 | struct list_head *objects) | 444 | struct list_head *objects) |
441 | { | 445 | { |
442 | struct drm_i915_gem_object *obj; | 446 | struct drm_i915_gem_object *obj; |
443 | int ret; | 447 | int ret = 0; |
444 | 448 | ||
449 | /* This is the fast path and we cannot handle a pagefault whilst | ||
450 | * holding the struct mutex lest the user pass in the relocations | ||
451 | * contained within a mmaped bo. For in such a case we, the page | ||
452 | * fault handler would call i915_gem_fault() and we would try to | ||
453 | * acquire the struct mutex again. Obviously this is bad and so | ||
454 | * lockdep complains vehemently. | ||
455 | */ | ||
456 | pagefault_disable(); | ||
445 | list_for_each_entry(obj, objects, exec_list) { | 457 | list_for_each_entry(obj, objects, exec_list) { |
446 | ret = i915_gem_execbuffer_relocate_object(obj, eb); | 458 | ret = i915_gem_execbuffer_relocate_object(obj, eb); |
447 | if (ret) | 459 | if (ret) |
448 | return ret; | 460 | break; |
449 | } | 461 | } |
462 | pagefault_enable(); | ||
450 | 463 | ||
451 | return 0; | 464 | return ret; |
452 | } | 465 | } |
453 | 466 | ||
454 | static int | 467 | static int |