drm/gma500: Use drm_fb_helper_lastclose() and _poll_changed()
authorNoralf Trønnes <noralf@tronnes.org>
Tue, 5 Dec 2017 18:24:58 +0000 (19:24 +0100)
committerNoralf Trønnes <noralf@tronnes.org>
Fri, 8 Dec 2017 12:05:22 +0000 (13:05 +0100)
This driver can use drm_fb_helper_lastclose() as its .lastclose callback.
It can also use drm_fb_helper_output_poll_changed() as its
.output_poll_changed callback.

Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20171205182504.41923-6-noralf@tronnes.org
drivers/gpu/drm/gma500/framebuffer.c
drivers/gpu/drm/gma500/psb_drv.c

index 2570c7f647a637f3ea5eabf4030e77888116a33b..cb0a2ae916e094b4e1e52d123a320d5212c776aa 100644 (file)
@@ -576,13 +576,6 @@ static void psb_fbdev_fini(struct drm_device *dev)
        dev_priv->fbdev = NULL;
 }
 
-static void psbfb_output_poll_changed(struct drm_device *dev)
-{
-       struct drm_psb_private *dev_priv = dev->dev_private;
-       struct psb_fbdev *fbdev = (struct psb_fbdev *)dev_priv->fbdev;
-       drm_fb_helper_hotplug_event(&fbdev->psb_fb_helper);
-}
-
 /**
  *     psb_user_framebuffer_create_handle - add hamdle to a framebuffer
  *     @fb: framebuffer
@@ -623,7 +616,7 @@ static void psb_user_framebuffer_destroy(struct drm_framebuffer *fb)
 
 static const struct drm_mode_config_funcs psb_mode_funcs = {
        .fb_create = psb_user_framebuffer_create,
-       .output_poll_changed = psbfb_output_poll_changed,
+       .output_poll_changed = drm_fb_helper_output_poll_changed,
 };
 
 static void psb_setup_outputs(struct drm_device *dev)
index 8f5cc1f471cd2bd373cfa6d4fdb2c9bcbda0cc01..38d09d4b3ed5fd39fe22a230806c12386e1cedf9 100644 (file)
@@ -107,19 +107,6 @@ MODULE_DEVICE_TABLE(pci, pciidlist);
 static const struct drm_ioctl_desc psb_ioctls[] = {
 };
 
-static void psb_driver_lastclose(struct drm_device *dev)
-{
-       int ret;
-       struct drm_psb_private *dev_priv = dev->dev_private;
-       struct psb_fbdev *fbdev = dev_priv->fbdev;
-
-       ret = drm_fb_helper_restore_fbdev_mode_unlocked(&fbdev->psb_fb_helper);
-       if (ret)
-               DRM_DEBUG("failed to restore crtc mode\n");
-
-       return;
-}
-
 static int psb_do_init(struct drm_device *dev)
 {
        struct drm_psb_private *dev_priv = dev->dev_private;
@@ -479,7 +466,7 @@ static struct drm_driver driver = {
                           DRIVER_MODESET | DRIVER_GEM,
        .load = psb_driver_load,
        .unload = psb_driver_unload,
-       .lastclose = psb_driver_lastclose,
+       .lastclose = drm_fb_helper_lastclose,
 
        .num_ioctls = ARRAY_SIZE(psb_ioctls),
        .irq_preinstall = psb_irq_preinstall,