aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_fb_helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/drm_fb_helper.c')
-rw-r--r--drivers/gpu/drm/drm_fb_helper.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 95072047396..11d7a72c22d 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -342,9 +342,22 @@ int drm_fb_helper_debug_leave(struct fb_info *info)
342} 342}
343EXPORT_SYMBOL(drm_fb_helper_debug_leave); 343EXPORT_SYMBOL(drm_fb_helper_debug_leave);
344 344
345bool drm_fb_helper_restore_fbdev_mode(struct drm_fb_helper *fb_helper)
346{
347 bool error = false;
348 int i, ret;
349 for (i = 0; i < fb_helper->crtc_count; i++) {
350 struct drm_mode_set *mode_set = &fb_helper->crtc_info[i].mode_set;
351 ret = drm_crtc_helper_set_config(mode_set);
352 if (ret)
353 error = true;
354 }
355 return error;
356}
357EXPORT_SYMBOL(drm_fb_helper_restore_fbdev_mode);
358
345bool drm_fb_helper_force_kernel_mode(void) 359bool drm_fb_helper_force_kernel_mode(void)
346{ 360{
347 int i = 0;
348 bool ret, error = false; 361 bool ret, error = false;
349 struct drm_fb_helper *helper; 362 struct drm_fb_helper *helper;
350 363
@@ -352,12 +365,12 @@ bool drm_fb_helper_force_kernel_mode(void)
352 return false; 365 return false;
353 366
354 list_for_each_entry(helper, &kernel_fb_helper_list, kernel_fb_list) { 367 list_for_each_entry(helper, &kernel_fb_helper_list, kernel_fb_list) {
355 for (i = 0; i < helper->crtc_count; i++) { 368 if (helper->dev->switch_power_state == DRM_SWITCH_POWER_OFF)
356 struct drm_mode_set *mode_set = &helper->crtc_info[i].mode_set; 369 continue;
357 ret = drm_crtc_helper_set_config(mode_set); 370
358 if (ret) 371 ret = drm_fb_helper_restore_fbdev_mode(helper);
359 error = true; 372 if (ret)
360 } 373 error = true;
361 } 374 }
362 return error; 375 return error;
363} 376}