OSDN Git Service

drm: Turn off Legacy Context Functions
[android-x86/kernel.git] / drivers / gpu / drm / drm_drv.c
index 3b3c4f5..8386575 100644 (file)
@@ -46,13 +46,11 @@ MODULE_AUTHOR(CORE_AUTHOR);
 MODULE_DESCRIPTION(CORE_DESC);
 MODULE_LICENSE("GPL and additional rights");
 MODULE_PARM_DESC(debug, "Enable debug output");
-MODULE_PARM_DESC(atomic, "Enable experimental atomic KMS API");
 MODULE_PARM_DESC(vblankoffdelay, "Delay until vblank irq auto-disable [msecs] (0: never disable, <0: disable immediately)");
 MODULE_PARM_DESC(timestamp_precision_usec, "Max. error on timestamps [usecs]");
 MODULE_PARM_DESC(timestamp_monotonic, "Use monotonic timestamps");
 
 module_param_named(debug, drm_debug, int, 0600);
-module_param_named_unsafe(atomic, drm_atomic, bool, 0600);
 
 static DEFINE_SPINLOCK(drm_minor_lock);
 static struct idr drm_minors_idr;
@@ -584,11 +582,14 @@ struct drm_device *drm_dev_alloc(struct drm_driver *driver,
        if (drm_ht_create(&dev->map_hash, 12))
                goto err_minors;
 
-       ret = drm_legacy_ctxbitmap_init(dev);
-       if (ret) {
-               DRM_ERROR("Cannot allocate memory for context bitmap.\n");
-               goto err_ht;
-       }
+       if (drm_core_check_feature(dev, DRIVER_KMS_LEGACY_CONTEXT) ||
+               !drm_core_check_feature(dev, DRIVER_MODESET))
+               ret = drm_legacy_ctxbitmap_init(dev);
+               if (ret) {
+                       DRM_ERROR(
+                               "Cannot allocate memory for context bitmap.\n");
+                       goto err_ht;
+               }
 
        if (drm_core_check_feature(dev, DRIVER_GEM)) {
                ret = drm_gem_init(dev);