diff options
author | Thomas White <taw@bitwiz.org.uk> | 2010-05-22 18:59:58 +0200 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2010-05-22 18:59:58 +0200 |
commit | 69d87612a1b545e6d4cf9fc93117be86f871f7d2 (patch) | |
tree | 6a98d476437bded493b7b9b283291ec50336c482 /drivers/gpu/drm/drm_drv.c | |
parent | dd1225cc08c3375bf80289ac1965c724881b149a (diff) |
DRM for platform devices
This modifies the DRM core in a small number of places to allow platform
devices to be used for direct rendering, alongside PCI devices.
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
Diffstat (limited to 'drivers/gpu/drm/drm_drv.c')
-rw-r--r-- | drivers/gpu/drm/drm_drv.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 4a66201edae..769d12b9273 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -250,6 +250,7 @@ int drm_lastclose(struct drm_device * dev) */ int drm_init(struct drm_driver *driver) { +#ifdef CONFIG_PCI struct pci_dev *pdev = NULL; const struct pci_device_id *pid; int i; @@ -283,11 +284,37 @@ int drm_init(struct drm_driver *driver) drm_get_dev(pdev, pid, driver); } } +#endif return 0; } EXPORT_SYMBOL(drm_init); +/** + * Call this to associate a drm_driver with a platform_device. + * + * \return zero on success or a negative number on failure. + * + * This is a replacement for drm_init(), but for platform drivers. + * In this case, the caller must provide the matching platform_device + * + * since there is no physical bus to scan through. + * + * \sa drm_init + * + */ +int drm_platform_init(struct drm_driver *driver, struct platform_device *pdev, + void *priv) +{ + DRM_DEBUG("\n"); + + INIT_LIST_HEAD(&driver->device_list); + + return drm_get_platform_dev(pdev, driver, priv); +} + +EXPORT_SYMBOL(drm_platform_init); + void drm_exit(struct drm_driver *driver) { struct drm_device *dev, *tmp; |