summaryrefslogtreecommitdiff
path: root/bsd-core/drmP.h
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2003-11-05 08:13:52 +0000
committerEric Anholt <anholt@freebsd.org>2003-11-05 08:13:52 +0000
commit66c9e3053f857df340a982edaa8ea57b229efeed (patch)
treef1ba7392f422b2687952f0242c6916d1ac766fea /bsd-core/drmP.h
parent19ee64add26773f4436440f8fa405a1011eea4c4 (diff)
- Tie the DRM to a specific device: setunique no longer succeeds when given
a busid that doesn't correspond to the device the DRM is attached to. This is a breaking of backwards-compatibility only for the multiple-DRI-head case with X Servers that don't use interface 1.1. - Move irq_busid to drm_irq.h and make it only return the IRQ for the current device. Retains compatibility with previous X Servers, cleans up unnecessary code. This means no irq_busid on !__HAVE_IRQ, but can be changed if necessary. - Bump interface version to 1.2. This version when set signifies that the control ioctl should ignore the irq number passed in and enable the interrupt handler for the attached device. Otherwise it errors out when the passed-in irq is not equal to the device's. - Store the highest version the interface has been set to in the device. - Fix a recursion on DRM_LOCK in irq_uninstall on FreeBSD. This leaves irq_uninstall being done without the lock in some cases, but it was racey anyways.
Diffstat (limited to 'bsd-core/drmP.h')
-rw-r--r--bsd-core/drmP.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h
index 4b7d737b..82a226a9 100644
--- a/bsd-core/drmP.h
+++ b/bsd-core/drmP.h
@@ -118,6 +118,8 @@ typedef struct drm_file drm_file_t;
#define DRM_MIN(a,b) ((a)<(b)?(a):(b))
#define DRM_MAX(a,b) ((a)>(b)?(a):(b))
+#define DRM_IF_VERSION(maj, min) (maj << 16 | min)
+
#define DRM_GET_PRIV_SAREA(_dev, _ctx, _map) do { \
(_map) = (_dev)->context_sareas[_ctx]; \
} while(0)
@@ -316,6 +318,7 @@ struct drm_device {
device_t device; /* Device instance from newbus */
#endif
dev_t devnode; /* Device number for mknod */
+ int if_version; /* Highest interface version set */
int flags; /* Flags to open(2) */
@@ -355,14 +358,21 @@ struct drm_device {
/* Context support */
int irq; /* Interrupt used by board */
- int irqrid; /* Interrupt used by board */
+ int irq_enabled; /* True if the irq handler is enabled */
#ifdef __FreeBSD__
+ int irqrid; /* Interrupt used by board */
struct resource *irqr; /* Resource for interrupt used by board */
#elif defined(__NetBSD__)
struct pci_attach_args pa;
pci_intr_handle_t ih;
#endif
void *irqh; /* Handle from bus_setup_intr */
+
+ int pci_domain;
+ int pci_bus;
+ int pci_slot;
+ int pci_func;
+
atomic_t context_flag; /* Context swapping flag */
int last_context; /* Last current context */
#if __FreeBSD_version >= 400005
@@ -445,7 +455,7 @@ extern void DRM(reclaim_buffers)(drm_device_t *dev, DRMFILE filp);
#if __HAVE_IRQ
/* IRQ support (drm_irq.h) */
-extern int DRM(irq_install)( drm_device_t *dev, int irq );
+extern int DRM(irq_install)(drm_device_t *dev);
extern int DRM(irq_uninstall)( drm_device_t *dev );
extern irqreturn_t DRM(irq_handler)( DRM_IRQ_ARGS );
extern void DRM(driver_irq_preinstall)( drm_device_t *dev );
@@ -494,7 +504,7 @@ extern int DRM(version)( DRM_IOCTL_ARGS );
extern int DRM(setversion)( DRM_IOCTL_ARGS );
/* Misc. IOCTL support (drm_ioctl.h) */
-extern int DRM(irq_busid)(DRM_IOCTL_ARGS);
+extern int DRM(irq_by_busid)(DRM_IOCTL_ARGS);
extern int DRM(getunique)(DRM_IOCTL_ARGS);
extern int DRM(setunique)(DRM_IOCTL_ARGS);
extern int DRM(getmap)(DRM_IOCTL_ARGS);