History

drm/vblank: Use u32 consistently for vblank counters

In commit 99264a61dfcda41d86d0960cf2d4c0fc2758a773 Author: Daniel Vetter <daniel.vetter@ffwll.ch> Date: Wed Apr 15 19:34:43 2015 +0200 drm/vblank: Fixup and document timestamp update/read barriers I've switched vblank->count from atomic_t to unsigned long and accidentally created an integer comparison bug in drm_vblank_count_and_time since vblanke->count might overflow the u32 local copy and hence the retry loop never succeed. Fix this by consistently using u32.

Daniel Vetter committed 11 years ago

Commit 209e4db1 parent 047fe6e2 files · +2 −2Browse files

Unified · Split

2 files
  1. drivers/gpu/drm/drm_irq.c +1 −1
  2. include/drm/drmP.h +1 −1
drivers/gpu/drm/drm_irq.c+1−1
@@ -75,7 +75,7 @@ module_param_named(timestamp_precision_usec, drm_timestamp_precision, int, 0600) · 74 unmodified lines
7575 module_param_named(timestamp_monotonic, drm_timestamp_monotonic, int, 0600);
7676
7777 static void store_vblank(struct drm_device *dev, int crtc,
78− unsigned vblank_count_inc,
78+ u32 vblank_count_inc,
7979 struct timeval *t_vblank)
8080 {
8181 struct drm_vblank_crtc *vblank = &dev->vblank[crtc];
include/drm/drmP.h+1−1
@@ -691,7 +691,7 @@ struct drm_vblank_crtc { · 690 unmodified lines
691691 struct timer_list disable_timer; /* delayed disable timer */
692692
693693 /* vblank counter, protected by dev->vblank_time_lock for writes */
694− unsigned long count;
694+ u32 count;
695695 /* vblank timestamps, protected by dev->vblank_time_lock for writes */
696696 struct timeval time[DRM_VBLANKTIME_RBSIZE];
697697