diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2015-10-02 16:52:58 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-10-05 09:44:18 -0400 |
commit | 8c70e1cda04b966b50ddfefafbd0ea376ed8edd5 (patch) | |
tree | 0195f9f7dac3b76941432feb2b857a5f9e32e715 | |
parent | 2b02ec79004388a8c65e227bc289ed891b5ac8c6 (diff) |
drm/radeon: restore the fbdev mode in lastclose
restore the fbdev state if a drm app like X is killed.
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_fb.c | 16 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_kms.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_mode.h | 1 |
3 files changed, 21 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_fb.c b/drivers/gpu/drm/radeon/radeon_fb.c index 1aa657fe31cb..26da2f4d7b4f 100644 --- a/drivers/gpu/drm/radeon/radeon_fb.c +++ b/drivers/gpu/drm/radeon/radeon_fb.c | |||
@@ -397,3 +397,19 @@ void radeon_fb_remove_connector(struct radeon_device *rdev, struct drm_connector | |||
397 | { | 397 | { |
398 | drm_fb_helper_remove_one_connector(&rdev->mode_info.rfbdev->helper, connector); | 398 | drm_fb_helper_remove_one_connector(&rdev->mode_info.rfbdev->helper, connector); |
399 | } | 399 | } |
400 | |||
401 | void radeon_fbdev_restore_mode(struct radeon_device *rdev) | ||
402 | { | ||
403 | struct radeon_fbdev *rfbdev = rdev->mode_info.rfbdev; | ||
404 | struct drm_fb_helper *fb_helper; | ||
405 | int ret; | ||
406 | |||
407 | if (!rfbdev) | ||
408 | return; | ||
409 | |||
410 | fb_helper = &rfbdev->helper; | ||
411 | |||
412 | ret = drm_fb_helper_restore_fbdev_mode_unlocked(fb_helper); | ||
413 | if (ret) | ||
414 | DRM_DEBUG("failed to restore crtc mode\n"); | ||
415 | } | ||
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c index 4a119c255ba9..0e932bf932c1 100644 --- a/drivers/gpu/drm/radeon/radeon_kms.c +++ b/drivers/gpu/drm/radeon/radeon_kms.c | |||
@@ -598,7 +598,7 @@ static int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file | |||
598 | * Outdated mess for old drm with Xorg being in charge (void function now). | 598 | * Outdated mess for old drm with Xorg being in charge (void function now). |
599 | */ | 599 | */ |
600 | /** | 600 | /** |
601 | * radeon_driver_firstopen_kms - drm callback for last close | 601 | * radeon_driver_lastclose_kms - drm callback for last close |
602 | * | 602 | * |
603 | * @dev: drm dev pointer | 603 | * @dev: drm dev pointer |
604 | * | 604 | * |
@@ -606,6 +606,9 @@ static int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file | |||
606 | */ | 606 | */ |
607 | void radeon_driver_lastclose_kms(struct drm_device *dev) | 607 | void radeon_driver_lastclose_kms(struct drm_device *dev) |
608 | { | 608 | { |
609 | struct radeon_device *rdev = dev->dev_private; | ||
610 | |||
611 | radeon_fbdev_restore_mode(rdev); | ||
609 | vga_switcheroo_process_delayed_switch(); | 612 | vga_switcheroo_process_delayed_switch(); |
610 | } | 613 | } |
611 | 614 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_mode.h b/drivers/gpu/drm/radeon/radeon_mode.h index aecc3e3dec0c..457b026a0972 100644 --- a/drivers/gpu/drm/radeon/radeon_mode.h +++ b/drivers/gpu/drm/radeon/radeon_mode.h | |||
@@ -980,6 +980,7 @@ int radeon_fbdev_init(struct radeon_device *rdev); | |||
980 | void radeon_fbdev_fini(struct radeon_device *rdev); | 980 | void radeon_fbdev_fini(struct radeon_device *rdev); |
981 | void radeon_fbdev_set_suspend(struct radeon_device *rdev, int state); | 981 | void radeon_fbdev_set_suspend(struct radeon_device *rdev, int state); |
982 | bool radeon_fbdev_robj_is_fb(struct radeon_device *rdev, struct radeon_bo *robj); | 982 | bool radeon_fbdev_robj_is_fb(struct radeon_device *rdev, struct radeon_bo *robj); |
983 | void radeon_fbdev_restore_mode(struct radeon_device *rdev); | ||
983 | 984 | ||
984 | void radeon_fb_output_poll_changed(struct radeon_device *rdev); | 985 | void radeon_fb_output_poll_changed(struct radeon_device *rdev); |
985 | 986 | ||