diff options
author | Mark Kettenis <kettenis@openbsd.org> | 2013-03-08 16:18:31 +0100 |
---|---|---|
committer | Mark Kettenis <kettenis@openbsd.org> | 2013-03-08 16:18:31 +0100 |
commit | ac8b5dfce209db601713bc753816881b0e6ba182 (patch) | |
tree | ee6f09901638c441a88d8b8977e1fa1d4f91b0cb /sys | |
parent | aa8a40b445a665256714e9fb89f84c6fd3eadf03 (diff) |
Implement i915_mutex_lock_interruptible
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/drm/i915_drv.h | 6 | ||||
-rw-r--r-- | sys/dev/pci/drm/i915_gem.c | 20 |
2 files changed, 24 insertions, 2 deletions
diff --git a/sys/dev/pci/drm/i915_drv.h b/sys/dev/pci/drm/i915_drv.h index 337f318bff9..3f4df0de4ac 100644 --- a/sys/dev/pci/drm/i915_drv.h +++ b/sys/dev/pci/drm/i915_drv.h @@ -1162,8 +1162,10 @@ int i915_gem_swizzle_page(struct vm_page *page); int i915_tiling_ok(struct drm_device *, int, int, int); bool i915_gem_object_fence_ok(struct drm_i915_gem_object *, int); -/* i915_suspend.c */ +/* i915_gem_debug.c */ +#define i915_verify_lists(dev) 0 +/* i915_suspend.c */ extern void i915_save_display(struct drm_device *); extern void i915_restore_display(struct drm_device *); extern int i915_save_state(struct drm_device *); @@ -1198,6 +1200,8 @@ void i915_gem_release(struct drm_device *, struct drm_file *); int i915_gem_object_sync(struct drm_i915_gem_object *, struct intel_ring_buffer *); +int i915_mutex_lock_interruptible(struct drm_device *dev); + /* intel_opregion.c */ int intel_opregion_setup(struct drm_device *dev); extern int intel_opregion_init(struct drm_device *dev); diff --git a/sys/dev/pci/drm/i915_gem.c b/sys/dev/pci/drm/i915_gem.c index d7bb5b89de3..64ae61de7fc 100644 --- a/sys/dev/pci/drm/i915_gem.c +++ b/sys/dev/pci/drm/i915_gem.c @@ -95,7 +95,25 @@ i915_gem_object_fence_lost(struct drm_i915_gem_object *obj) // i915_gem_info_add_obj // i915_gem_info_remove_obj // i915_gem_wait_for_error -// i915_mutex_lock_interruptible + +int +i915_mutex_lock_interruptible(struct drm_device *dev) +{ + int ret; + +#ifdef notyet + ret = i915_gem_wait_for_error(dev); + if (ret) + return ret; +#endif + + ret = rw_enter(&dev->dev_lock, RW_WRITE | RW_INTR); + if (ret) + return ret; + + WARN_ON(i915_verify_lists(dev)); + return 0; +} static inline bool i915_gem_object_is_inactive(struct drm_i915_gem_object *obj) |