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

drm/radeon: 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.

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
3997eea5 ab77e02c

+4 -35
+2 -7
drivers/gpu/drm/radeon/radeon_display.c
··· 32 32 33 33 #include <linux/pm_runtime.h> 34 34 #include <drm/drm_crtc_helper.h> 35 + #include <drm/drm_fb_helper.h> 35 36 #include <drm/drm_plane_helper.h> 36 37 #include <drm/drm_edid.h> 37 38 ··· 1363 1362 return &radeon_fb->base; 1364 1363 } 1365 1364 1366 - static void radeon_output_poll_changed(struct drm_device *dev) 1367 - { 1368 - struct radeon_device *rdev = dev->dev_private; 1369 - radeon_fb_output_poll_changed(rdev); 1370 - } 1371 - 1372 1365 static const struct drm_mode_config_funcs radeon_mode_funcs = { 1373 1366 .fb_create = radeon_user_framebuffer_create, 1374 - .output_poll_changed = radeon_output_poll_changed 1367 + .output_poll_changed = drm_fb_helper_output_poll_changed, 1375 1368 }; 1376 1369 1377 1370 static const struct drm_prop_enum_list radeon_tmds_pll_enum_list[] =
-22
drivers/gpu/drm/radeon/radeon_fb.c
··· 306 306 return ret; 307 307 } 308 308 309 - void radeon_fb_output_poll_changed(struct radeon_device *rdev) 310 - { 311 - if (rdev->mode_info.rfbdev) 312 - drm_fb_helper_hotplug_event(&rdev->mode_info.rfbdev->helper); 313 - } 314 - 315 309 static int radeon_fbdev_destroy(struct drm_device *dev, struct radeon_fbdev *rfbdev) 316 310 { 317 311 struct radeon_framebuffer *rfb = &rfbdev->rfb; ··· 415 421 { 416 422 if (rdev->mode_info.rfbdev) 417 423 drm_fb_helper_remove_one_connector(&rdev->mode_info.rfbdev->helper, connector); 418 - } 419 - 420 - void radeon_fbdev_restore_mode(struct radeon_device *rdev) 421 - { 422 - struct radeon_fbdev *rfbdev = rdev->mode_info.rfbdev; 423 - struct drm_fb_helper *fb_helper; 424 - int ret; 425 - 426 - if (!rfbdev) 427 - return; 428 - 429 - fb_helper = &rfbdev->helper; 430 - 431 - ret = drm_fb_helper_restore_fbdev_mode_unlocked(fb_helper); 432 - if (ret) 433 - DRM_DEBUG("failed to restore crtc mode\n"); 434 424 }
+2 -3
drivers/gpu/drm/radeon/radeon_kms.c
··· 26 26 * Jerome Glisse 27 27 */ 28 28 #include <drm/drmP.h> 29 + #include <drm/drm_fb_helper.h> 29 30 #include "radeon.h" 30 31 #include <drm/radeon_drm.h> 31 32 #include "radeon_asic.h" ··· 630 629 */ 631 630 void radeon_driver_lastclose_kms(struct drm_device *dev) 632 631 { 633 - struct radeon_device *rdev = dev->dev_private; 634 - 635 - radeon_fbdev_restore_mode(rdev); 632 + drm_fb_helper_lastclose(dev); 636 633 vga_switcheroo_process_delayed_switch(); 637 634 } 638 635
-3
drivers/gpu/drm/radeon/radeon_mode.h
··· 984 984 void radeon_fbdev_fini(struct radeon_device *rdev); 985 985 void radeon_fbdev_set_suspend(struct radeon_device *rdev, int state); 986 986 bool radeon_fbdev_robj_is_fb(struct radeon_device *rdev, struct radeon_bo *robj); 987 - void radeon_fbdev_restore_mode(struct radeon_device *rdev); 988 - 989 - void radeon_fb_output_poll_changed(struct radeon_device *rdev); 990 987 991 988 void radeon_crtc_handle_vblank(struct radeon_device *rdev, int crtc_id); 992 989