aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2009-06-13 17:56:03 +0100
committerThomas White <taw@bitwiz.org.uk>2009-06-13 17:56:03 +0100
commit2f5a2688d9f19a9ea2b1162829e46e03cd7856d8 (patch)
treee8a9dc37f047ba0a6ab1651a2b672fa685e9690d /drivers
parenta65c9e7b43b33537255f934a377920f4fb47b8ed (diff)
Platform device bits in drm_stub.c
This adds some bits which were missed out before, necessary to (amongst other things) get the DRM driver's "load" callback to get called. Signed-off-by: Thomas White <taw@bitwiz.org.uk>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/drm_stub.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c
index 5f392b7be23..93ce6cc030f 100644
--- a/drivers/gpu/drm/drm_stub.c
+++ b/drivers/gpu/drm/drm_stub.c
@@ -452,10 +452,29 @@ int drm_get_platform_dev(struct platform_device *pdev,
printk(KERN_ERR "DRM: Fill_in_dev failed.\n");
goto err_g1;
}
-
dev->platform_dev = pdev;
+
+ if (drm_core_check_feature(dev, DRIVER_MODESET)) {
+ ret = drm_get_minor(dev, &dev->control, DRM_MINOR_CONTROL);
+ if (ret)
+ goto err_g2;
+ }
+
if ((ret = drm_get_minor(dev, &dev->primary, DRM_MINOR_LEGACY)))
- goto err_g1;
+ goto err_g3;
+
+ if (dev->driver->load) {
+ ret = dev->driver->load(dev, 0);
+ if (ret)
+ goto err_g3;
+ }
+
+ /* setup the grouping for the legacy output */
+ if (drm_core_check_feature(dev, DRIVER_MODESET)) {
+ ret = drm_mode_group_init_legacy_group(dev, &dev->primary->mode_group);
+ if (ret)
+ goto err_g3;
+ }
list_add_tail(&dev->driver_item, &driver->device_list);
@@ -465,6 +484,9 @@ int drm_get_platform_dev(struct platform_device *pdev,
return 0;
+err_g3:
+ drm_put_minor(&dev->primary);
+err_g2:
err_g1:
drm_free(dev, sizeof(*dev), DRM_MEM_STUB);
return ret;