File tree Expand file tree Collapse file tree 1 file changed +6
-25
lines changed Expand file tree Collapse file tree 1 file changed +6
-25
lines changed Original file line number Diff line number Diff line change @@ -151,32 +151,13 @@ i915_gem_object_wait_priority(struct drm_i915_gem_object *obj,
151
151
unsigned int flags ,
152
152
const struct i915_sched_attr * attr )
153
153
{
154
- struct dma_fence * excl ;
155
-
156
- if (flags & I915_WAIT_ALL ) {
157
- struct dma_fence * * shared ;
158
- unsigned int count , i ;
159
- int ret ;
160
-
161
- ret = dma_resv_get_fences (obj -> base .resv , & excl , & count ,
162
- & shared );
163
- if (ret )
164
- return ret ;
154
+ struct dma_resv_iter cursor ;
155
+ struct dma_fence * fence ;
165
156
166
- for (i = 0 ; i < count ; i ++ ) {
167
- i915_gem_fence_wait_priority (shared [i ], attr );
168
- dma_fence_put (shared [i ]);
169
- }
170
-
171
- kfree (shared );
172
- } else {
173
- excl = dma_resv_get_excl_unlocked (obj -> base .resv );
174
- }
175
-
176
- if (excl ) {
177
- i915_gem_fence_wait_priority (excl , attr );
178
- dma_fence_put (excl );
179
- }
157
+ dma_resv_iter_begin (& cursor , obj -> base .resv , flags & I915_WAIT_ALL );
158
+ dma_resv_for_each_fence_unlocked (& cursor , fence )
159
+ i915_gem_fence_wait_priority (fence , attr );
160
+ dma_resv_iter_end (& cursor );
180
161
return 0 ;
181
162
}
182
163
You can’t perform that action at this time.
0 commit comments