Rev 5056 | Rev 6082 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5056 | Rev 5270 | ||
---|---|---|---|
Line 27... | Line 27... | ||
27 | #include |
27 | #include |
Line 28... | Line 28... | ||
28 | 28 | ||
Line 29... | Line 29... | ||
29 | struct drm_modeset_lock; |
29 | struct drm_modeset_lock; |
30 | 30 | ||
31 | /** |
31 | /** |
32 | * drm_modeset_acquire_ctx - locking context (see ww_acquire_ctx) |
32 | * struct drm_modeset_acquire_ctx - locking context (see ww_acquire_ctx) |
33 | * @ww_ctx: base acquire ctx |
33 | * @ww_ctx: base acquire ctx |
- | 34 | * @contended: used internally for -EDEADLK handling |
|
34 | * @contended: used internally for -EDEADLK handling |
35 | * @locked: list of held locks |
35 | * @locked: list of held locks |
36 | * @trylock_only: trylock mode used in atomic contexts/panic notifiers |
36 | * |
37 | * |
37 | * Each thread competing for a set of locks must use one acquire |
38 | * Each thread competing for a set of locks must use one acquire |
38 | * ctx. And if any lock fxn returns -EDEADLK, it must backoff and |
39 | * ctx. And if any lock fxn returns -EDEADLK, it must backoff and |
Line 51... | Line 52... | ||
51 | 52 | ||
52 | /** |
53 | /** |
53 | * list of held locks (drm_modeset_lock) |
54 | * list of held locks (drm_modeset_lock) |
54 | */ |
55 | */ |
- | 56 | struct list_head locked; |
|
- | 57 | ||
- | 58 | /** |
|
- | 59 | * Trylock mode, use only for panic handlers! |
|
- | 60 | */ |
|
55 | struct list_head locked; |
61 | bool trylock_only; |
Line 56... | Line 62... | ||
56 | }; |
62 | }; |
57 | 63 | ||
58 | /** |
64 | /** |
59 | * drm_modeset_lock - used for locking modeset resources. |
65 | * struct drm_modeset_lock - used for locking modeset resources. |
60 | * @mutex: resource locking |
66 | * @mutex: resource locking |
61 | * @head: used to hold it's place on state->locked list when |
67 | * @head: used to hold it's place on state->locked list when |
62 | * part of an atomic update |
68 | * part of an atomic update |
Line 118... | Line 124... | ||
118 | int drm_modeset_lock_interruptible(struct drm_modeset_lock *lock, |
124 | int drm_modeset_lock_interruptible(struct drm_modeset_lock *lock, |
119 | struct drm_modeset_acquire_ctx *ctx); |
125 | struct drm_modeset_acquire_ctx *ctx); |
120 | void drm_modeset_unlock(struct drm_modeset_lock *lock); |
126 | void drm_modeset_unlock(struct drm_modeset_lock *lock); |
Line 121... | Line 127... | ||
121 | 127 | ||
- | 128 | struct drm_device; |
|
- | 129 | struct drm_crtc; |
|
- | 130 | struct drm_plane; |
|
- | 131 | ||
- | 132 | void drm_modeset_lock_all(struct drm_device *dev); |
|
- | 133 | int __drm_modeset_lock_all(struct drm_device *dev, bool trylock); |
|
- | 134 | void drm_modeset_unlock_all(struct drm_device *dev); |
|
- | 135 | void drm_modeset_lock_crtc(struct drm_crtc *crtc, |
|
- | 136 | struct drm_plane *plane); |
|
- | 137 | void drm_modeset_unlock_crtc(struct drm_crtc *crtc); |
|
- | 138 | void drm_warn_on_modeset_not_all_locked(struct drm_device *dev); |
|
- | 139 | struct drm_modeset_acquire_ctx * |
|
- | 140 | drm_modeset_legacy_acquire_ctx(struct drm_crtc *crtc); |
|
122 | struct drm_device; |
141 | |
123 | int drm_modeset_lock_all_crtcs(struct drm_device *dev, |
142 | int drm_modeset_lock_all_crtcs(struct drm_device *dev, |
Line 124... | Line 143... | ||
124 | struct drm_modeset_acquire_ctx *ctx); |
143 | struct drm_modeset_acquire_ctx *ctx); |