mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-23 12:43:55 +08:00
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>
This commit is contained in:
parent
059d233f9c
commit
e77cef9c2d
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user