diff options
Diffstat (limited to 'drivers/gpu/drm/amd')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 9 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_display.h | 1 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 27 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 4 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | 4 |
5 files changed, 3 insertions, 42 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c index 138beb550a58..38d47559f098 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | |||
| @@ -34,6 +34,7 @@ | |||
| 34 | #include <linux/pm_runtime.h> | 34 | #include <linux/pm_runtime.h> |
| 35 | #include <drm/drm_crtc_helper.h> | 35 | #include <drm/drm_crtc_helper.h> |
| 36 | #include <drm/drm_edid.h> | 36 | #include <drm/drm_edid.h> |
| 37 | #include <drm/drm_fb_helper.h> | ||
| 37 | 38 | ||
| 38 | static void amdgpu_flip_callback(struct dma_fence *f, struct dma_fence_cb *cb) | 39 | static void amdgpu_flip_callback(struct dma_fence *f, struct dma_fence_cb *cb) |
| 39 | { | 40 | { |
| @@ -556,15 +557,9 @@ amdgpu_user_framebuffer_create(struct drm_device *dev, | |||
| 556 | return &amdgpu_fb->base; | 557 | return &amdgpu_fb->base; |
| 557 | } | 558 | } |
| 558 | 559 | ||
| 559 | void amdgpu_output_poll_changed(struct drm_device *dev) | ||
| 560 | { | ||
| 561 | struct amdgpu_device *adev = dev->dev_private; | ||
| 562 | amdgpu_fb_output_poll_changed(adev); | ||
| 563 | } | ||
| 564 | |||
| 565 | const struct drm_mode_config_funcs amdgpu_mode_funcs = { | 560 | const struct drm_mode_config_funcs amdgpu_mode_funcs = { |
| 566 | .fb_create = amdgpu_user_framebuffer_create, | 561 | .fb_create = amdgpu_user_framebuffer_create, |
| 567 | .output_poll_changed = amdgpu_output_poll_changed | 562 | .output_poll_changed = drm_fb_helper_output_poll_changed, |
| 568 | }; | 563 | }; |
| 569 | 564 | ||
| 570 | static const struct drm_prop_enum_list amdgpu_underscan_enum_list[] = | 565 | static const struct drm_prop_enum_list amdgpu_underscan_enum_list[] = |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.h index 11ae4ab23768..0bcb6c6e0ca9 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.h | |||
| @@ -27,6 +27,5 @@ struct drm_framebuffer * | |||
| 27 | amdgpu_user_framebuffer_create(struct drm_device *dev, | 27 | amdgpu_user_framebuffer_create(struct drm_device *dev, |
| 28 | struct drm_file *file_priv, | 28 | struct drm_file *file_priv, |
| 29 | const struct drm_mode_fb_cmd2 *mode_cmd); | 29 | const struct drm_mode_fb_cmd2 *mode_cmd); |
| 30 | void amdgpu_output_poll_changed(struct drm_device *dev); | ||
| 31 | 30 | ||
| 32 | #endif | 31 | #endif |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c index 90fa8e8bc6fb..ff3e9beb7d19 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | |||
| @@ -283,12 +283,6 @@ out: | |||
| 283 | return ret; | 283 | return ret; |
| 284 | } | 284 | } |
| 285 | 285 | ||
| 286 | void amdgpu_fb_output_poll_changed(struct amdgpu_device *adev) | ||
| 287 | { | ||
| 288 | if (adev->mode_info.rfbdev) | ||
| 289 | drm_fb_helper_hotplug_event(&adev->mode_info.rfbdev->helper); | ||
| 290 | } | ||
| 291 | |||
| 292 | static int amdgpu_fbdev_destroy(struct drm_device *dev, struct amdgpu_fbdev *rfbdev) | 286 | static int amdgpu_fbdev_destroy(struct drm_device *dev, struct amdgpu_fbdev *rfbdev) |
| 293 | { | 287 | { |
| 294 | struct amdgpu_framebuffer *rfb = &rfbdev->rfb; | 288 | struct amdgpu_framebuffer *rfb = &rfbdev->rfb; |
| @@ -393,24 +387,3 @@ bool amdgpu_fbdev_robj_is_fb(struct amdgpu_device *adev, struct amdgpu_bo *robj) | |||
| 393 | return true; | 387 | return true; |
| 394 | return false; | 388 | return false; |
| 395 | } | 389 | } |
| 396 | |||
| 397 | void amdgpu_fbdev_restore_mode(struct amdgpu_device *adev) | ||
| 398 | { | ||
| 399 | struct amdgpu_fbdev *afbdev; | ||
| 400 | struct drm_fb_helper *fb_helper; | ||
| 401 | int ret; | ||
| 402 | |||
| 403 | if (!adev) | ||
| 404 | return; | ||
| 405 | |||
| 406 | afbdev = adev->mode_info.rfbdev; | ||
| 407 | |||
| 408 | if (!afbdev) | ||
| 409 | return; | ||
| 410 | |||
| 411 | fb_helper = &afbdev->helper; | ||
| 412 | |||
| 413 | ret = drm_fb_helper_restore_fbdev_mode_unlocked(fb_helper); | ||
| 414 | if (ret) | ||
| 415 | DRM_DEBUG("failed to restore crtc mode\n"); | ||
| 416 | } | ||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c index 3222e1d4636c..bd6e9a40f421 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | |||
| @@ -788,9 +788,7 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file | |||
| 788 | */ | 788 | */ |
| 789 | void amdgpu_driver_lastclose_kms(struct drm_device *dev) | 789 | void amdgpu_driver_lastclose_kms(struct drm_device *dev) |
| 790 | { | 790 | { |
| 791 | struct amdgpu_device *adev = dev->dev_private; | 791 | drm_fb_helper_lastclose(dev); |
| 792 | |||
| 793 | amdgpu_fbdev_restore_mode(adev); | ||
| 794 | vga_switcheroo_process_delayed_switch(); | 792 | vga_switcheroo_process_delayed_switch(); |
| 795 | } | 793 | } |
| 796 | 794 | ||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h index 126b8b068b7a..54f06c959340 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | |||
| @@ -658,10 +658,6 @@ void amdgpu_fbdev_fini(struct amdgpu_device *adev); | |||
| 658 | void amdgpu_fbdev_set_suspend(struct amdgpu_device *adev, int state); | 658 | void amdgpu_fbdev_set_suspend(struct amdgpu_device *adev, int state); |
| 659 | int amdgpu_fbdev_total_size(struct amdgpu_device *adev); | 659 | int amdgpu_fbdev_total_size(struct amdgpu_device *adev); |
| 660 | bool amdgpu_fbdev_robj_is_fb(struct amdgpu_device *adev, struct amdgpu_bo *robj); | 660 | bool amdgpu_fbdev_robj_is_fb(struct amdgpu_device *adev, struct amdgpu_bo *robj); |
| 661 | void amdgpu_fbdev_restore_mode(struct amdgpu_device *adev); | ||
| 662 | |||
| 663 | void amdgpu_fb_output_poll_changed(struct amdgpu_device *adev); | ||
| 664 | |||
| 665 | 661 | ||
| 666 | int amdgpu_align_pitch(struct amdgpu_device *adev, int width, int bpp, bool tiled); | 662 | int amdgpu_align_pitch(struct amdgpu_device *adev, int width, int bpp, bool tiled); |
| 667 | 663 | ||
