@@ -2,6 +2,7 @@
config DRM_ARMADA
tristate "DRM support for Marvell Armada SoCs"
depends on DRM && HAVE_CLK && ARM && MMU
+ select DRM_ARMADA_FBDEV_EMULATION if DRM_FBDEV_EMULATION
select DRM_KMS_HELPER
help
Support the "LCD" controllers found on the Marvell Armada 510
@@ -11,3 +12,10 @@ config DRM_ARMADA
This driver provides no built-in acceleration; acceleration is
performed by other IP found on the SoC. This driver provides
kernel mode setting and buffer management to userspace.
+
+config DRM_ARMADA_FBDEV_EMULATION
+ bool
+ depends on DRM_ARMADA
+ select FB_CFB_COPYAREA
+ select FB_CFB_FILLRECT
+ select FB_CFB_IMAGEBLIT
@@ -3,6 +3,6 @@ armada-y := armada_crtc.o armada_drv.o armada_fb.o \
armada_gem.o armada_overlay.o armada_plane.o armada_trace.o
armada-y += armada_510.o
armada-$(CONFIG_DEBUG_FS) += armada_debugfs.o
-armada-$(CONFIG_DRM_FBDEV_EMULATION) += armada_fbdev.o
+armada-$(CONFIG_DRM_ARMADA_FBDEV_EMULATION) += armada_fbdev.o
obj-$(CONFIG_DRM_ARMADA) := armada.o
@@ -73,7 +73,7 @@ struct armada_private {
#define drm_to_armada_dev(dev) container_of(dev, struct armada_private, drm)
-#if defined(CONFIG_DRM_FBDEV_EMULATION)
+#if defined(CONFIG_DRM_ARMADA_FBDEV_EMULATION)
void armada_fbdev_setup(struct drm_device *dev);
#else
static inline void armada_fbdev_setup(struct drm_device *dev)
@@ -5,6 +5,7 @@
*/
#include <linux/errno.h>
+#include <linux/fb.h>
#include <linux/kernel.h>
#include <linux/module.h>
@@ -34,11 +35,9 @@ static void armada_fbdev_fb_destroy(struct fb_info *info)
static const struct fb_ops armada_fb_ops = {
.owner = THIS_MODULE,
DRM_FB_HELPER_DEFAULT_OPS,
- .fb_read = drm_fb_helper_cfb_read,
- .fb_write = drm_fb_helper_cfb_write,
- .fb_fillrect = drm_fb_helper_cfb_fillrect,
- .fb_copyarea = drm_fb_helper_cfb_copyarea,
- .fb_imageblit = drm_fb_helper_cfb_imageblit,
+ .fb_fillrect = cfb_fillrect,
+ .fb_copyarea = cfb_copyarea,
+ .fb_imageblit = cfb_imageblit,
.fb_destroy = armada_fbdev_fb_destroy,
};
Use the regular fbdev helpers for framebuffer I/O instead of DRM's helpers. Armada does not use damage handling, so DRM's fbdev helpers are mere wrappers around the fbdev code. Add CONFIG_DRM_ARMADA_FBDEV_EMULATION to select the necessary Kconfig options automatically. Make fbdev emulation depend on the new config option. By using fbdev helpers directly within each DRM fbdev emulation, we can eventually remove DRM's wrapper functions entirely. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Cc: Russell King <linux@armlinux.org.uk> --- drivers/gpu/drm/armada/Kconfig | 8 ++++++++ drivers/gpu/drm/armada/Makefile | 2 +- drivers/gpu/drm/armada/armada_drm.h | 2 +- drivers/gpu/drm/armada/armada_fbdev.c | 9 ++++----- 4 files changed, 14 insertions(+), 7 deletions(-)