File tree Expand file tree Collapse file tree 2 files changed +4
-39
lines changed Expand file tree Collapse file tree 2 files changed +4
-39
lines changed Original file line number Diff line number Diff line change 35
35
#include "i915_drv.h"
36
36
#include "i915_trace.h"
37
37
38
- static bool mutex_is_locked_by (struct mutex * mutex , struct task_struct * task )
39
- {
40
- if (!mutex_is_locked (mutex ))
41
- return false;
42
-
43
- #if defined(CONFIG_DEBUG_MUTEXES ) || defined(CONFIG_MUTEX_SPIN_ON_OWNER )
44
- return mutex -> owner == task ;
45
- #else
46
- /* Since UP may be pre-empted, we cannot assume that we own the lock */
47
- return false;
48
- #endif
49
- }
50
-
51
38
static bool any_vma_pinned (struct drm_i915_gem_object * obj )
52
39
{
53
40
struct i915_vma * vma ;
@@ -240,13 +227,8 @@ unsigned long i915_gem_shrink_all(struct drm_i915_private *dev_priv)
240
227
241
228
static bool i915_gem_shrinker_lock (struct drm_device * dev , bool * unlock )
242
229
{
243
- if (!mutex_trylock (& dev -> struct_mutex )) {
244
- if (!mutex_is_locked_by (& dev -> struct_mutex , current ))
245
- return false;
246
-
230
+ if (!mutex_trylock (& dev -> struct_mutex ))
247
231
* unlock = false;
248
- } else
249
- * unlock = true;
250
232
251
233
return true;
252
234
}
Original file line number Diff line number Diff line change 18
18
#include "msm_drv.h"
19
19
#include "msm_gem.h"
20
20
21
- static bool mutex_is_locked_by (struct mutex * mutex , struct task_struct * task )
22
- {
23
- if (!mutex_is_locked (mutex ))
24
- return false;
25
-
26
- #if defined(CONFIG_SMP ) || defined(CONFIG_DEBUG_MUTEXES )
27
- return mutex -> owner == task ;
28
- #else
29
- /* Since UP may be pre-empted, we cannot assume that we own the lock */
30
- return false;
31
- #endif
32
- }
33
-
34
21
static bool msm_gem_shrinker_lock (struct drm_device * dev , bool * unlock )
35
22
{
36
- if (!mutex_trylock (& dev -> struct_mutex )) {
37
- if (!mutex_is_locked_by (& dev -> struct_mutex , current ))
38
- return false;
39
- * unlock = false;
40
- } else {
41
- * unlock = true;
42
- }
23
+ if (!mutex_trylock (& dev -> struct_mutex ))
24
+ return false;
43
25
26
+ * unlock = true;
44
27
return true;
45
28
}
46
29
You can’t perform that action at this time.
0 commit comments