Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 233590
b: refs/heads/master
c: bc21512
h: refs/heads/master
v: v3
  • Loading branch information
Mario Kleiner authored and Dave Airlie committed Feb 23, 2011
1 parent 7d0963d commit 9a7d121
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c4cc383915549cf14f027f374904e30c13653dac
refs/heads/master: bc21512835a72bc1eab7abd7d8a1bff0435591d7
10 changes: 7 additions & 3 deletions trunk/drivers/gpu/drm/drm_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,10 @@ static void vblank_disable_and_save(struct drm_device *dev, int crtc)
* available. In that case we can't account for this and just
* hope for the best.
*/
if ((vblrc > 0) && (abs64(diff_ns) > 1000000))
if ((vblrc > 0) && (abs64(diff_ns) > 1000000)) {
atomic_inc(&dev->_vblank_count[crtc]);
smp_mb__after_atomic_inc();
}

/* Invalidate all timestamps while vblank irq's are off. */
clear_vblank_timestamps(dev, crtc);
Expand Down Expand Up @@ -858,10 +860,11 @@ static void drm_update_vblank_count(struct drm_device *dev, int crtc)
if (rc) {
tslot = atomic_read(&dev->_vblank_count[crtc]) + diff;
vblanktimestamp(dev, crtc, tslot) = t_vblank;
smp_wmb();
}

smp_mb__before_atomic_inc();
atomic_add(diff, &dev->_vblank_count[crtc]);
smp_mb__after_atomic_inc();
}

/**
Expand Down Expand Up @@ -1296,12 +1299,13 @@ bool drm_handle_vblank(struct drm_device *dev, int crtc)
if (abs64(diff_ns) > DRM_REDUNDANT_VBLIRQ_THRESH_NS) {
/* Store new timestamp in ringbuffer. */
vblanktimestamp(dev, crtc, vblcount + 1) = tvblank;
smp_wmb();

/* Increment cooked vblank count. This also atomically commits
* the timestamp computed above.
*/
smp_mb__before_atomic_inc();
atomic_inc(&dev->_vblank_count[crtc]);
smp_mb__after_atomic_inc();
} else {
DRM_DEBUG("crtc %d: Redundant vblirq ignored. diff_ns = %d\n",
crtc, (int) diff_ns);
Expand Down

0 comments on commit 9a7d121

Please sign in to comment.