diff options
author | Noralf Trønnes <noralf@tronnes.org> | 2017-12-05 13:25:01 -0500 |
---|---|---|
committer | Noralf Trønnes <noralf@tronnes.org> | 2017-12-08 07:07:34 -0500 |
commit | ef62d308780711b7887cf67fd89095edf27c96b9 (patch) | |
tree | 0c5bd13be84118531102a94a9e777cf29b421345 /drivers/gpu/drm/omapdrm/omap_drv.c | |
parent | d0f54f51f625f2539371d3723d8a8f5f5a1e9038 (diff) |
drm/omap: Use drm_fb_helper_lastclose() and _poll_changed()
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: Tomi Valkeinen <tomi.valkeinen@ti.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-9-noralf@tronnes.org
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_drv.c')
-rw-r--r-- | drivers/gpu/drm/omapdrm/omap_drv.c | 34 |
1 files changed, 2 insertions, 32 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index cdf5b0601eba..96857c508ee0 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c | |||
@@ -46,14 +46,6 @@ | |||
46 | * devices | 46 | * devices |
47 | */ | 47 | */ |
48 | 48 | ||
49 | static void omap_fb_output_poll_changed(struct drm_device *dev) | ||
50 | { | ||
51 | struct omap_drm_private *priv = dev->dev_private; | ||
52 | DBG("dev=%p", dev); | ||
53 | if (priv->fbdev) | ||
54 | drm_fb_helper_hotplug_event(priv->fbdev); | ||
55 | } | ||
56 | |||
57 | static void omap_atomic_wait_for_completion(struct drm_device *dev, | 49 | static void omap_atomic_wait_for_completion(struct drm_device *dev, |
58 | struct drm_atomic_state *old_state) | 50 | struct drm_atomic_state *old_state) |
59 | { | 51 | { |
@@ -132,7 +124,7 @@ static const struct drm_mode_config_helper_funcs omap_mode_config_helper_funcs = | |||
132 | 124 | ||
133 | static const struct drm_mode_config_funcs omap_mode_config_funcs = { | 125 | static const struct drm_mode_config_funcs omap_mode_config_funcs = { |
134 | .fb_create = omap_framebuffer_create, | 126 | .fb_create = omap_framebuffer_create, |
135 | .output_poll_changed = omap_fb_output_poll_changed, | 127 | .output_poll_changed = drm_fb_helper_output_poll_changed, |
136 | .atomic_check = drm_atomic_helper_check, | 128 | .atomic_check = drm_atomic_helper_check, |
137 | .atomic_commit = drm_atomic_helper_commit, | 129 | .atomic_commit = drm_atomic_helper_commit, |
138 | }; | 130 | }; |
@@ -467,28 +459,6 @@ static int dev_open(struct drm_device *dev, struct drm_file *file) | |||
467 | return 0; | 459 | return 0; |
468 | } | 460 | } |
469 | 461 | ||
470 | /** | ||
471 | * lastclose - clean up after all DRM clients have exited | ||
472 | * @dev: DRM device | ||
473 | * | ||
474 | * Take care of cleaning up after all DRM clients have exited. In the | ||
475 | * mode setting case, we want to restore the kernel's initial mode (just | ||
476 | * in case the last client left us in a bad state). | ||
477 | */ | ||
478 | static void dev_lastclose(struct drm_device *dev) | ||
479 | { | ||
480 | struct omap_drm_private *priv = dev->dev_private; | ||
481 | int ret; | ||
482 | |||
483 | DBG("lastclose: dev=%p", dev); | ||
484 | |||
485 | if (priv->fbdev) { | ||
486 | ret = drm_fb_helper_restore_fbdev_mode_unlocked(priv->fbdev); | ||
487 | if (ret) | ||
488 | DBG("failed to restore crtc mode"); | ||
489 | } | ||
490 | } | ||
491 | |||
492 | static const struct vm_operations_struct omap_gem_vm_ops = { | 462 | static const struct vm_operations_struct omap_gem_vm_ops = { |
493 | .fault = omap_gem_fault, | 463 | .fault = omap_gem_fault, |
494 | .open = drm_gem_vm_open, | 464 | .open = drm_gem_vm_open, |
@@ -511,7 +481,7 @@ static struct drm_driver omap_drm_driver = { | |||
511 | .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME | | 481 | .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME | |
512 | DRIVER_ATOMIC | DRIVER_RENDER, | 482 | DRIVER_ATOMIC | DRIVER_RENDER, |
513 | .open = dev_open, | 483 | .open = dev_open, |
514 | .lastclose = dev_lastclose, | 484 | .lastclose = drm_fb_helper_lastclose, |
515 | #ifdef CONFIG_DEBUG_FS | 485 | #ifdef CONFIG_DEBUG_FS |
516 | .debugfs_init = omap_debugfs_init, | 486 | .debugfs_init = omap_debugfs_init, |
517 | #endif | 487 | #endif |