aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_irq.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2008-12-19 20:23:38 -0500
committerDave Airlie <airlied@linux.ie>2008-12-29 02:47:27 -0500
commitfede5c91c4a8a7701d205b2b84b9835ddc7d6f02 (patch)
treea80b546790a405b5a0b60e843c06b5697c0b2226 /drivers/gpu/drm/drm_irq.c
parentf51c5b6e623cc737d47f513cbb893cec914f0bd2 (diff)
drm: Add a debug node for vblank state.
Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/gpu/drm/drm_irq.c')
-rw-r--r--drivers/gpu/drm/drm_irq.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index 1608f8dbfda0..724e505873cf 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -116,6 +116,9 @@ void drm_vblank_cleanup(struct drm_device *dev)
116 dev->num_crtcs, DRM_MEM_DRIVER); 116 dev->num_crtcs, DRM_MEM_DRIVER);
117 drm_free(dev->last_vblank, sizeof(*dev->last_vblank) * dev->num_crtcs, 117 drm_free(dev->last_vblank, sizeof(*dev->last_vblank) * dev->num_crtcs,
118 DRM_MEM_DRIVER); 118 DRM_MEM_DRIVER);
119 drm_free(dev->last_vblank_wait,
120 sizeof(*dev->last_vblank_wait) * dev->num_crtcs,
121 DRM_MEM_DRIVER);
119 drm_free(dev->vblank_inmodeset, sizeof(*dev->vblank_inmodeset) * 122 drm_free(dev->vblank_inmodeset, sizeof(*dev->vblank_inmodeset) *
120 dev->num_crtcs, DRM_MEM_DRIVER); 123 dev->num_crtcs, DRM_MEM_DRIVER);
121 124
@@ -161,6 +164,11 @@ int drm_vblank_init(struct drm_device *dev, int num_crtcs)
161 if (!dev->last_vblank) 164 if (!dev->last_vblank)
162 goto err; 165 goto err;
163 166
167 dev->last_vblank_wait = drm_calloc(num_crtcs, sizeof(u32),
168 DRM_MEM_DRIVER);
169 if (!dev->last_vblank_wait)
170 goto err;
171
164 dev->vblank_inmodeset = drm_calloc(num_crtcs, sizeof(int), 172 dev->vblank_inmodeset = drm_calloc(num_crtcs, sizeof(int),
165 DRM_MEM_DRIVER); 173 DRM_MEM_DRIVER);
166 if (!dev->vblank_inmodeset) 174 if (!dev->vblank_inmodeset)
@@ -642,6 +650,7 @@ int drm_wait_vblank(struct drm_device *dev, void *data,
642 } else { 650 } else {
643 DRM_DEBUG("waiting on vblank count %d, crtc %d\n", 651 DRM_DEBUG("waiting on vblank count %d, crtc %d\n",
644 vblwait->request.sequence, crtc); 652 vblwait->request.sequence, crtc);
653 dev->last_vblank_wait[crtc] = vblwait->request.sequence;
645 DRM_WAIT_ON(ret, dev->vbl_queue[crtc], 3 * DRM_HZ, 654 DRM_WAIT_ON(ret, dev->vbl_queue[crtc], 3 * DRM_HZ,
646 ((drm_vblank_count(dev, crtc) 655 ((drm_vblank_count(dev, crtc)
647 - vblwait->request.sequence) <= (1 << 23))); 656 - vblwait->request.sequence) <= (1 << 23)));