summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2009-04-03 15:22:32 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2009-04-03 15:22:32 +0000
commit9577ead76e75820d29bf0aa5ddd39cfdedebf97e (patch)
treef660c967bfd5d77a67d6f83067473f3ecd4cbec1
parent5bc4ab4c0eed76e1d46ac974e63bb5e388aac198 (diff)
detypedef drm_local_map.
-rw-r--r--sys/dev/pci/drm/drmP.h41
-rw-r--r--sys/dev/pci/drm/drm_bufs.c23
-rw-r--r--sys/dev/pci/drm/drm_drv.c12
-rw-r--r--sys/dev/pci/drm/drm_memory.c4
-rw-r--r--sys/dev/pci/drm/i915_drv.h4
-rw-r--r--sys/dev/pci/drm/mach64_drv.h10
-rw-r--r--sys/dev/pci/drm/mga_drv.h10
-rw-r--r--sys/dev/pci/drm/r128_drv.h8
-rw-r--r--sys/dev/pci/drm/radeon_cp.c6
-rw-r--r--sys/dev/pci/drm/radeon_drv.h8
-rw-r--r--sys/dev/pci/drm/savage_drv.h14
-rw-r--r--sys/dev/pci/drm/sis_drv.h2
12 files changed, 73 insertions, 69 deletions
diff --git a/sys/dev/pci/drm/drmP.h b/sys/dev/pci/drm/drmP.h
index 3777e95cb22..1cd39eae8e1 100644
--- a/sys/dev/pci/drm/drmP.h
+++ b/sys/dev/pci/drm/drmP.h
@@ -293,9 +293,7 @@ struct drm_sg_mem {
unsigned long handle;
};
-typedef TAILQ_HEAD(drm_map_list, drm_local_map) drm_map_list_t;
-
-typedef struct drm_local_map {
+struct drm_local_map {
TAILQ_ENTRY(drm_local_map) link; /* Link for map list */
struct drm_dmamem *dmamem;/* Handle to DMA mem */
void *handle;/* KVA, if mapped */
@@ -307,7 +305,7 @@ typedef struct drm_local_map {
int mtrr; /* Boolean: MTRR used */
enum drm_map_flags flags; /* Flags */
enum drm_map_type type; /* Type of memory mapped */
-} drm_local_map_t;
+};
struct drm_vblank {
u_int32_t last_vblank; /* Last vblank we recieved */
@@ -339,7 +337,7 @@ struct drm_mem {
#define upper_32_bits(_val) ((u_int32_t)(((_val) >> 16) >> 16))
struct drm_ati_pcigart_info {
- drm_local_map_t mapping;
+ struct drm_local_map mapping;
struct drm_dmamem *mem;
void *addr;
bus_addr_t bus_addr;
@@ -417,8 +415,9 @@ struct drm_device {
drm_magic_t magicid;
/* Linked list of mappable regions. Protected by dev_lock */
- struct extent *handle_ext;
- drm_map_list_t maplist;
+ struct extent *handle_ext;
+ TAILQ_HEAD(drm_map_list, drm_local_map) maplist;
+
struct drm_lock_data lock; /* Information on hardware lock */
@@ -443,7 +442,7 @@ struct drm_device {
struct drm_sg_mem *sg; /* Scatter gather memory */
atomic_t *ctx_bitmap;
void *dev_private;
- drm_local_map_t *agp_buffer_map;
+ struct drm_local_map *agp_buffer_map;
};
struct drm_attach_args {
@@ -466,10 +465,10 @@ dev_type_ioctl(drmioctl);
dev_type_open(drmopen);
dev_type_close(drmclose);
dev_type_mmap(drmmmap);
-extern drm_local_map_t *drm_getsarea(struct drm_device *);
+struct drm_local_map *drm_getsarea(struct drm_device *);
struct drm_dmamem *drm_dmamem_alloc(bus_dma_tag_t, bus_size_t, bus_size_t,
int, bus_size_t, int, int);
-void drm_dmamem_free(bus_dma_tag_t, struct drm_dmamem *);
+void drm_dmamem_free(bus_dma_tag_t, struct drm_dmamem *);
const struct drm_pcidev *drm_find_description(int , int ,
const struct drm_pcidev *);
@@ -482,8 +481,8 @@ void *drm_alloc(size_t);
void *drm_calloc(size_t, size_t);
void *drm_realloc(void *, size_t, size_t);
void drm_free(void *);
-void *drm_ioremap(struct drm_device *, drm_local_map_t *);
-void drm_ioremapfree(drm_local_map_t *);
+void *drm_ioremap(struct drm_device *, struct drm_local_map *);
+void drm_ioremapfree(struct drm_local_map *);
int drm_mtrr_add(unsigned long, size_t, int);
int drm_mtrr_del(int, unsigned long, size_t, int);
@@ -508,11 +507,11 @@ int drm_lock_free(struct drm_lock_data *, unsigned int);
/* Buffer management and DMA support (drm_bufs.c) */
int drm_order(unsigned long);
int drm_rmmap_ioctl(struct drm_device *, void *, struct drm_file *);
-void drm_rmmap(struct drm_device *, drm_local_map_t *);
-void drm_rmmap_locked(struct drm_device *, drm_local_map_t *);
+void drm_rmmap(struct drm_device *, struct drm_local_map *);
+void drm_rmmap_locked(struct drm_device *, struct drm_local_map *);
int drm_addmap_ioctl(struct drm_device *, void *, struct drm_file *);
int drm_addmap(struct drm_device *, unsigned long, unsigned long,
- enum drm_map_type, enum drm_map_flags, drm_local_map_t **);
+ enum drm_map_type, enum drm_map_flags, struct drm_local_map **);
int drm_addbufs(struct drm_device *, struct drm_buf_desc *);
int drm_freebufs(struct drm_device *, void *, struct drm_file *);
int drm_mapbufs(struct drm_device *, void *, struct drm_file *);
@@ -591,19 +590,23 @@ int drm_sg_free(struct drm_device *, void *, struct drm_file *);
/* Inline replacements for DRM_IOREMAP macros */
#define drm_core_ioremap_wc drm_core_ioremap
-static __inline__ void drm_core_ioremap(struct drm_local_map *map, struct drm_device *dev)
+static __inline__ void
+drm_core_ioremap(struct drm_local_map *map, struct drm_device *dev)
{
map->handle = drm_ioremap(dev, map);
}
-static __inline__ void drm_core_ioremapfree(struct drm_local_map *map)
+
+static __inline__ void
+drm_core_ioremapfree(struct drm_local_map *map)
{
if ( map->handle && map->size )
drm_ioremapfree(map);
}
-static __inline__ struct drm_local_map *drm_core_findmap(struct drm_device *dev, unsigned long offset)
+static __inline__ struct drm_local_map *
+drm_core_findmap(struct drm_device *dev, unsigned long offset)
{
- drm_local_map_t *map;
+ struct drm_local_map *map;
DRM_LOCK();
TAILQ_FOREACH(map, &dev->maplist, link) {
diff --git a/sys/dev/pci/drm/drm_bufs.c b/sys/dev/pci/drm/drm_bufs.c
index 8855aff1364..32a15d11f2b 100644
--- a/sys/dev/pci/drm/drm_bufs.c
+++ b/sys/dev/pci/drm/drm_bufs.c
@@ -61,13 +61,14 @@ drm_order(unsigned long size)
int
drm_addmap(struct drm_device * dev, unsigned long offset, unsigned long size,
- enum drm_map_type type, enum drm_map_flags flags, drm_local_map_t **map_ptr)
+ enum drm_map_type type, enum drm_map_flags flags,
+ struct drm_local_map **map_ptr)
{
- drm_local_map_t *map;
- int align, ret = 0;
+ struct drm_local_map *map;
+ int align, ret = 0;
#if 0 /* disabled for now */
- struct drm_agp_mem *entry;
- int valid;
+ struct drm_agp_mem *entry;
+ int valid;
#endif
/* Only allow shared memory to be removable since we only keep enough
@@ -247,7 +248,7 @@ int
drm_addmap_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
struct drm_map *request = data;
- drm_local_map_t *map;
+ struct drm_local_map *map;
int err;
if (!(file_priv->flags & (FREAD|FWRITE)))
@@ -271,7 +272,7 @@ drm_addmap_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv)
}
void
-drm_rmmap(struct drm_device *dev, drm_local_map_t *map)
+drm_rmmap(struct drm_device *dev, struct drm_local_map *map)
{
DRM_LOCK();
drm_rmmap_locked(dev, map);
@@ -280,7 +281,7 @@ drm_rmmap(struct drm_device *dev, drm_local_map_t *map)
void
-drm_rmmap_locked(struct drm_device *dev, drm_local_map_t *map)
+drm_rmmap_locked(struct drm_device *dev, struct drm_local_map *map)
{
TAILQ_REMOVE(&dev->maplist, map, link);
@@ -323,8 +324,8 @@ drm_rmmap_locked(struct drm_device *dev, drm_local_map_t *map)
int
drm_rmmap_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
- drm_local_map_t *map;
- struct drm_map *request = data;
+ struct drm_local_map *map;
+ struct drm_map *request = data;
DRM_LOCK();
TAILQ_FOREACH(map, &dev->maplist, link) {
@@ -931,7 +932,7 @@ drm_mapbufs(struct drm_device *dev, void *data, struct drm_file *file_priv)
(dma->flags & _DRM_DMA_USE_AGP)) ||
(dev->driver->flags & DRIVER_SG &&
(dma->flags & _DRM_DMA_USE_SG))) {
- drm_local_map_t *map = dev->agp_buffer_map;
+ struct drm_local_map *map = dev->agp_buffer_map;
if (map == NULL) {
DRM_DEBUG("couldn't find agp buffer map\n");
diff --git a/sys/dev/pci/drm/drm_drv.c b/sys/dev/pci/drm/drm_drv.c
index 76835f4838c..51b9ab59c63 100644
--- a/sys/dev/pci/drm/drm_drv.c
+++ b/sys/dev/pci/drm/drm_drv.c
@@ -274,8 +274,8 @@ drm_find_file_by_minor(struct drm_device *dev, int minor)
int
drm_firstopen(struct drm_device *dev)
{
- drm_local_map_t *map;
- int i;
+ struct drm_local_map *map;
+ int i;
/* prebuild the SAREA */
i = drm_addmap(dev, 0, SAREA_MAX, _DRM_SHM,
@@ -306,7 +306,7 @@ drm_firstopen(struct drm_device *dev)
int
drm_lastclose(struct drm_device *dev)
{
- drm_local_map_t *map, *mapsave;
+ struct drm_local_map *map, *mapsave;
DRM_DEBUG("\n");
@@ -661,10 +661,10 @@ drmioctl(dev_t kdev, u_long cmd, caddr_t data, int flags,
return (EINVAL);
}
-drm_local_map_t *
+struct drm_local_map *
drm_getsarea(struct drm_device *dev)
{
- drm_local_map_t *map;
+ struct drm_local_map *map;
DRM_LOCK();
TAILQ_FOREACH(map, &dev->maplist, link) {
@@ -679,7 +679,7 @@ paddr_t
drmmmap(dev_t kdev, off_t offset, int prot)
{
struct drm_device *dev = drm_get_device_from_kdev(kdev);
- drm_local_map_t *map;
+ struct drm_local_map *map;
struct drm_file *priv;
enum drm_map_type type;
diff --git a/sys/dev/pci/drm/drm_memory.c b/sys/dev/pci/drm/drm_memory.c
index 19aef71aded..3194c235e92 100644
--- a/sys/dev/pci/drm/drm_memory.c
+++ b/sys/dev/pci/drm/drm_memory.c
@@ -76,7 +76,7 @@ drm_free(void *pt)
}
void *
-drm_ioremap(struct drm_device *dev, drm_local_map_t *map)
+drm_ioremap(struct drm_device *dev, struct drm_local_map *map)
{
DRM_DEBUG("offset: 0x%x size: 0x%x type: %d\n", map->offset, map->size,
map->type);
@@ -102,7 +102,7 @@ drm_ioremap(struct drm_device *dev, drm_local_map_t *map)
}
void
-drm_ioremapfree(drm_local_map_t *map)
+drm_ioremapfree(struct drm_local_map *map)
{
if (map == NULL || (map->type != _DRM_AGP && map->type !=
_DRM_FRAME_BUFFER))
diff --git a/sys/dev/pci/drm/i915_drv.h b/sys/dev/pci/drm/i915_drv.h
index c324b1f55ac..659d575253f 100644
--- a/sys/dev/pci/drm/i915_drv.h
+++ b/sys/dev/pci/drm/i915_drv.h
@@ -85,11 +85,11 @@ typedef struct drm_i915_private {
struct vga_pci_bar *regs;
- drm_local_map_t *sarea;
+ struct drm_local_map *sarea;
drm_i915_sarea_t *sarea_priv;
struct inteldrm_ring ring;
- drm_local_map_t hws_map;
+ struct drm_local_map hws_map;
struct drm_dmamem *hws_dmamem;
void *hw_status_page;
unsigned int status_gfx_addr;
diff --git a/sys/dev/pci/drm/mach64_drv.h b/sys/dev/pci/drm/mach64_drv.h
index 977fc01e87f..ac717b532e0 100644
--- a/sys/dev/pci/drm/mach64_drv.h
+++ b/sys/dev/pci/drm/mach64_drv.h
@@ -110,11 +110,11 @@ typedef struct drm_mach64_private {
u32 back_offset_pitch;
u32 depth_offset_pitch;
- drm_local_map_t *sarea;
- drm_local_map_t *fb;
- drm_local_map_t *ring_map;
- drm_local_map_t *dev_buffers; /* this is a pointer to a structure in dev */
- drm_local_map_t *agp_textures;
+ struct drm_local_map *sarea;
+ struct drm_local_map *fb;
+ struct drm_local_map *ring_map;
+ struct drm_local_map *dev_buffers; /* this is a pointer to a structure in dev */
+ struct drm_local_map *agp_textures;
} drm_mach64_private_t;
/* mach64_dma.c */
diff --git a/sys/dev/pci/drm/mga_drv.h b/sys/dev/pci/drm/mga_drv.h
index dae0d19c80e..198b1366a43 100644
--- a/sys/dev/pci/drm/mga_drv.h
+++ b/sys/dev/pci/drm/mga_drv.h
@@ -137,11 +137,11 @@ typedef struct drm_mga_private {
unsigned int texture_offset;
unsigned int texture_size;
- drm_local_map_t *sarea;
- drm_local_map_t *status;
- drm_local_map_t *warp;
- drm_local_map_t *primary;
- drm_local_map_t *agp_textures;
+ struct drm_local_map *sarea;
+ struct drm_local_map *status;
+ struct drm_local_map *warp;
+ struct drm_local_map *primary;
+ struct drm_local_map *agp_textures;
unsigned long agp_handle;
unsigned int agp_size;
diff --git a/sys/dev/pci/drm/r128_drv.h b/sys/dev/pci/drm/r128_drv.h
index 6ba5ae8f89a..6e69ef2236d 100644
--- a/sys/dev/pci/drm/r128_drv.h
+++ b/sys/dev/pci/drm/r128_drv.h
@@ -123,10 +123,10 @@ typedef struct drm_r128_private {
u32 depth_pitch_offset_c;
u32 span_pitch_offset_c;
- drm_local_map_t *sarea;
- drm_local_map_t *cce_ring;
- drm_local_map_t *ring_rptr;
- drm_local_map_t *agp_textures;
+ struct drm_local_map *sarea;
+ struct drm_local_map *cce_ring;
+ struct drm_local_map *ring_rptr;
+ struct drm_local_map *agp_textures;
struct drm_ati_pcigart_info gart_info;
} drm_r128_private_t;
diff --git a/sys/dev/pci/drm/radeon_cp.c b/sys/dev/pci/drm/radeon_cp.c
index 796ca86dbc9..e62cef3afa3 100644
--- a/sys/dev/pci/drm/radeon_cp.c
+++ b/sys/dev/pci/drm/radeon_cp.c
@@ -1649,9 +1649,9 @@ radeon_cp_buffers(struct drm_device *dev, struct drm_dma * d,
int
radeon_driver_firstopen(struct drm_device *dev)
{
- int ret;
- drm_local_map_t *map;
- drm_radeon_private_t *dev_priv = dev->dev_private;
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+ struct drm_local_map *map;
+ int ret;
dev_priv->gart_info.table_size = RADEON_PCIGART_TABLE_SIZE;
diff --git a/sys/dev/pci/drm/radeon_drv.h b/sys/dev/pci/drm/radeon_drv.h
index 91ce40568e8..c13084a761e 100644
--- a/sys/dev/pci/drm/radeon_drv.h
+++ b/sys/dev/pci/drm/radeon_drv.h
@@ -259,10 +259,10 @@ typedef struct drm_radeon_private {
unsigned long buffers_offset;
unsigned long gart_textures_offset;
- drm_local_map_t *sarea;
- drm_local_map_t *cp_ring;
- drm_local_map_t *ring_rptr;
- drm_local_map_t *gart_textures;
+ struct drm_local_map *sarea;
+ struct drm_local_map *cp_ring;
+ struct drm_local_map *ring_rptr;
+ struct drm_local_map *gart_textures;
struct drm_heap gart_heap;
struct drm_heap fb_heap;
diff --git a/sys/dev/pci/drm/savage_drv.h b/sys/dev/pci/drm/savage_drv.h
index a82ccc5016f..cd0609b8004 100644
--- a/sys/dev/pci/drm/savage_drv.h
+++ b/sys/dev/pci/drm/savage_drv.h
@@ -156,13 +156,13 @@ typedef struct drm_savage_private {
unsigned int texture_size;
/* memory regions in physical memory */
- drm_local_map_t *sarea;
- drm_local_map_t *fb;
- drm_local_map_t *aperture;
- drm_local_map_t *status;
- drm_local_map_t *agp_textures;
- drm_local_map_t *cmd_dma;
- drm_local_map_t fake_dma;
+ struct drm_local_map *sarea;
+ struct drm_local_map *fb;
+ struct drm_local_map *aperture;
+ struct drm_local_map *status;
+ struct drm_local_map *agp_textures;
+ struct drm_local_map *cmd_dma;
+ struct drm_local_map fake_dma;
struct {
int handle;
diff --git a/sys/dev/pci/drm/sis_drv.h b/sys/dev/pci/drm/sis_drv.h
index 7b6b16a9dba..375acc53187 100644
--- a/sys/dev/pci/drm/sis_drv.h
+++ b/sys/dev/pci/drm/sis_drv.h
@@ -56,7 +56,7 @@ enum sis_family {
#define SIS_WRITE(reg, val) DRM_WRITE32(SIS_BASE, reg, val);
typedef struct drm_sis_private {
- drm_local_map_t *mmio;
+ struct drm_local_map *mmio;
unsigned int idle_fault;
struct drm_sman sman;
unsigned int chipset;