|
@@ -120,6 +120,9 @@ static u32 __get_vblank_counter(struct drm_device *dev, unsigned int pipe)
|
|
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
|
|
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
|
|
struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe);
|
|
struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe);
|
|
|
|
|
|
|
|
+ if (WARN_ON(!crtc))
|
|
|
|
+ return 0;
|
|
|
|
+
|
|
if (crtc->funcs->get_vblank_counter)
|
|
if (crtc->funcs->get_vblank_counter)
|
|
return crtc->funcs->get_vblank_counter(crtc);
|
|
return crtc->funcs->get_vblank_counter(crtc);
|
|
}
|
|
}
|
|
@@ -318,6 +321,9 @@ static void __disable_vblank(struct drm_device *dev, unsigned int pipe)
|
|
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
|
|
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
|
|
struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe);
|
|
struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe);
|
|
|
|
|
|
|
|
+ if (WARN_ON(!crtc))
|
|
|
|
+ return;
|
|
|
|
+
|
|
if (crtc->funcs->disable_vblank) {
|
|
if (crtc->funcs->disable_vblank) {
|
|
crtc->funcs->disable_vblank(crtc);
|
|
crtc->funcs->disable_vblank(crtc);
|
|
return;
|
|
return;
|
|
@@ -918,6 +924,9 @@ static int __enable_vblank(struct drm_device *dev, unsigned int pipe)
|
|
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
|
|
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
|
|
struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe);
|
|
struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe);
|
|
|
|
|
|
|
|
+ if (WARN_ON(!crtc))
|
|
|
|
+ return 0;
|
|
|
|
+
|
|
if (crtc->funcs->enable_vblank)
|
|
if (crtc->funcs->enable_vblank)
|
|
return crtc->funcs->enable_vblank(crtc);
|
|
return crtc->funcs->enable_vblank(crtc);
|
|
}
|
|
}
|