Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: Use drm_fb_helper_lastclose() and _poll_changed()

This driver can use drm_fb_helper_lastclose() in its .lastclose function.
It can also use drm_fb_helper_output_poll_changed() as its
.output_poll_changed callback.
Remove the unused driver implementations.

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Noralf Trønnes and committed by
Alex Deucher
ab77e02c 366c1baa

+3 -42
+2 -7
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
··· 34 34 #include <linux/pm_runtime.h> 35 35 #include <drm/drm_crtc_helper.h> 36 36 #include <drm/drm_edid.h> 37 + #include <drm/drm_fb_helper.h> 37 38 38 39 static void amdgpu_flip_callback(struct dma_fence *f, struct dma_fence_cb *cb) 39 40 { ··· 557 556 return &amdgpu_fb->base; 558 557 } 559 558 560 - void amdgpu_output_poll_changed(struct drm_device *dev) 561 - { 562 - struct amdgpu_device *adev = dev->dev_private; 563 - amdgpu_fb_output_poll_changed(adev); 564 - } 565 - 566 559 const struct drm_mode_config_funcs amdgpu_mode_funcs = { 567 560 .fb_create = amdgpu_user_framebuffer_create, 568 - .output_poll_changed = amdgpu_output_poll_changed 561 + .output_poll_changed = drm_fb_helper_output_poll_changed, 569 562 }; 570 563 571 564 static const struct drm_prop_enum_list amdgpu_underscan_enum_list[] =
-1
drivers/gpu/drm/amd/amdgpu/amdgpu_display.h
··· 27 27 amdgpu_user_framebuffer_create(struct drm_device *dev, 28 28 struct drm_file *file_priv, 29 29 const struct drm_mode_fb_cmd2 *mode_cmd); 30 - void amdgpu_output_poll_changed(struct drm_device *dev); 31 30 32 31 #endif
-27
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
··· 283 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 286 static int amdgpu_fbdev_destroy(struct drm_device *dev, struct amdgpu_fbdev *rfbdev) 293 287 { 294 288 struct amdgpu_framebuffer *rfb = &rfbdev->rfb; ··· 386 392 if (robj == gem_to_amdgpu_bo(adev->mode_info.rfbdev->rfb.obj)) 387 393 return true; 388 394 return false; 389 - } 390 - 391 - void amdgpu_fbdev_restore_mode(struct amdgpu_device *adev) 392 - { 393 - struct amdgpu_fbdev *afbdev; 394 - struct drm_fb_helper *fb_helper; 395 - int ret; 396 - 397 - if (!adev) 398 - return; 399 - 400 - afbdev = adev->mode_info.rfbdev; 401 - 402 - if (!afbdev) 403 - return; 404 - 405 - fb_helper = &afbdev->helper; 406 - 407 - ret = drm_fb_helper_restore_fbdev_mode_unlocked(fb_helper); 408 - if (ret) 409 - DRM_DEBUG("failed to restore crtc mode\n"); 410 395 }
+1 -3
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
··· 788 788 */ 789 789 void amdgpu_driver_lastclose_kms(struct drm_device *dev) 790 790 { 791 - struct amdgpu_device *adev = dev->dev_private; 792 - 793 - amdgpu_fbdev_restore_mode(adev); 791 + drm_fb_helper_lastclose(dev); 794 792 vga_switcheroo_process_delayed_switch(); 795 793 } 796 794
-4
drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h
··· 658 658 void amdgpu_fbdev_set_suspend(struct amdgpu_device *adev, int state); 659 659 int amdgpu_fbdev_total_size(struct amdgpu_device *adev); 660 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 662 int amdgpu_align_pitch(struct amdgpu_device *adev, int width, int bpp, bool tiled); 667 663