diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 3599423b774b..ad7b8cf6f53a 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -1947,3 +1947,23 @@ int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper) return 0; } EXPORT_SYMBOL(drm_fb_helper_hotplug_event); + +/** + * drm_fb_helper_lastclose - DRM driver lastclose helper for fbdev emulation + * @dev: DRM device + * + * This function is obsolete. Call drm_fb_helper_restore_fbdev_mode_unlocked() + * instead. + * + * Compatibility helper for out-of-tree modules. Upstream commit + * 943240d342f1 ("drm/client: Pass force parameter to client restore") + * inlined the helper into the client restore path and dropped the exported + * symbol, so modules written against the old interface fail to build with + * an implicit declaration. Restore the device's fbdev configuration as the + * original helper did. + */ +void drm_fb_helper_lastclose(struct drm_device *dev) +{ + drm_fb_helper_restore_fbdev_mode_unlocked(dev->fb_helper, false); +} +EXPORT_SYMBOL(drm_fb_helper_lastclose); diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h index 69d1ed926aac..d9a8425a4ae8 100644 --- a/include/drm/drm_fb_helper.h +++ b/include/drm/drm_fb_helper.h @@ -282,6 +282,9 @@ int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper); int drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper); int drm_fb_helper_debug_enter(struct fb_info *info); int drm_fb_helper_debug_leave(struct fb_info *info); + +/* Compatibility helper for out-of-tree modules; see drm_fb_helper.c */ +void drm_fb_helper_lastclose(struct drm_device *dev); #else static inline void drm_fb_helper_prepare(struct drm_device *dev, struct drm_fb_helper *helper, @@ -397,6 +400,10 @@ static inline int drm_fb_helper_debug_leave(struct fb_info *info) { return 0; } + +static inline void drm_fb_helper_lastclose(struct drm_device *dev) +{ +} #endif /*