@@ -48,9 +48,12 @@
#include <linux/debugfs.h>
#include <linux/slab.h>
+#include <linux/async.h>
#include "drmP.h"
#include "drm_core.h"
+LIST_HEAD(drm_async_domain);
+EXPORT_SYMBOL_GPL(drm_async_domain);
static int drm_version(struct drm_device *dev, void *data,
struct drm_file *file_priv);
@@ -266,6 +269,9 @@ void drm_exit(struct drm_driver *driver)
struct drm_device *dev, *tmp;
DRM_DEBUG("\n");
+ /* make sure all async operations are finished */
+ async_synchronize_full_domain(&drm_async_domain);
+
if (driver->driver_features & DRIVER_MODESET) {
pci_unregister_driver(&driver->pci_driver);
} else {
@@ -34,6 +34,7 @@
#include <linux/delay.h>
#include <linux/fb.h>
#include <linux/init.h>
+#include <linux/async.h>
#include <linux/vga_switcheroo.h>
#include "drmP.h"
@@ -245,6 +246,14 @@ int intel_fbdev_destroy(struct drm_device *dev,
return 0;
}
+static void intel_fbdev_init_async(void *ptr, async_cookie_t cookie)
+{
+ struct intel_fbdev *ifbdev = ptr;
+
+ drm_fb_helper_single_add_all_connectors(&ifbdev->helper);
+ drm_fb_helper_initial_config(&ifbdev->helper, 32);
+}
+
int intel_fbdev_init(struct drm_device *dev)
{
struct intel_fbdev *ifbdev;
@@ -266,8 +275,8 @@ int intel_fbdev_init(struct drm_device *dev)
return ret;
}
- drm_fb_helper_single_add_all_connectors(&ifbdev->helper);
- drm_fb_helper_initial_config(&ifbdev->helper, 32);
+ async_schedule_domain(intel_fbdev_init_async, ifbdev,
+ &drm_async_domain);
return 0;
}
@@ -326,6 +326,8 @@ struct drm_vma_entry {
pid_t pid;
};
+extern struct list_head drm_async_domain;
+
/**
* DMA buffer.
*/