drm/radeon: restore the fbdev mode in lastclose
Subsystems (2)
PATCH 1/2 drm/radeon: restore the fbdev mode in lastclose
restore the fbdev state if a drm app like X is killed.
Signed-off-by Alex Deucher <[email protected]>
--- drivers/gpu/drm/radeon/radeon_fb.c | 16 ++++++++++++++++ drivers/gpu/drm/radeon/radeon_kms.c | 5 ++++- drivers/gpu/drm/radeon/radeon_mode.h | 1 + 3 files changed, 21 insertions(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_fb.c +16 -0
@@ -397,3 +397,19 @@ void radeon_fb_remove_connector(struct radeon_device *rdev, struct drm_connector {drm_fb_helper_remove_one_connector (&rdev->mode_info.rfbdev->helper, connector); } + +void radeon_fbdev_restore_mode (struct radeon_device *rdev) +{ +struct radeon_fbdev *rfbdev = rdev->mode_info.rfbdev; +struct drm_fb_helper *fb_helper; +int ret; + +if (!rfbdev) +return ; + + fb_helper = &rfbdev->helper; + + ret =drm_fb_helper_restore_fbdev_mode_unlocked (fb_helper); +if (ret) +DRM_DEBUG ("failed to restore crtc mode\n" ); +}
drivers/gpu/drm/radeon/radeon_kms.c +4 -1
@@ -598,7 +598,7 @@ static int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file* Outdated mess for old drm with Xorg being in charge (void function now). */ /** -* radeon_driver_firstopen_kms - drm callback for last close +* radeon_driver_lastclose_kms - drm callback for last close * * @dev: drm dev pointer *
@@ -606,6 +606,9 @@ static int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file*/ void radeon_driver_lastclose_kms (struct drm_device *dev) { +struct radeon_device *rdev = dev->dev_private; + +radeon_fbdev_restore_mode (rdev);vga_switcheroo_process_delayed_switch (); }
drivers/gpu/drm/radeon/radeon_mode.h +1 -0
@@ -980,6 +980,7 @@ int radeon_fbdev_init(struct radeon_device *rdev);void radeon_fbdev_fini (struct radeon_device *rdev);void radeon_fbdev_set_suspend (struct radeon_device *rdev,int state);bool radeon_fbdev_robj_is_fb (struct radeon_device *rdev,struct radeon_bo *robj); +void radeon_fbdev_restore_mode (struct radeon_device *rdev);void radeon_fb_output_poll_changed (struct radeon_device *rdev);
Signature · 6 lines
1.8.3.1 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/2 drm/amdgpu: restore the fbdev mode in lastclose
restore the fbdev state if a drm app like X is killed.
Signed-off-by Alex Deucher <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 16 ++++++++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 5 ++++- drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | 1 + 3 files changed, 21 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +16 -0
@@ -402,3 +402,19 @@ bool amdgpu_fbdev_robj_is_fb(struct amdgpu_device *adev, struct amdgpu_bo *robj)return true;return false; } + +void amdgpu_fbdev_restore_mode (struct amdgpu_device *adev) +{ +struct amdgpu_fbdev *afbdev = adev->mode_info.rfbdev; +struct drm_fb_helper *fb_helper; +int ret; + +if (!afbdev) +return ; + + fb_helper = &afbdev->helper; + + ret =drm_fb_helper_restore_fbdev_mode_unlocked (fb_helper); +if (ret) +DRM_DEBUG ("failed to restore crtc mode\n" ); +}
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +4 -1
@@ -485,7 +485,7 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file* Outdated mess for old drm with Xorg being in charge (void function now). */ /** -* amdgpu_driver_firstopen_kms - drm callback for last close +* amdgpu_driver_lastclose_kms - drm callback for last close * * @dev: drm dev pointer *
@@ -493,6 +493,9 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file*/ void amdgpu_driver_lastclose_kms (struct drm_device *dev) { +struct amdgpu_device *adev = dev->dev_private; + +amdgpu_fbdev_restore_mode (adev);vga_switcheroo_process_delayed_switch (); }
drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h +1 -0
@@ -567,6 +567,7 @@ void amdgpu_fbdev_fini(struct amdgpu_device *adev);void amdgpu_fbdev_set_suspend (struct amdgpu_device *adev,int state);int amdgpu_fbdev_total_size (struct amdgpu_device *adev);bool amdgpu_fbdev_robj_is_fb (struct amdgpu_device *adev,struct amdgpu_bo *robj); +void amdgpu_fbdev_restore_mode (struct amdgpu_device *adev);void amdgpu_fb_output_poll_changed (struct amdgpu_device *adev);
Signature · 6 lines
1.8.3.1 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 3 lines · Alex Deucher
restore the fbdev state if a drm app like X is killed.
Signed-off-by Alex Deucher <[email protected]>
This patch is
Tested-by Michel Dänzer <[email protected]>
Both patches are
Reviewed-by Michel Dänzer <[email protected]>
Signature · 6 lines
Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 13 lines · Michel Dänzer
Quoted 3 lines · Alex Deucher
restore the fbdev state if a drm app like X is killed.
Signed-off-by Alex Deucher <[email protected]>This patch is
Tested-by Michel Dänzer <[email protected]>Both patches are
Reviewed-by Michel Dänzer <[email protected]>
For both Reviewed-by: Christian König <[email protected]>
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel