diff options
author | Jerome Glisse <jglisse@redhat.com> | 2009-12-15 12:23:23 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-12-16 00:39:24 -0500 |
commit | f89551bfe953a144f7d4918ca4c12e11de1e455d (patch) | |
tree | 63f75b6044cf45b445a2da22cf122e951fb93b3e /drivers/gpu | |
parent | 51f07b7ebce15c1848743a2ba43a0005375d8243 (diff) |
drm/radeon/kms: Return to userspace on ERESTARTSYS
radeon_object.h wasn't converted to ERESTARTSYS change. No
each time we got an ERESTARTSYS we return to userspace (ie
we were interrupted by a signal and we let the userspace
reschedule the ioctl).
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_object.h | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_object.h b/drivers/gpu/drm/radeon/radeon_object.h index f6b69c2c0d00..a02f18011ad1 100644 --- a/drivers/gpu/drm/radeon/radeon_object.h +++ b/drivers/gpu/drm/radeon/radeon_object.h | |||
@@ -59,19 +59,17 @@ static inline unsigned radeon_mem_type_to_domain(u32 mem_type) | |||
59 | * | 59 | * |
60 | * Returns: | 60 | * Returns: |
61 | * -EBUSY: buffer is busy and @no_wait is true | 61 | * -EBUSY: buffer is busy and @no_wait is true |
62 | * -ERESTART: A wait for the buffer to become unreserved was interrupted by | 62 | * -ERESTARTSYS: A wait for the buffer to become unreserved was interrupted by |
63 | * a signal. Release all buffer reservations and return to user-space. | 63 | * a signal. Release all buffer reservations and return to user-space. |
64 | */ | 64 | */ |
65 | static inline int radeon_bo_reserve(struct radeon_bo *bo, bool no_wait) | 65 | static inline int radeon_bo_reserve(struct radeon_bo *bo, bool no_wait) |
66 | { | 66 | { |
67 | int r; | 67 | int r; |
68 | 68 | ||
69 | retry: | ||
70 | r = ttm_bo_reserve(&bo->tbo, true, no_wait, false, 0); | 69 | r = ttm_bo_reserve(&bo->tbo, true, no_wait, false, 0); |
71 | if (unlikely(r != 0)) { | 70 | if (unlikely(r != 0)) { |
72 | if (r == -ERESTART) | 71 | if (r != -ERESTARTSYS) |
73 | goto retry; | 72 | dev_err(bo->rdev->dev, "%p reserve failed\n", bo); |
74 | dev_err(bo->rdev->dev, "%p reserve failed\n", bo); | ||
75 | return r; | 73 | return r; |
76 | } | 74 | } |
77 | return 0; | 75 | return 0; |
@@ -125,12 +123,10 @@ static inline int radeon_bo_wait(struct radeon_bo *bo, u32 *mem_type, | |||
125 | { | 123 | { |
126 | int r; | 124 | int r; |
127 | 125 | ||
128 | retry: | ||
129 | r = ttm_bo_reserve(&bo->tbo, true, no_wait, false, 0); | 126 | r = ttm_bo_reserve(&bo->tbo, true, no_wait, false, 0); |
130 | if (unlikely(r != 0)) { | 127 | if (unlikely(r != 0)) { |
131 | if (r == -ERESTART) | 128 | if (r != -ERESTARTSYS) |
132 | goto retry; | 129 | dev_err(bo->rdev->dev, "%p reserve failed for wait\n", bo); |
133 | dev_err(bo->rdev->dev, "%p reserve failed for wait\n", bo); | ||
134 | return r; | 130 | return r; |
135 | } | 131 | } |
136 | spin_lock(&bo->tbo.lock); | 132 | spin_lock(&bo->tbo.lock); |
@@ -140,8 +136,6 @@ retry: | |||
140 | r = ttm_bo_wait(&bo->tbo, true, true, no_wait); | 136 | r = ttm_bo_wait(&bo->tbo, true, true, no_wait); |
141 | spin_unlock(&bo->tbo.lock); | 137 | spin_unlock(&bo->tbo.lock); |
142 | ttm_bo_unreserve(&bo->tbo); | 138 | ttm_bo_unreserve(&bo->tbo); |
143 | if (unlikely(r == -ERESTART)) | ||
144 | goto retry; | ||
145 | return r; | 139 | return r; |
146 | } | 140 | } |
147 | 141 | ||