aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_irq.c
diff options
context:
space:
mode:
authorJerome Glisse <jglisse@redhat.com>2010-01-07 15:39:13 +0100
committerDave Airlie <airlied@redhat.com>2010-01-08 13:12:09 +1000
commite77cef9c2d87db835ad9d70cde4a9b00b0ca2262 (patch)
tree27336938ecaeed58acb4218310f6b3dd516b5f26 /drivers/gpu/drm/drm_irq.c
parent059d233f9c1183ed2f59d631e4daf486060e880d (diff)
downloadkernel_goldelico_gta04-e77cef9c2d87db835ad9d70cde4a9b00b0ca2262.zip
kernel_goldelico_gta04-e77cef9c2d87db835ad9d70cde4a9b00b0ca2262.tar.gz
kernel_goldelico_gta04-e77cef9c2d87db835ad9d70cde4a9b00b0ca2262.tar.bz2
drm: Avoid calling vblank function is vblank wasn't initialized
In some case vblank might not be initialized and we shouldn't try to use associated function. This patch make sure this is the case. It also export drm_vblank_cleanup so driver can cleanup vblank if for any reason IRQ/MSI is not working. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_irq.c')
-rw-r--r--drivers/gpu/drm/drm_irq.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index 7998ee6..b98384d 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -115,6 +115,7 @@ void drm_vblank_cleanup(struct drm_device *dev)
dev->num_crtcs = 0;
}
+EXPORT_SYMBOL(drm_vblank_cleanup);
int drm_vblank_init(struct drm_device *dev, int num_crtcs)
{
@@ -163,7 +164,6 @@ int drm_vblank_init(struct drm_device *dev, int num_crtcs)
}
dev->vblank_disable_allowed = 0;
-
return 0;
err:
@@ -493,6 +493,9 @@ EXPORT_SYMBOL(drm_vblank_off);
*/
void drm_vblank_pre_modeset(struct drm_device *dev, int crtc)
{
+ /* vblank is not initialized (IRQ not installed ?) */
+ if (!dev->num_crtcs)
+ return;
/*
* To avoid all the problems that might happen if interrupts
* were enabled/disabled around or between these calls, we just