]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/radeon: Use drm_fb_helper_lastclose() and _poll_changed()
authorNoralf Trønnes <noralf@tronnes.org>
Tue, 5 Dec 2017 18:25:02 +0000 (19:25 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 6 Dec 2017 17:48:34 +0000 (12:48 -0500)
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>
drivers/gpu/drm/radeon/radeon_display.c
drivers/gpu/drm/radeon/radeon_fb.c
drivers/gpu/drm/radeon/radeon_kms.c
drivers/gpu/drm/radeon/radeon_mode.h

index ddfe91efa61e4bef713454a8738429898df21053..dfda5e0ed1660d3d91344749aae48fd39a229dc4 100644 (file)
@@ -32,6 +32,7 @@
 
 #include <linux/pm_runtime.h>
 #include <drm/drm_crtc_helper.h>
+#include <drm/drm_fb_helper.h>
 #include <drm/drm_plane_helper.h>
 #include <drm/drm_edid.h>
 
@@ -1362,15 +1363,9 @@ radeon_user_framebuffer_create(struct drm_device *dev,
        return &radeon_fb->base;
 }
 
-static void radeon_output_poll_changed(struct drm_device *dev)
-{
-       struct radeon_device *rdev = dev->dev_private;
-       radeon_fb_output_poll_changed(rdev);
-}
-
 static const struct drm_mode_config_funcs radeon_mode_funcs = {
        .fb_create = radeon_user_framebuffer_create,
-       .output_poll_changed = radeon_output_poll_changed
+       .output_poll_changed = drm_fb_helper_output_poll_changed,
 };
 
 static const struct drm_prop_enum_list radeon_tmds_pll_enum_list[] =
index 33b821d6d018f37ba1ccf9cf86be81be0f4e11da..57c5404a1654d7ff9f62eb218000dea3e34c2cd0 100644 (file)
@@ -306,12 +306,6 @@ out:
        return ret;
 }
 
-void radeon_fb_output_poll_changed(struct radeon_device *rdev)
-{
-       if (rdev->mode_info.rfbdev)
-               drm_fb_helper_hotplug_event(&rdev->mode_info.rfbdev->helper);
-}
-
 static int radeon_fbdev_destroy(struct drm_device *dev, struct radeon_fbdev *rfbdev)
 {
        struct radeon_framebuffer *rfb = &rfbdev->rfb;
@@ -422,19 +416,3 @@ void radeon_fb_remove_connector(struct radeon_device *rdev, struct drm_connector
        if (rdev->mode_info.rfbdev)
                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");
-}
index cde037f213d718321ae285405a95af0c9d648226..dec1e081f52958e9f1d5cfe7813c95ef021ca320 100644 (file)
@@ -26,6 +26,7 @@
  *          Jerome Glisse
  */
 #include <drm/drmP.h>
+#include <drm/drm_fb_helper.h>
 #include "radeon.h"
 #include <drm/radeon_drm.h>
 #include "radeon_asic.h"
@@ -629,9 +630,7 @@ 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);
+       drm_fb_helper_lastclose(dev);
        vga_switcheroo_process_delayed_switch();
 }
 
index ca0a7ed28c9b5cc94ff7155624cf6c5e8f03e986..3243e5e014320b25044471f2b0e1c2f098ae59eb 100644 (file)
@@ -984,9 +984,6 @@ 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);
 
 void radeon_crtc_handle_vblank(struct radeon_device *rdev, int crtc_id);