File tree Expand file tree Collapse file tree 1 file changed +28
-3
lines changed Expand file tree Collapse file tree 1 file changed +28
-3
lines changed Original file line number Diff line number Diff line change @@ -148,6 +148,31 @@ static void __context_unpin_state(struct i915_vma *vma)
148
148
__i915_vma_unpin (vma );
149
149
}
150
150
151
+ static int __ring_active (struct intel_ring * ring )
152
+ {
153
+ int err ;
154
+
155
+ err = i915_active_acquire (& ring -> vma -> active );
156
+ if (err )
157
+ return err ;
158
+
159
+ err = intel_ring_pin (ring );
160
+ if (err )
161
+ goto err_active ;
162
+
163
+ return 0 ;
164
+
165
+ err_active :
166
+ i915_active_release (& ring -> vma -> active );
167
+ return err ;
168
+ }
169
+
170
+ static void __ring_retire (struct intel_ring * ring )
171
+ {
172
+ intel_ring_unpin (ring );
173
+ i915_active_release (& ring -> vma -> active );
174
+ }
175
+
151
176
__i915_active_call
152
177
static void __intel_context_retire (struct i915_active * active )
153
178
{
@@ -160,7 +185,7 @@ static void __intel_context_retire(struct i915_active *active)
160
185
__context_unpin_state (ce -> state );
161
186
162
187
intel_timeline_unpin (ce -> timeline );
163
- intel_ring_unpin (ce -> ring );
188
+ __ring_retire (ce -> ring );
164
189
165
190
intel_context_put (ce );
166
191
}
@@ -172,7 +197,7 @@ static int __intel_context_active(struct i915_active *active)
172
197
173
198
intel_context_get (ce );
174
199
175
- err = intel_ring_pin (ce -> ring );
200
+ err = __ring_active (ce -> ring );
176
201
if (err )
177
202
goto err_put ;
178
203
@@ -192,7 +217,7 @@ static int __intel_context_active(struct i915_active *active)
192
217
err_timeline :
193
218
intel_timeline_unpin (ce -> timeline );
194
219
err_ring :
195
- intel_ring_unpin (ce -> ring );
220
+ __ring_retire (ce -> ring );
196
221
err_put :
197
222
intel_context_put (ce );
198
223
return err ;
You can’t perform that action at this time.
0 commit comments