drm/udl: add vblank support
authorStéphane Marchesin <marcheu@chromium.org>
Wed, 2 Jul 2014 22:13:42 +0000 (15:13 -0700)
committerDave Airlie <airlied@redhat.com>
Tue, 8 Jul 2014 01:33:05 +0000 (11:33 +1000)
This is needed to be able to send page flip completion events.
Also while I'm at it, fix the error paths on init.

Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/udl/udl_main.c

index 7094b92d1ec78467b1600d6ec2e3fd8f080d1344..42795674bc0783d12807e76d751c27acb3b200fb 100644 (file)
@@ -306,10 +306,23 @@ int udl_driver_load(struct drm_device *dev, unsigned long flags)
 
        DRM_DEBUG("\n");
        ret = udl_modeset_init(dev);
+       if (ret)
+               goto err;
 
        ret = udl_fbdev_init(dev);
+       if (ret)
+               goto err;
+
+       ret = drm_vblank_init(dev, 1);
+       if (ret)
+               goto err_fb;
+
        return 0;
+err_fb:
+       udl_fbdev_cleanup(dev);
 err:
+       if (udl->urbs.count)
+               udl_free_urb_list(dev);
        kfree(udl);
        DRM_ERROR("%d\n", ret);
        return ret;
@@ -325,6 +338,8 @@ int udl_driver_unload(struct drm_device *dev)
 {
        struct udl_device *udl = dev->dev_private;
 
+       drm_vblank_cleanup(dev);
+
        if (udl->urbs.count)
                udl_free_urb_list(dev);