summaryrefslogtreecommitdiff
path: root/bsd-core/drmP.h
diff options
context:
space:
mode:
Diffstat (limited to 'bsd-core/drmP.h')
-rw-r--r--bsd-core/drmP.h81
1 files changed, 41 insertions, 40 deletions
diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h
index c7e40230..affc0a8d 100644
--- a/bsd-core/drmP.h
+++ b/bsd-core/drmP.h
@@ -60,7 +60,6 @@ struct drm_file;
#include <sys/signalvar.h>
#include <sys/poll.h>
#include <sys/tree.h>
-#include <sys/taskqueue.h>
#include <vm/vm.h>
#include <vm/pmap.h>
#include <vm/vm_extern.h>
@@ -84,6 +83,7 @@ struct drm_file;
#include <sys/agpio.h>
#include <sys/mutex.h>
#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
#include <sys/selinfo.h>
#include <sys/bus.h>
@@ -208,15 +208,6 @@ enum {
#define DRM_MTRR_WC MDF_WRITECOMBINE
#define jiffies ticks
-/* Capabilities taken from src/sys/dev/pci/pcireg.h. */
-#ifndef PCIY_AGP
-#define PCIY_AGP 0x02
-#endif
-
-#ifndef PCIY_EXPRESS
-#define PCIY_EXPRESS 0x10
-#endif
-
typedef unsigned long dma_addr_t;
typedef u_int64_t u64;
typedef u_int32_t u32;
@@ -246,17 +237,23 @@ typedef u_int8_t u8;
#endif
#define DRM_READ8(map, offset) \
- *(volatile u_int8_t *) (((unsigned long)(map)->handle) + (offset))
+ *(volatile u_int8_t *)(((vm_offset_t)(map)->handle) + \
+ (vm_offset_t)(offset))
#define DRM_READ16(map, offset) \
- *(volatile u_int16_t *) (((unsigned long)(map)->handle) + (offset))
+ *(volatile u_int16_t *)(((vm_offset_t)(map)->handle) + \
+ (vm_offset_t)(offset))
#define DRM_READ32(map, offset) \
- *(volatile u_int32_t *)(((unsigned long)(map)->handle) + (offset))
+ *(volatile u_int32_t *)(((vm_offset_t)(map)->handle) + \
+ (vm_offset_t)(offset))
#define DRM_WRITE8(map, offset, val) \
- *(volatile u_int8_t *) (((unsigned long)(map)->handle) + (offset)) = val
+ *(volatile u_int8_t *)(((vm_offset_t)(map)->handle) + \
+ (vm_offset_t)(offset)) = val
#define DRM_WRITE16(map, offset, val) \
- *(volatile u_int16_t *) (((unsigned long)(map)->handle) + (offset)) = val
+ *(volatile u_int16_t *)(((vm_offset_t)(map)->handle) + \
+ (vm_offset_t)(offset)) = val
#define DRM_WRITE32(map, offset, val) \
- *(volatile u_int32_t *)(((unsigned long)(map)->handle) + (offset)) = val
+ *(volatile u_int32_t *)(((vm_offset_t)(map)->handle) + \
+ (vm_offset_t)(offset)) = val
#define DRM_VERIFYAREA_READ( uaddr, size ) \
(!useracc(__DECONST(caddr_t, uaddr), size, VM_PROT_READ))
@@ -299,22 +296,22 @@ for ( ret = 0 ; !ret && !(condition) ; ) { \
DRM_UNLOCK(); \
mtx_lock(&dev->irq_lock); \
if (!(condition)) \
- ret = -mtx_sleep(&(queue), &dev->irq_lock, \
- PZERO | PCATCH, "drmwtq", (timeout)); \
+ ret = -mtx_sleep(&(queue), &dev->irq_lock, \
+ PCATCH, "drmwtq", (timeout)); \
mtx_unlock(&dev->irq_lock); \
DRM_LOCK(); \
}
-#define DRM_ERROR(fmt, arg...) \
+#define DRM_ERROR(fmt, ...) \
printf("error: [" DRM_NAME ":pid%d:%s] *ERROR* " fmt, \
- DRM_CURRENTPID, __func__ , ## arg)
+ DRM_CURRENTPID, __func__ , ##__VA_ARGS__)
-#define DRM_INFO(fmt, arg...) printf("info: [" DRM_NAME "] " fmt , ## arg)
+#define DRM_INFO(fmt, ...) printf("info: [" DRM_NAME "] " fmt , ##__VA_ARGS__)
-#define DRM_DEBUG(fmt, arg...) do { \
+#define DRM_DEBUG(fmt, ...) do { \
if (drm_debug_flag) \
printf("[" DRM_NAME ":pid%d:%s] " fmt, DRM_CURRENTPID, \
- __func__ , ## arg); \
+ __func__ , ##__VA_ARGS__); \
} while (0)
typedef struct drm_pci_id_list
@@ -325,6 +322,12 @@ typedef struct drm_pci_id_list
char *name;
} drm_pci_id_list_t;
+struct drm_msi_blacklist_entry
+{
+ int vendor;
+ int device;
+};
+
#define DRM_AUTH 0x1
#define DRM_MASTER 0x2
#define DRM_ROOT_ONLY 0x4
@@ -470,11 +473,13 @@ typedef struct drm_agp_head {
} drm_agp_head_t;
typedef struct drm_sg_mem {
- unsigned long handle;
- void *virtual;
- int pages;
- dma_addr_t *busaddr;
- drm_dma_handle_t *dmah; /* Handle to PCI memory for ATI PCIGART table */
+ unsigned long handle;
+ void *virtual;
+ int pages;
+ dma_addr_t *busaddr;
+ struct drm_dma_handle *sg_dmah; /* Handle for sg_pages */
+ struct drm_dma_handle *dmah; /* Handle to PCI memory */
+ /* for ATI PCIGART table */
} drm_sg_mem_t;
typedef TAILQ_HEAD(drm_map_list, drm_local_map) drm_map_list_t;
@@ -605,7 +610,7 @@ struct drm_driver_info {
};
/* Length for the array of resource pointers for drm_get_resource_*. */
-#define DRM_MAX_PCI_RESOURCE 3
+#define DRM_MAX_PCI_RESOURCE 6
/**
* DRM device functions structure
@@ -631,7 +636,6 @@ struct drm_device {
struct mtx irq_lock; /* protects irq condition checks */
struct mtx dev_lock; /* protects everything else */
DRM_SPINTYPE drw_lock;
- DRM_SPINTYPE tsk_lock;
/* Usage Counters */
int open_count; /* Outstanding files open */
@@ -660,6 +664,7 @@ struct drm_device {
/* Context support */
int irq; /* Interrupt used by board */
int irq_enabled; /* True if the irq handler is enabled */
+ int msi_enabled; /* MSI enabled */
int irqrid; /* Interrupt used by board */
struct resource *irqr; /* Resource for interrupt used by board */
void *irqh; /* Handle from bus_setup_intr */
@@ -698,9 +703,6 @@ struct drm_device {
struct unrhdr *drw_unrhdr;
/* RB tree of drawable infos */
RB_HEAD(drawable_tree, bsd_drm_drawable_info) drw_head;
-
- struct task locked_task;
- void (*locked_task_call)(struct drm_device *dev);
};
static __inline__ int drm_core_check_feature(struct drm_device *dev,
@@ -721,10 +723,10 @@ static inline int drm_core_has_AGP(struct drm_device *dev)
extern int drm_debug_flag;
/* Device setup support (drm_drv.c) */
-int drm_probe(device_t nbdev, drm_pci_id_list_t *idlist);
-int drm_attach(device_t nbdev, drm_pci_id_list_t *idlist);
+int drm_probe(device_t kdev, drm_pci_id_list_t *idlist);
+int drm_attach(device_t kdev, drm_pci_id_list_t *idlist);
void drm_close(void *data);
-int drm_detach(device_t nbdev);
+int drm_detach(device_t kdev);
d_ioctl_t drm_ioctl;
d_open_t drm_open;
d_read_t drm_read;
@@ -795,6 +797,7 @@ void drm_handle_vblank(struct drm_device *dev, int crtc);
u32 drm_vblank_count(struct drm_device *dev, int crtc);
int drm_vblank_get(struct drm_device *dev, int crtc);
void drm_vblank_put(struct drm_device *dev, int crtc);
+void drm_vblank_cleanup(struct drm_device *dev);
int drm_vblank_wait(struct drm_device *dev, unsigned int *vbl_seq);
int drm_vblank_init(struct drm_device *dev, int num_crtcs);
void drm_vbl_send_signals(struct drm_device *dev, int crtc);
@@ -902,8 +905,8 @@ int drm_addmap_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv);
int drm_rmmap_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv);
-int drm_addbufs_ioctl(struct drm_device *dev, void *data,
- struct drm_file *file_priv);
+int drm_addbufs(struct drm_device *dev, void *data,
+ struct drm_file *file_priv);
int drm_infobufs(struct drm_device *dev, void *data,
struct drm_file *file_priv);
int drm_markbufs(struct drm_device *dev, void *data,
@@ -921,8 +924,6 @@ int drm_control(struct drm_device *dev, void *data,
struct drm_file *file_priv);
int drm_wait_vblank(struct drm_device *dev, void *data,
struct drm_file *file_priv);
-void drm_locked_tasklet(struct drm_device *dev,
- void (*tasklet)(struct drm_device *dev));
/* AGP/GART support (drm_agpsupport.c) */
int drm_agp_acquire_ioctl(struct drm_device *dev, void *data,