return 0;
 }
 
-static void vc4_lastclose(struct drm_device *dev)
-{
-       struct vc4_dev *vc4 = to_vc4_dev(dev);
-
-       drm_fbdev_cma_restore_mode(vc4->fbdev);
-}
-
 static const struct vm_operations_struct vc4_vm_ops = {
        .fault = vc4_fault,
        .open = drm_gem_vm_open,
                            DRIVER_HAVE_IRQ |
                            DRIVER_RENDER |
                            DRIVER_PRIME),
-       .lastclose = vc4_lastclose,
+       .lastclose = drm_fb_helper_lastclose,
        .irq_handler = vc4_irq,
        .irq_preinstall = vc4_irq_preinstall,
        .irq_postinstall = vc4_irq_postinstall,
 {
        struct platform_device *pdev = to_platform_device(dev);
        struct drm_device *drm = platform_get_drvdata(pdev);
-       struct vc4_dev *vc4 = to_vc4_dev(drm);
 
        drm_dev_unregister(drm);
 
-       if (vc4->fbdev)
-               drm_fbdev_cma_fini(vc4->fbdev);
+       drm_fb_cma_fbdev_fini(drm);
 
        drm_mode_config_cleanup(drm);
 
 
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_plane_helper.h>
+#include <drm/drm_fb_helper.h>
 #include <drm/drm_fb_cma_helper.h>
 #include <drm/drm_gem_framebuffer_helper.h>
 #include "vc4_drv.h"
 
-static void vc4_output_poll_changed(struct drm_device *dev)
-{
-       struct vc4_dev *vc4 = to_vc4_dev(dev);
-
-       drm_fbdev_cma_hotplug_event(vc4->fbdev);
-}
-
 static void
 vc4_atomic_complete_commit(struct drm_atomic_state *state)
 {
 }
 
 static const struct drm_mode_config_funcs vc4_mode_funcs = {
-       .output_poll_changed = vc4_output_poll_changed,
+       .output_poll_changed = drm_fb_helper_output_poll_changed,
        .atomic_check = drm_atomic_helper_check,
        .atomic_commit = vc4_atomic_commit,
        .fb_create = vc4_fb_create,
 
        drm_mode_config_reset(dev);
 
-       if (dev->mode_config.num_connector) {
-               vc4->fbdev = drm_fbdev_cma_init(dev, 32,
-                                               dev->mode_config.num_connector);
-               if (IS_ERR(vc4->fbdev))
-                       vc4->fbdev = NULL;
-       }
+       if (dev->mode_config.num_connector)
+               drm_fb_cma_fbdev_init(dev, 32, 0);
 
        drm_kms_helper_poll_init(dev);