diff options
author | Michel Dänzer <daenzer@vmware.com> | 2009-08-13 05:10:51 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-08-15 18:36:19 -0400 |
commit | 7ed220d738cf16adff6bc3b31ad25b8848a2fa9c (patch) | |
tree | a751003e7cf1dc63ea478181dffef936f04cc24e /drivers/gpu/drm/radeon/radeon_kms.c | |
parent | 3f8befec95d5c1bbc6e247e1a5dafa82519530f9 (diff) |
drm/radeon/kms: Fix up vertical blank interrupt support.
Fixes 3D apps timing out in the WAIT_VBLANK ioctl.
AVIVO bits compile-tested only.
Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_kms.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_kms.c | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c index 3357110e30ce..d2764bf6b2a2 100644 --- a/drivers/gpu/drm/radeon/radeon_kms.c +++ b/drivers/gpu/drm/radeon/radeon_kms.c | |||
@@ -141,19 +141,42 @@ void radeon_driver_preclose_kms(struct drm_device *dev, | |||
141 | */ | 141 | */ |
142 | u32 radeon_get_vblank_counter_kms(struct drm_device *dev, int crtc) | 142 | u32 radeon_get_vblank_counter_kms(struct drm_device *dev, int crtc) |
143 | { | 143 | { |
144 | /* FIXME: implement */ | 144 | struct radeon_device *rdev = dev->dev_private; |
145 | return 0; | 145 | |
146 | if (crtc < 0 || crtc > 1) { | ||
147 | DRM_ERROR("Invalid crtc %d\n", crtc); | ||
148 | return -EINVAL; | ||
149 | } | ||
150 | |||
151 | return radeon_get_vblank_counter(rdev, crtc); | ||
146 | } | 152 | } |
147 | 153 | ||
148 | int radeon_enable_vblank_kms(struct drm_device *dev, int crtc) | 154 | int radeon_enable_vblank_kms(struct drm_device *dev, int crtc) |
149 | { | 155 | { |
150 | /* FIXME: implement */ | 156 | struct radeon_device *rdev = dev->dev_private; |
151 | return 0; | 157 | |
158 | if (crtc < 0 || crtc > 1) { | ||
159 | DRM_ERROR("Invalid crtc %d\n", crtc); | ||
160 | return -EINVAL; | ||
161 | } | ||
162 | |||
163 | rdev->irq.crtc_vblank_int[crtc] = true; | ||
164 | |||
165 | return radeon_irq_set(rdev); | ||
152 | } | 166 | } |
153 | 167 | ||
154 | void radeon_disable_vblank_kms(struct drm_device *dev, int crtc) | 168 | void radeon_disable_vblank_kms(struct drm_device *dev, int crtc) |
155 | { | 169 | { |
156 | /* FIXME: implement */ | 170 | struct radeon_device *rdev = dev->dev_private; |
171 | |||
172 | if (crtc < 0 || crtc > 1) { | ||
173 | DRM_ERROR("Invalid crtc %d\n", crtc); | ||
174 | return; | ||
175 | } | ||
176 | |||
177 | rdev->irq.crtc_vblank_int[crtc] = false; | ||
178 | |||
179 | radeon_irq_set(rdev); | ||
157 | } | 180 | } |
158 | 181 | ||
159 | 182 | ||