aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2013-10-04 14:53:36 +0300
committerDave Airlie <airlied@redhat.com>2013-10-09 15:55:31 +1000
commit5380e9293b865d88de04de6e5324726d8c5b53c9 (patch)
tree5d28c8a6a1cf43a3b2a76f16bd9c59a7fd424c39 /include/drm
parentdrm: Make vblank_enabled bool (diff)
downloadlinux-dev-5380e9293b865d88de04de6e5324726d8c5b53c9.tar.xz
linux-dev-5380e9293b865d88de04de6e5324726d8c5b53c9.zip
drm: Collect per-crtc vblank stuff to a struct
drm_vblank_init() is too ugly. Make it a bit easier on the eye by collecting all the per-crtc vblank counters, timestamps etc. to a structure and just allocate an array of those. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/drmP.h26
1 files changed, 16 insertions, 10 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 2d390abbf550..7198febd9d8e 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -1078,6 +1078,19 @@ struct drm_pending_vblank_event {
struct drm_event_vblank event;
};
+struct drm_vblank_crtc {
+ wait_queue_head_t queue; /**< VBLANK wait queue */
+ struct timeval time[DRM_VBLANKTIME_RBSIZE]; /**< timestamp of current count */
+ atomic_t count; /**< number of VBLANK interrupts */
+ atomic_t refcount; /* number of users of vblank interruptsper crtc */
+ u32 last; /* protected by dev->vbl_lock, used */
+ /* for wraparound handling */
+ u32 last_wait; /* Last vblank seqno waited per CRTC */
+ unsigned int inmodeset; /* Display driver is setting mode */
+ bool enabled; /* so we don't call enable more than
+ once per disable */
+};
+
/**
* DRM device structure. This structure represent a complete card that
* may contain multiple heads.
@@ -1153,18 +1166,11 @@ struct drm_device {
*/
bool vblank_disable_allowed;
- wait_queue_head_t *vbl_queue; /**< VBLANK wait queue */
- atomic_t *_vblank_count; /**< number of VBLANK interrupts (driver must alloc the right number of counters) */
- struct timeval *_vblank_time; /**< timestamp of current vblank_count (drivers must alloc right number of fields) */
+ /* array of size num_crtcs */
+ struct drm_vblank_crtc *vblank;
+
spinlock_t vblank_time_lock; /**< Protects vblank count and time updates during vblank enable/disable */
spinlock_t vbl_lock;
- atomic_t *vblank_refcount; /* number of users of vblank interruptsper crtc */
- u32 *last_vblank; /* protected by dev->vbl_lock, used */
- /* for wraparound handling */
- bool *vblank_enabled; /* so we don't call enable more than
- once per disable */
- unsigned int *vblank_inmodeset; /* Display driver is setting mode */
- u32 *last_vblank_wait; /* Last vblank seqno waited per CRTC */
struct timer_list vblank_disable_timer;
u32 max_vblank_count; /**< size of vblank counter register */