Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/fb_helper: Create a wrapper for fb_set_suspend

Some drm drivers call fb_set_suspend. Create a drm_fb_helper function
that wraps around these calls.

This is part of an effort to prevent drm drivers from calling fbdev
functions directly, in order to make fbdev emulation a top level drm
option.

v3:
- Fixed kerneldoc errors

v2:
- Added kerneldocs
- Added a check for non-NULL fb_helper before proceeding. This will
make the helpers work when we have a module param for fbdev emulation
- Follow the drm way of aligning of arguments in func definitions

Signed-off-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

authored by

Archit Taneja and committed by
Daniel Vetter
fdefa58a 742547b7

+16
+14
drivers/gpu/drm/drm_fb_helper.c
··· 877 877 } 878 878 EXPORT_SYMBOL(drm_fb_helper_cfb_imageblit); 879 879 880 + /** 881 + * drm_fb_helper_set_suspend - wrapper around fb_set_suspend 882 + * @fb_helper: driver-allocated fbdev helper 883 + * @state: desired state, zero to resume, non-zero to suspend 884 + * 885 + * A wrapper around fb_set_suspend implemented by fbdev core 886 + */ 887 + void drm_fb_helper_set_suspend(struct drm_fb_helper *fb_helper, int state) 888 + { 889 + if (fb_helper && fb_helper->fbdev) 890 + fb_set_suspend(fb_helper->fbdev, state); 891 + } 892 + EXPORT_SYMBOL(drm_fb_helper_set_suspend); 893 + 880 894 static int setcolreg(struct drm_crtc *crtc, u16 red, u16 green, 881 895 u16 blue, u16 regno, struct fb_info *info) 882 896 {
+2
include/drm/drm_fb_helper.h
··· 166 166 void drm_fb_helper_cfb_imageblit(struct fb_info *info, 167 167 const struct fb_image *image); 168 168 169 + void drm_fb_helper_set_suspend(struct drm_fb_helper *fb_helper, int state); 170 + 169 171 int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info); 170 172 171 173 int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper);