Rev 6088 | Rev 6660 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6088 | Rev 6103 | ||
---|---|---|---|
Line 83... | Line 83... | ||
83 | struct drm_device *dev = crtc->base.dev; |
83 | struct drm_device *dev = crtc->base.dev; |
84 | const struct drm_display_mode *adjusted_mode = &crtc->config->base.adjusted_mode; |
84 | const struct drm_display_mode *adjusted_mode = &crtc->config->base.adjusted_mode; |
85 | enum pipe pipe = crtc->pipe; |
85 | enum pipe pipe = crtc->pipe; |
86 | long timeout = msecs_to_jiffies_timeout(1); |
86 | long timeout = msecs_to_jiffies_timeout(1); |
87 | int scanline, min, max, vblank_start; |
87 | int scanline, min, max, vblank_start; |
88 | #if 0 |
- | |
89 | // wait_queue_head_t *wq = drm_crtc_vblank_waitqueue(&crtc->base); |
88 | wait_queue_head_t *wq = drm_crtc_vblank_waitqueue(&crtc->base); |
90 | // DEFINE_WAIT(wait); |
89 | DEFINE_WAIT(wait); |
Line 91... | Line 90... | ||
91 | 90 | ||
92 | vblank_start = adjusted_mode->crtc_vblank_start; |
91 | vblank_start = adjusted_mode->crtc_vblank_start; |
93 | if (adjusted_mode->flags & DRM_MODE_FLAG_INTERLACE) |
92 | if (adjusted_mode->flags & DRM_MODE_FLAG_INTERLACE) |
Line 94... | Line 93... | ||
94 | vblank_start = DIV_ROUND_UP(vblank_start, 2); |
93 | vblank_start = DIV_ROUND_UP(vblank_start, 2); |
95 | 94 | ||
96 | /* FIXME needs to be calibrated sensibly */ |
95 | /* FIXME needs to be calibrated sensibly */ |
Line -... | Line 96... | ||
- | 96 | min = vblank_start - usecs_to_scanlines(adjusted_mode, 100); |
|
- | 97 | max = vblank_start - 1; |
|
97 | min = vblank_start - usecs_to_scanlines(adjusted_mode, 100); |
98 | |
98 | max = vblank_start - 1; |
99 | local_irq_disable(); |
Line 99... | Line 100... | ||
99 | 100 | ||
100 | if (min <= 0 || max <= 0) |
101 | if (min <= 0 || max <= 0) |
Line 101... | Line 102... | ||
101 | return; |
102 | return; |
102 | 103 | ||
103 | // if (WARN_ON(drm_vblank_get(dev, pipe))) |
104 | if (WARN_ON(drm_crtc_vblank_get(&crtc->base))) |
Line 123... | Line 124... | ||
123 | DRM_ERROR("Potential atomic update failure on pipe %c\n", |
124 | DRM_ERROR("Potential atomic update failure on pipe %c\n", |
124 | pipe_name(crtc->pipe)); |
125 | pipe_name(crtc->pipe)); |
125 | break; |
126 | break; |
126 | } |
127 | } |
Line 127... | Line 128... | ||
127 | 128 | ||
Line -... | Line 129... | ||
- | 129 | local_irq_enable(); |
|
- | 130 | ||
- | 131 | { |
|
128 | // local_irq_enable(); |
132 | unsigned long expire; |
- | 133 | expire = timeout + jiffies; |
|
129 | 134 | WaitEventTimeout(wait.evnt, timeout);; |
|
- | 135 | timeout = expire - jiffies; |
|
130 | schedule_timeout(timeout); |
136 | timeout = timeout < 0 ? 0 : timeout; |
131 | timeout = 0; |
137 | } |
Line 132... | Line 138... | ||
132 | // local_irq_disable(); |
138 | local_irq_disable(); |
133 | } |
139 | } |
- | 140 | ||
Line 134... | Line 141... | ||
134 | 141 | finish_wait(wq, &wait); |
|
135 | finish_wait(wq, &wait); |
142 | |
136 | #endif |
143 | drm_crtc_vblank_put(&crtc->base); |
137 | 144 | ||
Line 160... | Line 167... | ||
160 | u32 end_vbl_count = dev->driver->get_vblank_counter(dev, pipe); |
167 | u32 end_vbl_count = dev->driver->get_vblank_counter(dev, pipe); |
161 | ktime_t end_vbl_time = ktime_get(); |
168 | ktime_t end_vbl_time = ktime_get(); |
Line 162... | Line 169... | ||
162 | 169 | ||
Line 163... | Line 170... | ||
163 | trace_i915_pipe_update_end(crtc, end_vbl_count, scanline_end); |
170 | trace_i915_pipe_update_end(crtc, end_vbl_count, scanline_end); |
Line 164... | Line 171... | ||
164 | 171 | ||
165 | // local_irq_enable(); |
172 | local_irq_enable(); |
166 | 173 | ||
167 | if (crtc->debug.start_vbl_count && |
174 | if (crtc->debug.start_vbl_count && |