diff mbox

[v2] drm/fb-helper: add DRM_FB_HELPER_DEFAULT_OPS for fb_ops

Message ID 1475616960-19527-1-git-send-email-contact@stefanchrist.eu (mailing list archive)
State New, archived
Headers show

Commit Message

Stefan Lengfeld Oct. 4, 2016, 9:36 p.m. UTC
The define DRM_FB_HELPER_DEFAULT_OPS provides the drm_fb_helper default
implementations for functions in struct fb_ops. A drm driver can use it
like:

    static struct fb_ops drm_fbdev_cma_ops = {
        .owner          = THIS_MODULE,
        DRM_FB_HELPER_DEFAULT_OPS,
        /* driver specific implementations */
    };

Suggested-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Stefan Christ <contact@stefanchrist.eu>
---
v2: Fix sphinx error:
     warning: Cannot understand  * @DRM_FB_HELPER_DEFAULT_OPS:
---
 include/drm/drm_fb_helper.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

Comments

Gustavo Padovan Oct. 5, 2016, 9 a.m. UTC | #1
Hi Stefan,

2016-10-04 Stefan Christ <contact@stefanchrist.eu>:

> The define DRM_FB_HELPER_DEFAULT_OPS provides the drm_fb_helper default
> implementations for functions in struct fb_ops. A drm driver can use it
> like:
> 
>     static struct fb_ops drm_fbdev_cma_ops = {
>         .owner          = THIS_MODULE,
>         DRM_FB_HELPER_DEFAULT_OPS,
>         /* driver specific implementations */
>     };
> 
> Suggested-by: Daniel Vetter <daniel@ffwll.ch>
> Signed-off-by: Stefan Christ <contact@stefanchrist.eu>
> ---
> v2: Fix sphinx error:
>      warning: Cannot understand  * @DRM_FB_HELPER_DEFAULT_OPS:
> ---
>  include/drm/drm_fb_helper.h | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
> index db8d478..f7d7126 100644
> --- a/include/drm/drm_fb_helper.h
> +++ b/include/drm/drm_fb_helper.h
> @@ -214,6 +214,19 @@ struct drm_fb_helper {
>  	bool delayed_hotplug;
>  };
>  
> +/**
> + * define DRM_FB_HELPER_DEFAULT_OPS - helper define for drm drivers

If I'm not mistaken v1 of this patch is already in drm-misc so you may
want to send a patch that fix just the line above.

Gustavo
Daniel Vetter Oct. 5, 2016, 1:13 p.m. UTC | #2
On Wed, Oct 05, 2016 at 11:00:03AM +0200, Gustavo Padovan wrote:
> Hi Stefan,
> 
> 2016-10-04 Stefan Christ <contact@stefanchrist.eu>:
> 
> > The define DRM_FB_HELPER_DEFAULT_OPS provides the drm_fb_helper default
> > implementations for functions in struct fb_ops. A drm driver can use it
> > like:
> > 
> >     static struct fb_ops drm_fbdev_cma_ops = {
> >         .owner          = THIS_MODULE,
> >         DRM_FB_HELPER_DEFAULT_OPS,
> >         /* driver specific implementations */
> >     };
> > 
> > Suggested-by: Daniel Vetter <daniel@ffwll.ch>
> > Signed-off-by: Stefan Christ <contact@stefanchrist.eu>
> > ---
> > v2: Fix sphinx error:
> >      warning: Cannot understand  * @DRM_FB_HELPER_DEFAULT_OPS:
> > ---
> >  include/drm/drm_fb_helper.h | 13 +++++++++++++
> >  1 file changed, 13 insertions(+)
> > 
> > diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
> > index db8d478..f7d7126 100644
> > --- a/include/drm/drm_fb_helper.h
> > +++ b/include/drm/drm_fb_helper.h
> > @@ -214,6 +214,19 @@ struct drm_fb_helper {
> >  	bool delayed_hotplug;
> >  };
> >  
> > +/**
> > + * define DRM_FB_HELPER_DEFAULT_OPS - helper define for drm drivers
> 
> If I'm not mistaken v1 of this patch is already in drm-misc so you may
> want to send a patch that fix just the line above.

Yup, I need an incremental patch which applies on top of drm-misc or
linux-next. Sorry if this wasn't clear.
-Daniel
diff mbox

Patch

diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
index db8d478..f7d7126 100644
--- a/include/drm/drm_fb_helper.h
+++ b/include/drm/drm_fb_helper.h
@@ -214,6 +214,19 @@  struct drm_fb_helper {
 	bool delayed_hotplug;
 };
 
+/**
+ * define DRM_FB_HELPER_DEFAULT_OPS - helper define for drm drivers
+ *
+ * Helper define to register default implementations of drm_fb_helper
+ * functions. To be used in struct fb_ops of drm drivers.
+ */
+#define DRM_FB_HELPER_DEFAULT_OPS \
+	.fb_check_var	= drm_fb_helper_check_var, \
+	.fb_set_par	= drm_fb_helper_set_par, \
+	.fb_setcmap	= drm_fb_helper_setcmap, \
+	.fb_blank	= drm_fb_helper_blank, \
+	.fb_pan_display	= drm_fb_helper_pan_display
+
 #ifdef CONFIG_DRM_FBDEV_EMULATION
 int drm_fb_helper_modinit(void);
 void drm_fb_helper_prepare(struct drm_device *dev, struct drm_fb_helper *helper,