summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm/r128_cce.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/pci/drm/r128_cce.c')
-rw-r--r--sys/dev/pci/drm/r128_cce.c67
1 files changed, 11 insertions, 56 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;
}
}