@@ -782,7 +782,7 @@ void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool synchronous
782
782
struct intel_fbdev * ifbdev = dev_priv -> fbdev ;
783
783
struct fb_info * info ;
784
784
785
- if (!ifbdev )
785
+ if (!ifbdev || ! ifbdev -> fb )
786
786
return ;
787
787
788
788
info = ifbdev -> helper .fbdev ;
@@ -827,31 +827,28 @@ void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool synchronous
827
827
828
828
void intel_fbdev_output_poll_changed (struct drm_device * dev )
829
829
{
830
- struct drm_i915_private * dev_priv = to_i915 (dev );
831
- if (dev_priv -> fbdev )
832
- drm_fb_helper_hotplug_event (& dev_priv -> fbdev -> helper );
830
+ struct intel_fbdev * ifbdev = to_i915 (dev )-> fbdev ;
831
+
832
+ if (ifbdev && ifbdev -> fb )
833
+ drm_fb_helper_hotplug_event (& ifbdev -> helper );
833
834
}
834
835
835
836
void intel_fbdev_restore_mode (struct drm_device * dev )
836
837
{
837
- int ret ;
838
- struct drm_i915_private * dev_priv = to_i915 (dev );
839
- struct intel_fbdev * ifbdev = dev_priv -> fbdev ;
840
- struct drm_fb_helper * fb_helper ;
838
+ struct intel_fbdev * ifbdev = to_i915 (dev )-> fbdev ;
841
839
842
840
if (!ifbdev )
843
841
return ;
844
842
845
843
intel_fbdev_sync (ifbdev );
844
+ if (!ifbdev -> fb )
845
+ return ;
846
846
847
- fb_helper = & ifbdev -> helper ;
848
-
849
- ret = drm_fb_helper_restore_fbdev_mode_unlocked (fb_helper );
850
- if (ret ) {
847
+ if (drm_fb_helper_restore_fbdev_mode_unlocked (& ifbdev -> helper )) {
851
848
DRM_DEBUG ("failed to restore crtc mode\n" );
852
849
} else {
853
- mutex_lock (& fb_helper -> dev -> struct_mutex );
850
+ mutex_lock (& dev -> struct_mutex );
854
851
intel_fb_obj_invalidate (ifbdev -> fb -> obj , ORIGIN_GTT );
855
- mutex_unlock (& fb_helper -> dev -> struct_mutex );
852
+ mutex_unlock (& dev -> struct_mutex );
856
853
}
857
854
}
0 commit comments