aboutsummaryrefslogtreecommitdiff
path: root/include/drm/drmP.h
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2009-10-20 15:52:30 +0200
committerThomas White <taw@bitwiz.org.uk>2009-11-22 17:55:44 +0100
commitb80e22e277303798dc60975260d7dd1d85b45c73 (patch)
tree516370de130d14c087c71f3f6216a045d5f666e9 /include/drm/drmP.h
parent4331f6c95fadc37ea89359d6afb915be838790f9 (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 'include/drm/drmP.h')
-rw-r--r--include/drm/drmP.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 45b67d9c39c..66253f97d92 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -55,6 +55,7 @@
#include <linux/mm.h>
#include <linux/cdev.h>
#include <linux/mutex.h>
+#include <linux/platform_device.h>
#if defined(__alpha__) || defined(__powerpc__)
#include <asm/pgtable.h> /* For pte_wrprotect */
#endif
@@ -113,6 +114,7 @@ extern void drm_ut_debug_printk(unsigned int request_level,
#define DRIVER_IRQ_VBL2 0x800
#define DRIVER_GEM 0x1000
#define DRIVER_MODESET 0x2000
+#define DRIVER_IS_PLATFORM 0x4000
/***********************************************************************/
/** \name Begin the DRM... */
@@ -981,6 +983,7 @@ struct drm_device {
wait_queue_head_t buf_writers; /**< Processes waiting to ctx switch */
struct drm_agp_head *agp; /**< AGP data */
+ struct platform_device *platform_dev; /**< platform device structure */
struct pci_dev *pdev; /**< PCI device structure */
int pci_vendor; /**< PCI vendor id */
@@ -1091,12 +1094,20 @@ static inline int drm_mtrr_del(int handle, unsigned long offset,
}
#endif
+static inline int drm_core_is_platform(struct drm_device *dev)
+{
+ return drm_core_check_feature(dev, DRIVER_IS_PLATFORM);
+}
+
/******************************************************************/
/** \name Internal function definitions */
/*@{*/
/* Driver support (drm_drv.h) */
extern int drm_init(struct drm_driver *driver);
+extern int drm_platform_init(struct drm_driver *driver,
+ struct platform_device *pdev,
+ void *dev_private);
extern void drm_exit(struct drm_driver *driver);
extern int drm_ioctl(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
@@ -1314,6 +1325,8 @@ extern int drm_dropmaster_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv);
struct drm_master *drm_master_create(struct drm_minor *minor);
extern struct drm_master *drm_master_get(struct drm_master *master);
+extern int drm_get_platform_dev(struct platform_device *pdev,
+ struct drm_driver *driver, void *priv);
extern void drm_master_put(struct drm_master **master);
extern int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
struct drm_driver *driver);