drm/mediatek: Add Mediatek framebuffer device
authorCK Hu <ck.hu@mediatek.com>
Mon, 14 Jan 2019 09:44:44 +0000 (17:44 +0800)
committerCK Hu <ck.hu@mediatek.com>
Tue, 19 Mar 2019 02:37:40 +0000 (10:37 +0800)
For Mediatek drm driver, use fbdev emulation to create a framebuffer
device.

Signed-off-by: CK Hu <ck.hu@mediatek.com>
drivers/gpu/drm/mediatek/mtk_drm_drv.c

index 4c3375cfb68f0866c1cdc1708c898d69aa2ec22e..57ce4708ef1b9a420cd9862d3c7b7d624a7efa3f 100644 (file)
@@ -15,6 +15,7 @@
 #include <drm/drmP.h>
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
+#include <drm/drm_fb_helper.h>
 #include <drm/drm_gem.h>
 #include <drm/drm_gem_cma_helper.h>
 #include <drm/drm_of.h>
@@ -378,6 +379,10 @@ static int mtk_drm_bind(struct device *dev)
        if (ret < 0)
                goto err_deinit;
 
+       ret = drm_fbdev_generic_setup(drm, 32);
+       if (ret)
+               DRM_ERROR("Failed to initialize fbdev: %d\n", ret);
+
        return 0;
 
 err_deinit: