diff mbox

[02/25] drm/fb_helper: Create a wrapper for unlink_framebuffer

Message ID 1436769501-4105-3-git-send-email-architt@codeaurora.org (mailing list archive)
State Not Applicable, archived
Delegated to: Andy Gross
Headers show

Commit Message

Archit Taneja July 13, 2015, 6:37 a.m. UTC
Some drm drivers call unlink_framebuffer. 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.

Signed-off-by: Archit Taneja <architt@codeaurora.org>
---
 drivers/gpu/drm/drm_fb_helper.c | 7 +++++++
 include/drm/drm_fb_helper.h     | 2 ++
 2 files changed, 9 insertions(+)

Comments

Daniel Vetter July 13, 2015, 7:30 a.m. UTC | #1
On Mon, Jul 13, 2015 at 12:07:58PM +0530, Archit Taneja wrote:
> Some drm drivers call unlink_framebuffer. 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.
> 
> Signed-off-by: Archit Taneja <architt@codeaurora.org>
> ---
>  drivers/gpu/drm/drm_fb_helper.c | 7 +++++++
>  include/drm/drm_fb_helper.h     | 2 ++
>  2 files changed, 9 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index 78859ad..742377d 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -737,6 +737,13 @@ void drm_fb_helper_fini(struct drm_fb_helper *fb_helper)
>  }
>  EXPORT_SYMBOL(drm_fb_helper_fini);
>  
> +void drm_fb_helper_unlink_fbi(struct drm_fb_helper *fb_helper)
> +{
> +	if (fb_helper->fbdev)

In anticipation of adding a runtime knob for fbdev emulation, shouldn't we
be checking for
	if (fb_helper && fb_helper->fbdev)

here? Applies to all the other patches too.

Other big missing thing is (simple) kerneldoc for all these new functions.
-Daniel

> +		unlink_framebuffer(fb_helper->fbdev);
> +}
> +EXPORT_SYMBOL(drm_fb_helper_unlink_fbi);
> +
>  static int setcolreg(struct drm_crtc *crtc, u16 red, u16 green,
>  		     u16 blue, u16 regno, struct fb_info *info)
>  {
> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
> index 2ee4ec5..4c90837 100644
> --- a/include/drm/drm_fb_helper.h
> +++ b/include/drm/drm_fb_helper.h
> @@ -145,6 +145,8 @@ void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helpe
>  void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch,
>  			    uint32_t depth);
>  
> +void drm_fb_helper_unlink_fbi(struct drm_fb_helper *fb_helper);
> +
>  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);
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> hosted by The Linux Foundation
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 78859ad..742377d 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -737,6 +737,13 @@  void drm_fb_helper_fini(struct drm_fb_helper *fb_helper)
 }
 EXPORT_SYMBOL(drm_fb_helper_fini);
 
+void drm_fb_helper_unlink_fbi(struct drm_fb_helper *fb_helper)
+{
+	if (fb_helper->fbdev)
+		unlink_framebuffer(fb_helper->fbdev);
+}
+EXPORT_SYMBOL(drm_fb_helper_unlink_fbi);
+
 static int setcolreg(struct drm_crtc *crtc, u16 red, u16 green,
 		     u16 blue, u16 regno, struct fb_info *info)
 {
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
index 2ee4ec5..4c90837 100644
--- a/include/drm/drm_fb_helper.h
+++ b/include/drm/drm_fb_helper.h
@@ -145,6 +145,8 @@  void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helpe
 void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch,
 			    uint32_t depth);
 
+void drm_fb_helper_unlink_fbi(struct drm_fb_helper *fb_helper);
+
 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);