diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2013-10-04 07:53:36 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2013-10-09 01:55:31 -0400 |
commit | 5380e9293b865d88de04de6e5324726d8c5b53c9 (patch) | |
tree | 5d28c8a6a1cf43a3b2a76f16bd9c59a7fd424c39 /include/drm | |
parent | bf507d90cf0eecf5495f66f21dbb66e35e9131ae (diff) |
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.h | 26 |
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 { | |||
1078 | struct drm_event_vblank event; | 1078 | struct drm_event_vblank event; |
1079 | }; | 1079 | }; |
1080 | 1080 | ||
1081 | struct drm_vblank_crtc { | ||
1082 | wait_queue_head_t queue; /**< VBLANK wait queue */ | ||
1083 | struct timeval time[DRM_VBLANKTIME_RBSIZE]; /**< timestamp of current count */ | ||
1084 | atomic_t count; /**< number of VBLANK interrupts */ | ||
1085 | atomic_t refcount; /* number of users of vblank interruptsper crtc */ | ||
1086 | u32 last; /* protected by dev->vbl_lock, used */ | ||
1087 | /* for wraparound handling */ | ||
1088 | u32 last_wait; /* Last vblank seqno waited per CRTC */ | ||
1089 | unsigned int inmodeset; /* Display driver is setting mode */ | ||
1090 | bool enabled; /* so we don't call enable more than | ||
1091 | once per disable */ | ||
1092 | }; | ||
1093 | |||
1081 | /** | 1094 | /** |
1082 | * DRM device structure. This structure represent a complete card that | 1095 | * DRM device structure. This structure represent a complete card that |
1083 | * may contain multiple heads. | 1096 | * may contain multiple heads. |
@@ -1153,18 +1166,11 @@ struct drm_device { | |||
1153 | */ | 1166 | */ |
1154 | bool vblank_disable_allowed; | 1167 | bool vblank_disable_allowed; |
1155 | 1168 | ||
1156 | wait_queue_head_t *vbl_queue; /**< VBLANK wait queue */ | 1169 | /* array of size num_crtcs */ |
1157 | atomic_t *_vblank_count; /**< number of VBLANK interrupts (driver must alloc the right number of counters) */ | 1170 | struct drm_vblank_crtc *vblank; |
1158 | struct timeval *_vblank_time; /**< timestamp of current vblank_count (drivers must alloc right number of fields) */ | 1171 | |
1159 | spinlock_t vblank_time_lock; /**< Protects vblank count and time updates during vblank enable/disable */ | 1172 | spinlock_t vblank_time_lock; /**< Protects vblank count and time updates during vblank enable/disable */ |
1160 | spinlock_t vbl_lock; | 1173 | spinlock_t vbl_lock; |
1161 | atomic_t *vblank_refcount; /* number of users of vblank interruptsper crtc */ | ||
1162 | u32 *last_vblank; /* protected by dev->vbl_lock, used */ | ||
1163 | /* for wraparound handling */ | ||
1164 | bool *vblank_enabled; /* so we don't call enable more than | ||
1165 | once per disable */ | ||
1166 | unsigned int *vblank_inmodeset; /* Display driver is setting mode */ | ||
1167 | u32 *last_vblank_wait; /* Last vblank seqno waited per CRTC */ | ||
1168 | struct timer_list vblank_disable_timer; | 1174 | struct timer_list vblank_disable_timer; |
1169 | 1175 | ||
1170 | u32 max_vblank_count; /**< size of vblank counter register */ | 1176 | u32 max_vblank_count; /**< size of vblank counter register */ |