drm/armada: move armada_drm_mode_config_funcs to armada_drv.c
authorRussell King <rmk+kernel@armlinux.org.uk>
Mon, 30 Jul 2018 10:52:34 +0000 (11:52 +0100)
committerRussell King <rmk+kernel@armlinux.org.uk>
Mon, 30 Jul 2018 10:52:34 +0000 (11:52 +0100)
Move the armada_drm_mode_config_funcs to armada_drv.c, since this now
has less to do with FBs than it does with general mode configuration.
In doing so, we need to make armada_fb_create() visible to armada_drv.c,
which reveals a function name clash with armada_fbdev.c.  Rename the
version in armada_fbdev.c.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
drivers/gpu/drm/armada/armada_drm.h
drivers/gpu/drm/armada/armada_drv.c
drivers/gpu/drm/armada/armada_fb.c
drivers/gpu/drm/armada/armada_fb.h
drivers/gpu/drm/armada/armada_fbdev.c

index 28087e4..64f1c88 100644 (file)
@@ -79,8 +79,6 @@ void __armada_drm_queue_unref_work(struct drm_device *,
 void armada_drm_queue_unref_work(struct drm_device *,
        struct drm_framebuffer *);
 
-extern const struct drm_mode_config_funcs armada_drm_mode_config_funcs;
-
 int armada_fbdev_init(struct drm_device *);
 void armada_fbdev_fini(struct drm_device *);
 
index e47b995..7517f23 100644 (file)
@@ -15,6 +15,7 @@
 #include "armada_crtc.h"
 #include "armada_drm.h"
 #include "armada_gem.h"
+#include "armada_fb.h"
 #include "armada_hw.h"
 #include <drm/armada_drm.h>
 #include "armada_ioctlP.h"
@@ -77,6 +78,11 @@ static struct drm_driver armada_drm_driver = {
        .fops                   = &armada_drm_fops,
 };
 
+static const struct drm_mode_config_funcs armada_drm_mode_config_funcs = {
+       .fb_create              = armada_fb_create,
+       .output_poll_changed    = drm_fb_helper_output_poll_changed,
+};
+
 static int armada_drm_bind(struct device *dev)
 {
        struct armada_private *priv;
index edd1512..6bd638a 100644 (file)
@@ -84,7 +84,7 @@ struct armada_framebuffer *armada_framebuffer_create(struct drm_device *dev,
        return dfb;
 }
 
-static struct drm_framebuffer *armada_fb_create(struct drm_device *dev,
+struct drm_framebuffer *armada_fb_create(struct drm_device *dev,
        struct drm_file *dfile, const struct drm_mode_fb_cmd2 *mode)
 {
        struct armada_gem_object *obj;
@@ -138,8 +138,3 @@ static struct drm_framebuffer *armada_fb_create(struct drm_device *dev,
        DRM_ERROR("failed to initialize framebuffer: %d\n", ret);
        return ERR_PTR(ret);
 }
-
-const struct drm_mode_config_funcs armada_drm_mode_config_funcs = {
-       .fb_create              = armada_fb_create,
-       .output_poll_changed    = drm_fb_helper_output_poll_changed,
-};
index 5c130ff..476daad 100644 (file)
@@ -19,5 +19,6 @@ struct armada_framebuffer {
 
 struct armada_framebuffer *armada_framebuffer_create(struct drm_device *,
        const struct drm_mode_fb_cmd2 *, struct armada_gem_object *);
-
+struct drm_framebuffer *armada_fb_create(struct drm_device *dev,
+       struct drm_file *dfile, const struct drm_mode_fb_cmd2 *mode);
 #endif
index 2a59db0..8d23700 100644 (file)
@@ -24,7 +24,7 @@ static /*const*/ struct fb_ops armada_fb_ops = {
        .fb_imageblit   = drm_fb_helper_cfb_imageblit,
 };
 
-static int armada_fb_create(struct drm_fb_helper *fbh,
+static int armada_fbdev_create(struct drm_fb_helper *fbh,
        struct drm_fb_helper_surface_size *sizes)
 {
        struct drm_device *dev = fbh->dev;
@@ -108,7 +108,7 @@ static int armada_fb_probe(struct drm_fb_helper *fbh,
        int ret = 0;
 
        if (!fbh->fb) {
-               ret = armada_fb_create(fbh, sizes);
+               ret = armada_fbdev_create(fbh, sizes);
                if (ret == 0)
                        ret = 1;
        }