aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_drv.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2009-10-20 15:52:30 +0200
committerThomas White <taw@bitwiz.org.uk>2010-02-09 23:37:32 +0100
commit6f3094073277b407b8eda06999c4842dcd0b7045 (patch)
tree669754a319e594ff5848c4f95414012a2148e87f /drivers/gpu/drm/drm_drv.c
parent2f04ffc8dd97e15ce30358c3bf00cf6a0e7dcc19 (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.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index a75ca63deea..26005d93ad0 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -247,6 +247,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;
@@ -280,11 +281,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;