Skip to content

Commit 304a4f6

Browse files
committed
drm/fb-helper: Add .last_close and .output_poll_changed helpers
This adds helpers for the drm_driver->last_close and the drm_mode_config_funcs->output_poll_changed callbacks. Signed-off-by: Noralf Trønnes <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 29ad20b commit 304a4f6

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

drivers/gpu/drm/drm_fb_helper.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2633,6 +2633,34 @@ int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper)
26332633
}
26342634
EXPORT_SYMBOL(drm_fb_helper_hotplug_event);
26352635

2636+
/**
2637+
* drm_fb_helper_lastclose - DRM driver lastclose helper for fbdev emulation
2638+
* @dev: DRM device
2639+
*
2640+
* This function can be used as the &drm_driver->lastclose callback for drivers
2641+
* that only need to call drm_fb_helper_restore_fbdev_mode_unlocked().
2642+
*/
2643+
void drm_fb_helper_lastclose(struct drm_device *dev)
2644+
{
2645+
drm_fb_helper_restore_fbdev_mode_unlocked(dev->fb_helper);
2646+
}
2647+
EXPORT_SYMBOL(drm_fb_helper_lastclose);
2648+
2649+
/**
2650+
* drm_fb_helper_output_poll_changed - DRM mode config \.output_poll_changed
2651+
* helper for fbdev emulation
2652+
* @dev: DRM device
2653+
*
2654+
* This function can be used as the
2655+
* &drm_mode_config_funcs.output_poll_changed callback for drivers that only
2656+
* need to call drm_fb_helper_hotplug_event().
2657+
*/
2658+
void drm_fb_helper_output_poll_changed(struct drm_device *dev)
2659+
{
2660+
drm_fb_helper_hotplug_event(dev->fb_helper);
2661+
}
2662+
EXPORT_SYMBOL(drm_fb_helper_output_poll_changed);
2663+
26362664
/* The Kconfig DRM_KMS_HELPER selects FRAMEBUFFER_CONSOLE (if !EXPERT)
26372665
* but the module doesn't depend on any fb console symbols. At least
26382666
* attempt to load fbcon to avoid leaving the system without a usable console.

include/drm/drm_fb_helper.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,9 @@ drm_pick_cmdline_mode(struct drm_fb_helper_connector *fb_helper_conn);
310310
int drm_fb_helper_add_one_connector(struct drm_fb_helper *fb_helper, struct drm_connector *connector);
311311
int drm_fb_helper_remove_one_connector(struct drm_fb_helper *fb_helper,
312312
struct drm_connector *connector);
313+
314+
void drm_fb_helper_lastclose(struct drm_device *dev);
315+
void drm_fb_helper_output_poll_changed(struct drm_device *dev);
313316
#else
314317
static inline void drm_fb_helper_prepare(struct drm_device *dev,
315318
struct drm_fb_helper *helper,
@@ -507,6 +510,14 @@ drm_fb_helper_remove_one_connector(struct drm_fb_helper *fb_helper,
507510
return 0;
508511
}
509512

513+
static inline void drm_fb_helper_lastclose(struct drm_device *dev)
514+
{
515+
}
516+
517+
static inline void drm_fb_helper_output_poll_changed(struct drm_device *dev)
518+
{
519+
}
520+
510521
#endif
511522

512523
static inline int

0 commit comments

Comments
 (0)