if (ifbdev->fb)
drm_framebuffer_remove(&ifbdev->fb->base);
+ drm_client_release(&ifbdev->helper.client);
drm_fb_helper_unprepare(&ifbdev->helper);
kfree(ifbdev);
}
intel_fbdev_invalidate(ifbdev);
}
+/*
+ * Fbdev client and struct drm_client_funcs
+ */
+
+static void intel_fbdev_client_unregister(struct drm_client_dev *client)
+{ }
+
+static int intel_fbdev_client_restore(struct drm_client_dev *client)
+{
+ return 0;
+}
+
+static int intel_fbdev_client_hotplug(struct drm_client_dev *client)
+{
+ return 0;
+}
+
+static const struct drm_client_funcs intel_fbdev_client_funcs = {
+ .owner = THIS_MODULE,
+ .unregister = intel_fbdev_client_unregister,
+ .restore = intel_fbdev_client_restore,
+ .hotplug = intel_fbdev_client_hotplug,
+};
+
int intel_fbdev_init(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = to_i915(dev);
else
ifbdev->preferred_bpp = ifbdev->helper.preferred_bpp;
+ ret = drm_client_init(dev, &ifbdev->helper.client, "intel-fbdev",
+ &intel_fbdev_client_funcs);
+ if (ret)
+ goto err_drm_fb_helper_unprepare;
+
ret = drm_fb_helper_init(dev, &ifbdev->helper);
- if (ret) {
- kfree(ifbdev);
- return ret;
- }
+ if (ret)
+ goto err_drm_client_release;
dev_priv->display.fbdev.fbdev = ifbdev;
INIT_WORK(&dev_priv->display.fbdev.suspend_work, intel_fbdev_suspend_worker);
return 0;
+
+err_drm_client_release:
+ drm_client_release(&ifbdev->helper.client);
+err_drm_fb_helper_unprepare:
+ drm_fb_helper_unprepare(&ifbdev->helper);
+ kfree(ifbdev);
+ return ret;
}
static void intel_fbdev_initial_config(void *data, async_cookie_t cookie)