summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2009-04-07 00:10:32 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2009-04-07 00:10:32 +0000
commitaa64d5143fd08eaca8771188bb2ce1bcb3fd70d0 (patch)
treee59f266053cb10f630a36d3da1971acd3cd3c81a
parentf40b52712db701a1b0cc0f455d64411618181a01 (diff)
Remove some dead and if 0ed out code in the ragedrm freelist, while i'm here
detypedef the buf_priv structure and do a little cleanup.
-rw-r--r--sys/dev/pci/drm/r128_cce.c67
-rw-r--r--sys/dev/pci/drm/r128_drv.c2
-rw-r--r--sys/dev/pci/drm/r128_drv.h23
-rw-r--r--sys/dev/pci/drm/r128_state.c347
4 files changed, 207 insertions, 232 deletions
diff --git a/sys/dev/pci/drm/r128_cce.c b/sys/dev/pci/drm/r128_cce.c
index 3b04dd03d42..5f923c17c22 100644
--- a/sys/dev/pci/drm/r128_cce.c
+++ b/sys/dev/pci/drm/r128_cce.c
@@ -715,62 +715,15 @@ int r128_fullscreen(struct drm_device *dev, void *data, struct drm_file *file_pr
/* ================================================================
* Freelist management
*/
-#define R128_BUFFER_USED 0xffffffff
-#define R128_BUFFER_FREE 0
-#if 0
-static int r128_freelist_init(struct drm_device * dev)
+static struct drm_buf *
+r128_freelist_get(struct drm_device * dev)
{
- struct drm_device_dma *dma = dev->dma;
- drm_r128_private_t *dev_priv = dev->dev_private;
- struct drm_buf *buf;
- drm_r128_buf_priv_t *buf_priv;
- drm_r128_freelist_t *entry;
- int i;
-
- dev_priv->head = drm_calloc(1, sizeof(*dev_priv->head));
- if (dev_priv->head == NULL)
- return ENOMEM;
-
- dev_priv->head->age = R128_BUFFER_USED;
-
- for (i = 0; i < dma->buf_count; i++) {
- buf = dma->buflist[i];
- buf_priv = buf->dev_private;
-
- entry = drm_alloc(sizeof(*entry));
- if (!entry)
- return ENOMEM;
-
- entry->age = R128_BUFFER_FREE;
- entry->buf = buf;
- entry->prev = dev_priv->head;
- entry->next = dev_priv->head->next;
- if (!entry->next)
- dev_priv->tail = entry;
-
- buf_priv->discard = 0;
- buf_priv->dispatched = 0;
- buf_priv->list_entry = entry;
-
- dev_priv->head->next = entry;
-
- if (dev_priv->head->next)
- dev_priv->head->next->prev = entry;
- }
-
- return 0;
-
-}
-#endif
-
-static struct drm_buf *r128_freelist_get(struct drm_device * dev)
-{
- struct drm_device_dma *dma = dev->dma;
- drm_r128_private_t *dev_priv = dev->dev_private;
- drm_r128_buf_priv_t *buf_priv;
- struct drm_buf *buf;
- int i, t;
+ struct drm_device_dma *dma = dev->dma;
+ drm_r128_private_t *dev_priv = dev->dev_private;
+ struct ragedrm_buf_priv *buf_priv;
+ struct drm_buf *buf;
+ int i, t;
/* FIXME: Optimize -- use freelist code */
@@ -802,14 +755,16 @@ static struct drm_buf *r128_freelist_get(struct drm_device * dev)
return NULL;
}
-void r128_freelist_reset(struct drm_device * dev)
+void
+r128_freelist_reset(struct drm_device * dev)
{
struct drm_device_dma *dma = dev->dma;
int i;
for (i = 0; i < dma->buf_count; i++) {
struct drm_buf *buf = dma->buflist[i];
- drm_r128_buf_priv_t *buf_priv = buf->dev_private;
+ struct ragedrm_buf_priv *buf_priv = buf->dev_private;
+
buf_priv->age = 0;
}
}
diff --git a/sys/dev/pci/drm/r128_drv.c b/sys/dev/pci/drm/r128_drv.c
index 2b5cc90c973..60eede993ec 100644
--- a/sys/dev/pci/drm/r128_drv.c
+++ b/sys/dev/pci/drm/r128_drv.c
@@ -83,7 +83,7 @@ const static struct drm_pcidev ragedrm_pciidlist[] = {
};
static const struct drm_driver_info ragedrm_driver = {
- .buf_priv_size = sizeof(drm_r128_buf_priv_t),
+ .buf_priv_size = sizeof(struct ragedrm_buf_priv),
.ioctl = ragedrm_ioctl,
.close = r128_driver_close,
.lastclose = r128_driver_lastclose,
diff --git a/sys/dev/pci/drm/r128_drv.h b/sys/dev/pci/drm/r128_drv.h
index 6e69ef2236d..26538f052b3 100644
--- a/sys/dev/pci/drm/r128_drv.h
+++ b/sys/dev/pci/drm/r128_drv.h
@@ -55,13 +55,6 @@
#define GET_RING_HEAD(dev_priv) R128_READ( R128_PM4_BUFFER_DL_RPTR )
-typedef struct drm_r128_freelist {
- unsigned int age;
- struct drm_buf *buf;
- struct drm_r128_freelist *next;
- struct drm_r128_freelist *prev;
-} drm_r128_freelist_t;
-
typedef struct drm_r128_ring_buffer {
u32 *start;
u32 *end;
@@ -91,9 +84,6 @@ typedef struct drm_r128_private {
int cce_fifo_size;
int cce_running;
- drm_r128_freelist_t *head;
- drm_r128_freelist_t *tail;
-
int usec_timeout;
int is_pci;
unsigned long cce_buffers_offset;
@@ -130,13 +120,12 @@ typedef struct drm_r128_private {
struct drm_ati_pcigart_info gart_info;
} drm_r128_private_t;
-typedef struct drm_r128_buf_priv {
- u32 age;
- int prim;
- int discard;
- int dispatched;
- drm_r128_freelist_t *list_entry;
-} drm_r128_buf_priv_t;
+struct ragedrm_buf_priv {
+ u_int32_t age;
+ int prim;
+ int discard;
+ int dispatched;
+};
/* r128_cce.c */
extern int r128_cce_init(struct drm_device *dev, void *data, struct drm_file *file_priv);
diff --git a/sys/dev/pci/drm/r128_state.c b/sys/dev/pci/drm/r128_state.c
index a9fff384d5f..096b4df3c80 100644
--- a/sys/dev/pci/drm/r128_state.c
+++ b/sys/dev/pci/drm/r128_state.c
@@ -37,10 +37,11 @@
* CCE hardware state programming functions
*/
-static void r128_emit_clip_rects(drm_r128_private_t * dev_priv,
- struct drm_clip_rect * boxes, int count)
+static void
+r128_emit_clip_rects(drm_r128_private_t *dev_priv,
+ struct drm_clip_rect *boxes, int count)
{
- u32 aux_sc_cntl = 0x00000000;
+ u_int32_t aux_sc_cntl = 0x00000000;
RING_LOCALS;
DRM_DEBUG("\n");
@@ -80,10 +81,11 @@ static void r128_emit_clip_rects(drm_r128_private_t * dev_priv,
ADVANCE_RING();
}
-static __inline__ void r128_emit_core(drm_r128_private_t * dev_priv)
+static __inline__ void
+r128_emit_core(drm_r128_private_t * dev_priv)
{
- drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
- drm_r128_context_regs_t *ctx = &sarea_priv->context_state;
+ drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
+ drm_r128_context_regs_t *ctx = &sarea_priv->context_state;
RING_LOCALS;
DRM_DEBUG("\n");
@@ -95,10 +97,11 @@ static __inline__ void r128_emit_core(drm_r128_private_t * dev_priv)
ADVANCE_RING();
}
-static __inline__ void r128_emit_context(drm_r128_private_t * dev_priv)
+static __inline__ void
+r128_emit_context(drm_r128_private_t * dev_priv)
{
- drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
- drm_r128_context_regs_t *ctx = &sarea_priv->context_state;
+ drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
+ drm_r128_context_regs_t *ctx = &sarea_priv->context_state;
RING_LOCALS;
DRM_DEBUG("\n");
@@ -121,10 +124,11 @@ static __inline__ void r128_emit_context(drm_r128_private_t * dev_priv)
ADVANCE_RING();
}
-static __inline__ void r128_emit_setup(drm_r128_private_t * dev_priv)
+static __inline__ void
+r128_emit_setup(drm_r128_private_t * dev_priv)
{
- drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
- drm_r128_context_regs_t *ctx = &sarea_priv->context_state;
+ drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
+ drm_r128_context_regs_t *ctx = &sarea_priv->context_state;
RING_LOCALS;
DRM_DEBUG("\n");
@@ -137,10 +141,11 @@ static __inline__ void r128_emit_setup(drm_r128_private_t * dev_priv)
ADVANCE_RING();
}
-static __inline__ void r128_emit_masks(drm_r128_private_t * dev_priv)
+static __inline__ void
+r128_emit_masks(drm_r128_private_t * dev_priv)
{
- drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
- drm_r128_context_regs_t *ctx = &sarea_priv->context_state;
+ drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
+ drm_r128_context_regs_t *ctx = &sarea_priv->context_state;
RING_LOCALS;
DRM_DEBUG("\n");
@@ -156,10 +161,11 @@ static __inline__ void r128_emit_masks(drm_r128_private_t * dev_priv)
ADVANCE_RING();
}
-static __inline__ void r128_emit_window(drm_r128_private_t * dev_priv)
+static __inline__ void
+r128_emit_window(drm_r128_private_t * dev_priv)
{
- drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
- drm_r128_context_regs_t *ctx = &sarea_priv->context_state;
+ drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
+ drm_r128_context_regs_t *ctx = &sarea_priv->context_state;
RING_LOCALS;
DRM_DEBUG("\n");
@@ -171,12 +177,13 @@ static __inline__ void r128_emit_window(drm_r128_private_t * dev_priv)
ADVANCE_RING();
}
-static __inline__ void r128_emit_tex0(drm_r128_private_t * dev_priv)
+static __inline__ void
+r128_emit_tex0(drm_r128_private_t * dev_priv)
{
- drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
- drm_r128_context_regs_t *ctx = &sarea_priv->context_state;
- drm_r128_texture_regs_t *tex = &sarea_priv->tex_state[0];
- int i;
+ drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
+ drm_r128_context_regs_t *ctx = &sarea_priv->context_state;
+ drm_r128_texture_regs_t *tex = &sarea_priv->tex_state[0];
+ int i;
RING_LOCALS;
DRM_DEBUG("\n");
@@ -198,10 +205,11 @@ static __inline__ void r128_emit_tex0(drm_r128_private_t * dev_priv)
ADVANCE_RING();
}
-static __inline__ void r128_emit_tex1(drm_r128_private_t * dev_priv)
+static __inline__ void
+r128_emit_tex1(drm_r128_private_t * dev_priv)
{
- drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
- drm_r128_texture_regs_t *tex = &sarea_priv->tex_state[1];
+ drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
+ drm_r128_texture_regs_t *tex = &sarea_priv->tex_state[1];
int i;
RING_LOCALS;
DRM_DEBUG("\n");
@@ -221,10 +229,11 @@ static __inline__ void r128_emit_tex1(drm_r128_private_t * dev_priv)
ADVANCE_RING();
}
-static void r128_emit_state(drm_r128_private_t * dev_priv)
+static void
+r128_emit_state(drm_r128_private_t * dev_priv)
{
- drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
- unsigned int dirty = sarea_priv->dirty;
+ drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
+ unsigned int dirty = sarea_priv->dirty;
DRM_DEBUG("dirty=0x%08x\n", dirty);
@@ -273,7 +282,8 @@ static void r128_emit_state(drm_r128_private_t * dev_priv)
* CCE command dispatch functions
*/
-static void r128_print_dirty(drm_r128_private_t *dev_priv, const char *msg,
+static void
+r128_print_dirty(drm_r128_private_t *dev_priv, const char *msg,
unsigned int flags)
{
DRM_INFO("%s: (0x%x) %s%s%s%s%s%s%s%s%s\n",
@@ -290,15 +300,14 @@ static void r128_print_dirty(drm_r128_private_t *dev_priv, const char *msg,
(flags & R128_REQUIRE_QUIESCENCE) ? "quiescence, " : "");
}
-static void r128_cce_dispatch_clear(struct drm_device * dev,
- drm_r128_clear_t * clear)
+static void
+r128_cce_dispatch_clear(struct drm_device * dev, drm_r128_clear_t * clear)
{
- drm_r128_private_t *dev_priv = dev->dev_private;
- drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
- int nbox = sarea_priv->nbox;
- struct drm_clip_rect *pbox = sarea_priv->boxes;
- unsigned int flags = clear->flags;
- int i;
+ drm_r128_private_t *dev_priv = dev->dev_private;
+ drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
+ struct drm_clip_rect *pbox = sarea_priv->boxes;
+ int i, nbox = sarea_priv->nbox;
+ unsigned int flags = clear->flags;
RING_LOCALS;
DRM_DEBUG("\n");
@@ -396,13 +405,14 @@ static void r128_cce_dispatch_clear(struct drm_device * dev,
}
}
-static void r128_cce_dispatch_swap(struct drm_device * dev)
+static void
+r128_cce_dispatch_swap(struct drm_device *dev)
{
- drm_r128_private_t *dev_priv = dev->dev_private;
- drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
- int nbox = sarea_priv->nbox;
- struct drm_clip_rect *pbox = sarea_priv->boxes;
- int i;
+ drm_r128_private_t *dev_priv = dev->dev_private;
+ drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
+ int nbox = sarea_priv->nbox;
+ struct drm_clip_rect *pbox = sarea_priv->boxes;
+ int i;
RING_LOCALS;
DRM_DEBUG("\n");
@@ -456,9 +466,10 @@ static void r128_cce_dispatch_swap(struct drm_device * dev)
ADVANCE_RING();
}
-static void r128_cce_dispatch_flip(struct drm_device * dev)
+static void
+r128_cce_dispatch_flip(struct drm_device * dev)
{
- drm_r128_private_t *dev_priv = dev->dev_private;
+ drm_r128_private_t *dev_priv = dev->dev_private;
RING_LOCALS;
DRM_DEBUG("page=%d pfCurrentPage=%d\n",
dev_priv->current_page, dev_priv->sarea_priv->pfCurrentPage);
@@ -492,16 +503,17 @@ static void r128_cce_dispatch_flip(struct drm_device * dev)
ADVANCE_RING();
}
-static void r128_cce_dispatch_vertex(struct drm_device * dev, struct drm_buf * buf)
+static void
+r128_cce_dispatch_vertex(struct drm_device * dev, struct drm_buf * buf)
{
- drm_r128_private_t *dev_priv = dev->dev_private;
- drm_r128_buf_priv_t *buf_priv = buf->dev_private;
- drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
- int format = sarea_priv->vc_format;
- int offset = buf->bus_address;
- int size = buf->used;
- int prim = buf_priv->prim;
- int i = 0;
+ drm_r128_private_t *dev_priv = dev->dev_private;
+ struct ragedrm_buf_priv *buf_priv = buf->dev_private;
+ drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
+ int format = sarea_priv->vc_format;
+ int offset = buf->bus_address;
+ int size = buf->used;
+ int prim = buf_priv->prim;
+ int i = 0;
RING_LOCALS;
DRM_DEBUG("buf=%d nbox=%d\n", buf->idx, sarea_priv->nbox);
@@ -563,11 +575,12 @@ static void r128_cce_dispatch_vertex(struct drm_device * dev, struct drm_buf * b
sarea_priv->nbox = 0;
}
-static void r128_cce_dispatch_indirect(struct drm_device * dev,
- struct drm_buf * buf, int start, int end)
+static void
+r128_cce_dispatch_indirect(struct drm_device * dev, struct drm_buf * buf,
+ int start, int end)
{
- drm_r128_private_t *dev_priv = dev->dev_private;
- drm_r128_buf_priv_t *buf_priv = buf->dev_private;
+ drm_r128_private_t *dev_priv = dev->dev_private;
+ struct ragedrm_buf_priv *buf_priv = buf->dev_private;
RING_LOCALS;
DRM_DEBUG("indirect: buf=%d s=0x%x e=0x%x\n", buf->idx, start, end);
@@ -618,19 +631,20 @@ static void r128_cce_dispatch_indirect(struct drm_device * dev,
dev_priv->sarea_priv->last_dispatch++;
}
-static void r128_cce_dispatch_indices(struct drm_device * dev,
- struct drm_buf * buf,
- int start, int end, int count)
+static void
+r128_cce_dispatch_indices(struct drm_device * dev, struct drm_buf * buf,
+ int start, int end, int count)
{
- drm_r128_private_t *dev_priv = dev->dev_private;
- drm_r128_buf_priv_t *buf_priv = buf->dev_private;
- drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
- int format = sarea_priv->vc_format;
- int offset = dev->agp_buffer_map->offset - dev_priv->cce_buffers_offset;
- int prim = buf_priv->prim;
- u32 *data;
- int dwords;
- int i = 0;
+ drm_r128_private_t *dev_priv = dev->dev_private;
+ struct ragedrm_buf_priv *buf_priv = buf->dev_private;
+ drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
+ u_int32_t *data;
+ int format = sarea_priv->vc_format;
+ int prim = buf_priv->prim;
+ int offset = dev->agp_buffer_map->offset -
+ dev_priv->cce_buffers_offset;
+ int dwords;
+ int i = 0;
RING_LOCALS;
DRM_DEBUG("indices: s=%d e=%d c=%d\n", start, end, count);
@@ -703,16 +717,16 @@ static void r128_cce_dispatch_indices(struct drm_device * dev,
sarea_priv->nbox = 0;
}
-static int r128_cce_dispatch_blit(struct drm_device * dev,
- struct drm_file *file_priv,
- drm_r128_blit_t * blit)
+static int
+r128_cce_dispatch_blit(struct drm_device * dev, struct drm_file *file_priv,
+ drm_r128_blit_t * blit)
{
- drm_r128_private_t *dev_priv = dev->dev_private;
- struct drm_device_dma *dma = dev->dma;
- struct drm_buf *buf;
- drm_r128_buf_priv_t *buf_priv;
- u32 *data;
- int dword_shift, dwords;
+ drm_r128_private_t *dev_priv = dev->dev_private;
+ struct drm_device_dma *dma = dev->dma;
+ struct drm_buf *buf;
+ struct ragedrm_buf_priv *buf_priv;
+ u_int32_t *data;
+ int dword_shift, dwords;
RING_LOCALS;
DRM_DEBUG("\n");
@@ -815,14 +829,14 @@ static int r128_cce_dispatch_blit(struct drm_device * dev,
* have hardware stencil support.
*/
-static int r128_cce_dispatch_write_span(struct drm_device * dev,
- drm_r128_depth_t * depth)
+static int
+r128_cce_dispatch_write_span(struct drm_device * dev, drm_r128_depth_t * depth)
{
- drm_r128_private_t *dev_priv = dev->dev_private;
- int count, x, y;
- u32 *buffer;
- u8 *mask;
- int i, buffer_size, mask_size;
+ drm_r128_private_t *dev_priv = dev->dev_private;
+ int count, x, y;
+ u_int32_t *buffer;
+ u_int8_t *mask;
+ int i, buffer_size, mask_size;
RING_LOCALS;
DRM_DEBUG("\n");
@@ -911,14 +925,15 @@ static int r128_cce_dispatch_write_span(struct drm_device * dev,
return 0;
}
-static int r128_cce_dispatch_write_pixels(struct drm_device * dev,
- drm_r128_depth_t * depth)
+static int
+r128_cce_dispatch_write_pixels(struct drm_device * dev,
+ drm_r128_depth_t * depth)
{
- drm_r128_private_t *dev_priv = dev->dev_private;
- int count, *x, *y;
- u32 *buffer;
- u8 *mask;
- int i, xbuf_size, ybuf_size, buffer_size, mask_size;
+ drm_r128_private_t *dev_priv = dev->dev_private;
+ u_int32_t *buffer;
+ u_int8_t *mask;
+ int i, xbuf_size, ybuf_size, buffer_size;
+ int count, *x, *y, mask_size;
RING_LOCALS;
DRM_DEBUG("\n");
@@ -1033,11 +1048,11 @@ static int r128_cce_dispatch_write_pixels(struct drm_device * dev,
return 0;
}
-static int r128_cce_dispatch_read_span(struct drm_device * dev,
- drm_r128_depth_t * depth)
+static int
+r128_cce_dispatch_read_span(struct drm_device * dev, drm_r128_depth_t * depth)
{
- drm_r128_private_t *dev_priv = dev->dev_private;
- int count, x, y;
+ drm_r128_private_t *dev_priv = dev->dev_private;
+ int count, x, y;
RING_LOCALS;
DRM_DEBUG("\n");
@@ -1076,12 +1091,11 @@ static int r128_cce_dispatch_read_span(struct drm_device * dev,
return 0;
}
-static int r128_cce_dispatch_read_pixels(struct drm_device * dev,
- drm_r128_depth_t * depth)
+static int
+r128_cce_dispatch_read_pixels(struct drm_device * dev, drm_r128_depth_t * depth)
{
- drm_r128_private_t *dev_priv = dev->dev_private;
- int count, *x, *y;
- int i, xbuf_size, ybuf_size;
+ drm_r128_private_t *dev_priv = dev->dev_private;
+ int count, *x, *y, i, xbuf_size, ybuf_size;
RING_LOCALS;
DRM_DEBUG("\n");
@@ -1148,10 +1162,11 @@ static int r128_cce_dispatch_read_pixels(struct drm_device * dev,
* Polygon stipple
*/
-static void r128_cce_dispatch_stipple(struct drm_device * dev, u32 * stipple)
+static void
+r128_cce_dispatch_stipple(struct drm_device * dev, u32 * stipple)
{
- drm_r128_private_t *dev_priv = dev->dev_private;
- int i;
+ drm_r128_private_t *dev_priv = dev->dev_private;
+ int i;
RING_LOCALS;
DRM_DEBUG("\n");
@@ -1169,11 +1184,12 @@ static void r128_cce_dispatch_stipple(struct drm_device * dev, u32 * stipple)
* IOCTL functions
*/
-int r128_cce_clear(struct drm_device *dev, void *data, struct drm_file *file_priv)
+int
+r128_cce_clear(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
- drm_r128_private_t *dev_priv = dev->dev_private;
- drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
- drm_r128_clear_t *clear = data;
+ drm_r128_private_t *dev_priv = dev->dev_private;
+ drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
+ drm_r128_clear_t *clear = data;
DRM_DEBUG("\n");
LOCK_TEST_WITH_RETURN(dev, file_priv);
@@ -1193,9 +1209,10 @@ int r128_cce_clear(struct drm_device *dev, void *data, struct drm_file *file_pri
return 0;
}
-static int r128_do_init_pageflip(struct drm_device * dev)
+static int
+r128_do_init_pageflip(struct drm_device * dev)
{
- drm_r128_private_t *dev_priv = dev->dev_private;
+ drm_r128_private_t *dev_priv = dev->dev_private;
DRM_DEBUG("\n");
dev_priv->crtc_offset = R128_READ(R128_CRTC_OFFSET);
@@ -1212,9 +1229,10 @@ static int r128_do_init_pageflip(struct drm_device * dev)
return 0;
}
-static int r128_do_cleanup_pageflip(struct drm_device * dev)
+static int
+r128_do_cleanup_pageflip(struct drm_device * dev)
{
- drm_r128_private_t *dev_priv = dev->dev_private;
+ drm_r128_private_t *dev_priv = dev->dev_private;
DRM_DEBUG("\n");
R128_WRITE(R128_CRTC_OFFSET, dev_priv->crtc_offset);
@@ -1233,9 +1251,10 @@ static int r128_do_cleanup_pageflip(struct drm_device * dev)
* They can & should be intermixed to support multiple 3d windows.
*/
-int r128_cce_flip(struct drm_device *dev, void *data, struct drm_file *file_priv)
+int
+r128_cce_flip(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
- drm_r128_private_t *dev_priv = dev->dev_private;
+ drm_r128_private_t *dev_priv = dev->dev_private;
DRM_DEBUG("\n");
LOCK_TEST_WITH_RETURN(dev, file_priv);
@@ -1251,10 +1270,11 @@ int r128_cce_flip(struct drm_device *dev, void *data, struct drm_file *file_priv
return 0;
}
-int r128_cce_swap(struct drm_device *dev, void *data, struct drm_file *file_priv)
+int
+r128_cce_swap(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
- drm_r128_private_t *dev_priv = dev->dev_private;
- drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
+ drm_r128_private_t *dev_priv = dev->dev_private;
+ drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
DRM_DEBUG("\n");
LOCK_TEST_WITH_RETURN(dev, file_priv);
@@ -1272,13 +1292,14 @@ int r128_cce_swap(struct drm_device *dev, void *data, struct drm_file *file_priv
return 0;
}
-int r128_cce_vertex(struct drm_device *dev, void *data, struct drm_file *file_priv)
+int
+r128_cce_vertex(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
- drm_r128_private_t *dev_priv = dev->dev_private;
- struct drm_device_dma *dma = dev->dma;
- struct drm_buf *buf;
- drm_r128_buf_priv_t *buf_priv;
- drm_r128_vertex_t *vertex = data;
+ drm_r128_private_t *dev_priv = dev->dev_private;
+ struct drm_device_dma *dma = dev->dma;
+ struct drm_buf *buf;
+ struct ragedrm_buf_priv *buf_priv;
+ drm_r128_vertex_t *vertex = data;
LOCK_TEST_WITH_RETURN(dev, file_priv);
@@ -1327,14 +1348,16 @@ int r128_cce_vertex(struct drm_device *dev, void *data, struct drm_file *file_pr
return 0;
}
-int r128_cce_indices(struct drm_device *dev, void *data, struct drm_file *file_priv)
+int
+r128_cce_indices(struct drm_device *dev, void *data,
+ struct drm_file *file_priv)
{
- drm_r128_private_t *dev_priv = dev->dev_private;
- struct drm_device_dma *dma = dev->dma;
- struct drm_buf *buf;
- drm_r128_buf_priv_t *buf_priv;
- drm_r128_indices_t *elts = data;
- int count;
+ drm_r128_private_t *dev_priv = dev->dev_private;
+ struct drm_device_dma *dma = dev->dma;
+ struct drm_buf *buf;
+ struct ragedrm_buf_priv *buf_priv;
+ drm_r128_indices_t *elts = data;
+ int count;
LOCK_TEST_WITH_RETURN(dev, file_priv);
@@ -1395,12 +1418,13 @@ int r128_cce_indices(struct drm_device *dev, void *data, struct drm_file *file_p
return 0;
}
-int r128_cce_blit(struct drm_device *dev, void *data, struct drm_file *file_priv)
+int
+r128_cce_blit(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
- struct drm_device_dma *dma = dev->dma;
- drm_r128_private_t *dev_priv = dev->dev_private;
- drm_r128_blit_t *blit = data;
- int ret;
+ struct drm_device_dma *dma = dev->dma;
+ drm_r128_private_t *dev_priv = dev->dev_private;
+ drm_r128_blit_t *blit = data;
+ int ret;
LOCK_TEST_WITH_RETURN(dev, file_priv);
@@ -1421,11 +1445,12 @@ int r128_cce_blit(struct drm_device *dev, void *data, struct drm_file *file_priv
return ret;
}
-int r128_cce_depth(struct drm_device *dev, void *data, struct drm_file *file_priv)
+int
+r128_cce_depth(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
- drm_r128_private_t *dev_priv = dev->dev_private;
- drm_r128_depth_t *depth = data;
- int ret;
+ drm_r128_private_t *dev_priv = dev->dev_private;
+ drm_r128_depth_t *depth = data;
+ int ret;
LOCK_TEST_WITH_RETURN(dev, file_priv);
@@ -1451,11 +1476,12 @@ int r128_cce_depth(struct drm_device *dev, void *data, struct drm_file *file_pri
return ret;
}
-int r128_cce_stipple(struct drm_device *dev, void *data, struct drm_file *file_priv)
+int
+r128_cce_stipple(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
- drm_r128_private_t *dev_priv = dev->dev_private;
- drm_r128_stipple_t *stipple = data;
- u32 mask[32];
+ drm_r128_private_t *dev_priv = dev->dev_private;
+ drm_r128_stipple_t *stipple = data;
+ u_int32_t mask[32];
LOCK_TEST_WITH_RETURN(dev, file_priv);
@@ -1470,13 +1496,15 @@ int r128_cce_stipple(struct drm_device *dev, void *data, struct drm_file *file_p
return 0;
}
-int r128_cce_indirect(struct drm_device *dev, void *data, struct drm_file *file_priv)
+int
+r128_cce_indirect(struct drm_device *dev, void *data,
+ struct drm_file *file_priv)
{
- drm_r128_private_t *dev_priv = dev->dev_private;
- struct drm_device_dma *dma = dev->dma;
- struct drm_buf *buf;
- drm_r128_buf_priv_t *buf_priv;
- drm_r128_indirect_t *indirect = data;
+ drm_r128_private_t *dev_priv = dev->dev_private;
+ struct drm_device_dma *dma = dev->dma;
+ struct drm_buf *buf;
+ struct ragedrm_buf_priv *buf_priv;
+ drm_r128_indirect_t *indirect = data;
#if 0
RING_LOCALS;
#endif
@@ -1542,11 +1570,12 @@ int r128_cce_indirect(struct drm_device *dev, void *data, struct drm_file *file_
return 0;
}
-int r128_getparam(struct drm_device *dev, void *data, struct drm_file *file_priv)
+int
+r128_getparam(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
- drm_r128_private_t *dev_priv = dev->dev_private;
- drm_r128_getparam_t *param = data;
- int value;
+ drm_r128_private_t *dev_priv = dev->dev_private;
+ drm_r128_getparam_t *param = data;
+ int value;
if (!dev_priv) {
DRM_ERROR("called with no initialization\n");
@@ -1571,16 +1600,18 @@ int r128_getparam(struct drm_device *dev, void *data, struct drm_file *file_priv
return 0;
}
-void r128_driver_close(struct drm_device * dev, struct drm_file *file_priv)
+void
+r128_driver_close(struct drm_device * dev, struct drm_file *file_priv)
{
- drm_r128_private_t *dev_priv = dev->dev_private;
+ drm_r128_private_t *dev_priv = dev->dev_private;
if (dev_priv->page_flipping) {
r128_do_cleanup_pageflip(dev);
}
}
-void r128_driver_lastclose(struct drm_device * dev)
+void
+r128_driver_lastclose(struct drm_device * dev)
{
r128_do_cleanup_cce(dev);
}