diff options
Diffstat (limited to 'drivers/gpu/drm/drm_stub.c')
-rw-r--r-- | drivers/gpu/drm/drm_stub.c | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c index ea7f9e5d47fa..5ca132afa4f2 100644 --- a/drivers/gpu/drm/drm_stub.c +++ b/drivers/gpu/drm/drm_stub.c | |||
@@ -57,6 +57,14 @@ static int drm_minor_get_id(struct drm_device *dev, int type) | |||
57 | int ret; | 57 | int ret; |
58 | int base = 0, limit = 63; | 58 | int base = 0, limit = 63; |
59 | 59 | ||
60 | if (type == DRM_MINOR_CONTROL) { | ||
61 | base += 64; | ||
62 | limit = base + 127; | ||
63 | } else if (type == DRM_MINOR_RENDER) { | ||
64 | base += 128; | ||
65 | limit = base + 255; | ||
66 | } | ||
67 | |||
60 | again: | 68 | again: |
61 | if (idr_pre_get(&drm_minors_idr, GFP_KERNEL) == 0) { | 69 | if (idr_pre_get(&drm_minors_idr, GFP_KERNEL) == 0) { |
62 | DRM_ERROR("Out of memory expanding drawable idr\n"); | 70 | DRM_ERROR("Out of memory expanding drawable idr\n"); |
@@ -362,12 +370,28 @@ int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent, | |||
362 | printk(KERN_ERR "DRM: Fill_in_dev failed.\n"); | 370 | printk(KERN_ERR "DRM: Fill_in_dev failed.\n"); |
363 | goto err_g2; | 371 | goto err_g2; |
364 | } | 372 | } |
373 | |||
374 | if (drm_core_check_feature(dev, DRIVER_MODESET)) { | ||
375 | ret = drm_get_minor(dev, &dev->control, DRM_MINOR_CONTROL); | ||
376 | if (ret) | ||
377 | goto err_g2; | ||
378 | } | ||
379 | |||
365 | if ((ret = drm_get_minor(dev, &dev->primary, DRM_MINOR_LEGACY))) | 380 | if ((ret = drm_get_minor(dev, &dev->primary, DRM_MINOR_LEGACY))) |
366 | goto err_g2; | 381 | goto err_g3; |
367 | 382 | ||
368 | if (dev->driver->load) | 383 | if (dev->driver->load) { |
369 | if ((ret = dev->driver->load(dev, ent->driver_data))) | 384 | ret = dev->driver->load(dev, ent->driver_data); |
385 | if (ret) | ||
370 | goto err_g3; | 386 | goto err_g3; |
387 | } | ||
388 | |||
389 | /* setup the grouping for the legacy output */ | ||
390 | if (drm_core_check_feature(dev, DRIVER_MODESET)) { | ||
391 | ret = drm_mode_group_init_legacy_group(dev, &dev->primary->mode_group); | ||
392 | if (ret) | ||
393 | goto err_g3; | ||
394 | } | ||
371 | 395 | ||
372 | list_add_tail(&dev->driver_item, &driver->device_list); | 396 | list_add_tail(&dev->driver_item, &driver->device_list); |
373 | 397 | ||