Skip to content

Commit d21bf46

Browse files
committed
drm/fb-helper: kill drm_fb_helper_restore
It's only used internally for the sysrq and panic handlers provided by the drm fb helper implementation. Hence just inline it, kill the export and remove the confusing kerneldoc. Driver's are supposed to call drm_fb_helper_restore_fbdev_mode on lastclose. Note that locking is totally fubar - the sysrq case doesn't take any locks at all. The panic handler probably shouldn't take any locks since it'll only make things worse. Otoh it's probably better to switch things over to the atomic modeset callbacks (and disable the panic handler for those drivers which don't implement it). But that's both better done in separate patches. Reviewed-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
1 parent 6aed8ec commit d21bf46

2 files changed

Lines changed: 8 additions & 16 deletions

File tree

‎drivers/gpu/drm/drm_fb_helper.c‎

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,10 @@ bool drm_fb_helper_restore_fbdev_mode(struct drm_fb_helper *fb_helper)
264264
}
265265
EXPORT_SYMBOL(drm_fb_helper_restore_fbdev_mode);
266266

267+
/*
268+
* restore fbcon display for all kms driver's using this helper, used for sysrq
269+
* and panic handling.
270+
*/
267271
static bool drm_fb_helper_force_kernel_mode(void)
268272
{
269273
bool ret, error = false;
@@ -302,20 +306,6 @@ static struct notifier_block paniced = {
302306
.notifier_call = drm_fb_helper_panic,
303307
};
304308

305-
/**
306-
* drm_fb_helper_restore - restore the framebuffer console (kernel) config
307-
*
308-
* Restore's the kernel's fbcon mode, used for lastclose & panic paths.
309-
*/
310-
void drm_fb_helper_restore(void)
311-
{
312-
bool ret;
313-
ret = drm_fb_helper_force_kernel_mode();
314-
if (ret == true)
315-
DRM_ERROR("Failed to restore crtc configuration\n");
316-
}
317-
EXPORT_SYMBOL(drm_fb_helper_restore);
318-
319309
static bool drm_fb_helper_is_bound(struct drm_fb_helper *fb_helper)
320310
{
321311
struct drm_device *dev = fb_helper->dev;
@@ -337,7 +327,10 @@ static bool drm_fb_helper_is_bound(struct drm_fb_helper *fb_helper)
337327
#ifdef CONFIG_MAGIC_SYSRQ
338328
static void drm_fb_helper_restore_work_fn(struct work_struct *ignored)
339329
{
340-
drm_fb_helper_restore();
330+
bool ret;
331+
ret = drm_fb_helper_force_kernel_mode();
332+
if (ret == true)
333+
DRM_ERROR("Failed to restore crtc configuration\n");
341334
}
342335
static DECLARE_WORK(drm_fb_helper_restore_work, drm_fb_helper_restore_work_fn);
343336

‎include/drm/drm_fb_helper.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ int drm_fb_helper_setcolreg(unsigned regno,
103103
struct fb_info *info);
104104

105105
bool drm_fb_helper_restore_fbdev_mode(struct drm_fb_helper *fb_helper);
106-
void drm_fb_helper_restore(void);
107106
void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helper,
108107
uint32_t fb_width, uint32_t fb_height);
109108
void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch,

0 commit comments

Comments
 (0)