From 51eaa717e86f2975c69a9bb7d0467fe1b9ddbe82 Mon Sep 17 00:00:00 2001 From: Wentao Guan Date: Fri, 23 Oct 2026 15:45:10 +0800 Subject: [PATCH] drm/fb-helper: Restore drm_fb_helper_lastclose() for out-of-tree modules 6.18.55 Commit ("drm/client: Pass force parameter to client restore", backported from v6.19) inlined drm_fb_helper_lastclose() into the client restore path and removed the exported symbol. Out-of-tree drivers that still call the old helper therefore fail to build: loonggpu/loonggpu_kms.c:625:9: error: implicit declaration of function 'drm_fb_helper_lastclose'; did you mean 'drm_fb_helper_alloc_fbi'? [-Werror=implicit-function-declaration] The loonggpu DKMS driver, for example, keeps the call for kernels older than v6.12 and reaches it through loonggpu_driver_lastclose_kms(). Add drm_fb_helper_lastclose() back as an exported compatibility wrapper around drm_fb_helper_restore_fbdev_mode_unlocked(), passing force = false as the removed helper did. No functional change for in-tree code. Signed-off-by: Wentao Guan --- drivers/gpu/drm/drm_fb_helper.c | 20 ++++++++++++++++++++ include/drm/drm_fb_helper.h | 7 +++++++ 2 files changed, 27 insertions(+) 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 /*