Rev 2344 | Rev 2352 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2344 | Rev 2351 | ||
---|---|---|---|
Line 31... | Line 31... | ||
31 | 31 | ||
32 | #include "drmP.h" |
32 | #include "drmP.h" |
33 | #include "drm.h" |
33 | #include "drm.h" |
34 | #include "i915_drv.h" |
34 | #include "i915_drv.h" |
35 | #include "i915_drm.h" |
35 | #include "i915_drm.h" |
36 | //#include "i915_trace.h" |
36 | #include "i915_trace.h" |
Line 37... | Line 37... | ||
37 | #include "intel_drv.h" |
37 | #include "intel_drv.h" |
38 | 38 | ||
39 | /* |
39 | /* |
Line 1137... | Line 1137... | ||
1137 | struct drm_device *dev = ring->dev; |
1137 | struct drm_device *dev = ring->dev; |
1138 | struct drm_i915_private *dev_priv = dev->dev_private; |
1138 | struct drm_i915_private *dev_priv = dev->dev_private; |
1139 | unsigned long end; |
1139 | unsigned long end; |
1140 | u32 head; |
1140 | u32 head; |
Line 1141... | Line -... | ||
1141 | - | ||
1142 | ENTER(); |
- | |
1143 | 1141 | ||
1144 | /* If the reported head position has wrapped or hasn't advanced, |
1142 | /* If the reported head position has wrapped or hasn't advanced, |
1145 | * fallback to the slow and accurate path. |
1143 | * fallback to the slow and accurate path. |
1146 | */ |
1144 | */ |
1147 | head = intel_read_status_page(ring, 4); |
1145 | head = intel_read_status_page(ring, 4); |
1148 | if (head > ring->head) { |
1146 | if (head > ring->head) { |
1149 | ring->head = head; |
1147 | ring->head = head; |
1150 | ring->space = ring_space(ring); |
1148 | ring->space = ring_space(ring); |
1151 | if (ring->space >= n) |
- | |
1152 | { |
- | |
1153 | LEAVE(); |
1149 | if (ring->space >= n) |
1154 | return 0; |
- | |
1155 | }; |
1150 | return 0; |
Line 1156... | Line 1151... | ||
1156 | } |
1151 | } |
1157 | 1152 | ||
1158 | 1153 | ||
1159 | end = jiffies + 3 * HZ; |
1154 | end = jiffies + 3 * HZ; |
1160 | do { |
1155 | do { |
1161 | ring->head = I915_READ_HEAD(ring); |
1156 | ring->head = I915_READ_HEAD(ring); |
1162 | ring->space = ring_space(ring); |
- | |
1163 | if (ring->space >= n) { |
1157 | ring->space = ring_space(ring); |
1164 | // trace_i915_ring_wait_end(ring); |
1158 | if (ring->space >= n) { |
Line 1165... | Line 1159... | ||
1165 | LEAVE(); |
1159 | trace_i915_ring_wait_end(ring); |
1166 | return 0; |
1160 | return 0; |
1167 | } |
- | |
1168 | - | ||
1169 | msleep(1); |
1161 | } |
1170 | if (atomic_read(&dev_priv->mm.wedged)) |
- | |
1171 | { |
1162 | |
1172 | LEAVE(); |
1163 | msleep(1); |
1173 | return -EAGAIN; |
- | |
1174 | }; |
1164 | if (atomic_read(&dev_priv->mm.wedged)) |
1175 | } while (!time_after(jiffies, end)); |
1165 | return -EAGAIN; |
Line 1176... | Line 1166... | ||
1176 | LEAVE(); |
1166 | } while (!time_after(jiffies, end)); |
1177 | 1167 | trace_i915_ring_wait_end(ring); |