|
35 | 35 | #include <drm/drm_rect.h>
|
36 | 36 | #include <drm/drm_atomic.h>
|
37 | 37 | #include <drm/drm_plane_helper.h>
|
| 38 | +#include <linux/locallock.h> |
38 | 39 | #include "intel_drv.h"
|
39 | 40 | #include "intel_frontbuffer.h"
|
40 | 41 | #include <drm/i915_drm.h>
|
@@ -65,6 +66,8 @@ int intel_usecs_to_scanlines(const struct drm_display_mode *adjusted_mode,
|
65 | 66 | 1000 * adjusted_mode->crtc_htotal);
|
66 | 67 | }
|
67 | 68 |
|
| 69 | +static DEFINE_LOCAL_IRQ_LOCK(pipe_update_lock); |
| 70 | + |
68 | 71 | /**
|
69 | 72 | * intel_pipe_update_start() - start update of a set of display registers
|
70 | 73 | * @crtc: the crtc of which the registers are going to be updated
|
@@ -98,7 +101,7 @@ void intel_pipe_update_start(struct intel_crtc *crtc)
|
98 | 101 | min = vblank_start - intel_usecs_to_scanlines(adjusted_mode, 100);
|
99 | 102 | max = vblank_start - 1;
|
100 | 103 |
|
101 |
| - local_irq_disable(); |
| 104 | + local_lock_irq(pipe_update_lock); |
102 | 105 |
|
103 | 106 | if (min <= 0 || max <= 0)
|
104 | 107 | return;
|
@@ -128,11 +131,11 @@ void intel_pipe_update_start(struct intel_crtc *crtc)
|
128 | 131 | break;
|
129 | 132 | }
|
130 | 133 |
|
131 |
| - local_irq_enable(); |
| 134 | + local_unlock_irq(pipe_update_lock); |
132 | 135 |
|
133 | 136 | timeout = schedule_timeout(timeout);
|
134 | 137 |
|
135 |
| - local_irq_disable(); |
| 138 | + local_lock_irq(pipe_update_lock); |
136 | 139 | }
|
137 | 140 |
|
138 | 141 | finish_wait(wq, &wait);
|
@@ -202,7 +205,7 @@ void intel_pipe_update_end(struct intel_crtc *crtc, struct intel_flip_work *work
|
202 | 205 | crtc->base.state->event = NULL;
|
203 | 206 | }
|
204 | 207 |
|
205 |
| - local_irq_enable(); |
| 208 | + local_unlock_irq(pipe_update_lock); |
206 | 209 |
|
207 | 210 | if (crtc->debug.start_vbl_count &&
|
208 | 211 | crtc->debug.start_vbl_count != end_vbl_count) {
|
|
0 commit comments