Commit fdefa58a authored by Archit Taneja's avatar Archit Taneja Committed by Daniel Vetter

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: default avatarArchit Taneja <architt@codeaurora.org>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 742547b7
...@@ -877,6 +877,20 @@ void drm_fb_helper_cfb_imageblit(struct fb_info *info, ...@@ -877,6 +877,20 @@ void drm_fb_helper_cfb_imageblit(struct fb_info *info,
} }
EXPORT_SYMBOL(drm_fb_helper_cfb_imageblit); EXPORT_SYMBOL(drm_fb_helper_cfb_imageblit);
/**
* drm_fb_helper_set_suspend - wrapper around fb_set_suspend
* @fb_helper: driver-allocated fbdev helper
* @state: desired state, zero to resume, non-zero to suspend
*
* A wrapper around fb_set_suspend implemented by fbdev core
*/
void drm_fb_helper_set_suspend(struct drm_fb_helper *fb_helper, int state)
{
if (fb_helper && fb_helper->fbdev)
fb_set_suspend(fb_helper->fbdev, state);
}
EXPORT_SYMBOL(drm_fb_helper_set_suspend);
static int setcolreg(struct drm_crtc *crtc, u16 red, u16 green, static int setcolreg(struct drm_crtc *crtc, u16 red, u16 green,
u16 blue, u16 regno, struct fb_info *info) u16 blue, u16 regno, struct fb_info *info)
{ {
......
...@@ -166,6 +166,8 @@ void drm_fb_helper_cfb_copyarea(struct fb_info *info, ...@@ -166,6 +166,8 @@ void drm_fb_helper_cfb_copyarea(struct fb_info *info,
void drm_fb_helper_cfb_imageblit(struct fb_info *info, void drm_fb_helper_cfb_imageblit(struct fb_info *info,
const struct fb_image *image); const struct fb_image *image);
void drm_fb_helper_set_suspend(struct drm_fb_helper *fb_helper, int state);
int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info); int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info);
int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper); int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment