aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/i810_dma.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2007-01-08 05:31:13 -0500
committerDave Airlie <airlied@linux.ie>2007-02-07 21:24:26 -0500
commitb9094d3aaa9550e740b6fd12b68f485d9979ce27 (patch)
tree6785813186e909ff9e78dfbf17138c50547b34a9 /drivers/char/drm/i810_dma.c
parentf239b7b0cac0682d582949087710a9663b1300d5 (diff)
i810/i830: use drm_core_ioremap instead of drm_ioremap
This makes the i810/i830 use the drm_core_ioremap functions. Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm/i810_dma.c')
-rw-r--r--drivers/char/drm/i810_dma.c34
1 files changed, 23 insertions, 11 deletions
diff --git a/drivers/char/drm/i810_dma.c b/drivers/char/drm/i810_dma.c
index fa2de70f7401..60cb4e45a75e 100644
--- a/drivers/char/drm/i810_dma.c
+++ b/drivers/char/drm/i810_dma.c
@@ -219,8 +219,7 @@ static int i810_dma_cleanup(drm_device_t * dev)
219 (drm_i810_private_t *) dev->dev_private; 219 (drm_i810_private_t *) dev->dev_private;
220 220
221 if (dev_priv->ring.virtual_start) { 221 if (dev_priv->ring.virtual_start) {
222 drm_ioremapfree((void *)dev_priv->ring.virtual_start, 222 drm_core_ioremapfree(&dev_priv->ring.map, dev);
223 dev_priv->ring.Size, dev);
224 } 223 }
225 if (dev_priv->hw_status_page) { 224 if (dev_priv->hw_status_page) {
226 pci_free_consistent(dev->pdev, PAGE_SIZE, 225 pci_free_consistent(dev->pdev, PAGE_SIZE,
@@ -236,9 +235,9 @@ static int i810_dma_cleanup(drm_device_t * dev)
236 for (i = 0; i < dma->buf_count; i++) { 235 for (i = 0; i < dma->buf_count; i++) {
237 drm_buf_t *buf = dma->buflist[i]; 236 drm_buf_t *buf = dma->buflist[i];
238 drm_i810_buf_priv_t *buf_priv = buf->dev_private; 237 drm_i810_buf_priv_t *buf_priv = buf->dev_private;
238
239 if (buf_priv->kernel_virtual && buf->total) 239 if (buf_priv->kernel_virtual && buf->total)
240 drm_ioremapfree(buf_priv->kernel_virtual, 240 drm_core_ioremapfree(&buf_priv->map, dev);
241 buf->total, dev);
242 } 241 }
243 } 242 }
244 return 0; 243 return 0;
@@ -311,8 +310,15 @@ static int i810_freelist_init(drm_device_t * dev, drm_i810_private_t * dev_priv)
311 310
312 *buf_priv->in_use = I810_BUF_FREE; 311 *buf_priv->in_use = I810_BUF_FREE;
313 312
314 buf_priv->kernel_virtual = drm_ioremap(buf->bus_address, 313 buf_priv->map.offset = buf->bus_address;
315 buf->total, dev); 314 buf_priv->map.size = buf->total;
315 buf_priv->map.type = _DRM_AGP;
316 buf_priv->map.flags = 0;
317 buf_priv->map.mtrr = 0;
318
319 drm_core_ioremap(&buf_priv->map, dev);
320 buf_priv->kernel_virtual = buf_priv->map.handle;
321
316 } 322 }
317 return 0; 323 return 0;
318} 324}
@@ -363,18 +369,24 @@ static int i810_dma_initialize(drm_device_t * dev,
363 dev_priv->ring.End = init->ring_end; 369 dev_priv->ring.End = init->ring_end;
364 dev_priv->ring.Size = init->ring_size; 370 dev_priv->ring.Size = init->ring_size;
365 371
366 dev_priv->ring.virtual_start = drm_ioremap(dev->agp->base + 372 dev_priv->ring.map.offset = dev->agp->base + init->ring_start;
367 init->ring_start, 373 dev_priv->ring.map.size = init->ring_size;
368 init->ring_size, dev); 374 dev_priv->ring.map.type = _DRM_AGP;
375 dev_priv->ring.map.flags = 0;
376 dev_priv->ring.map.mtrr = 0;
369 377
370 if (dev_priv->ring.virtual_start == NULL) { 378 drm_core_ioremap(&dev_priv->ring.map, dev);
379
380 if (dev_priv->ring.map.handle == NULL) {
371 dev->dev_private = (void *)dev_priv; 381 dev->dev_private = (void *)dev_priv;
372 i810_dma_cleanup(dev); 382 i810_dma_cleanup(dev);
373 DRM_ERROR("can not ioremap virtual address for" 383 DRM_ERROR("can not ioremap virtual address for"
374 " ring buffer\n"); 384 " ring buffer\n");
375 return -ENOMEM; 385 return DRM_ERR(ENOMEM);
376 } 386 }
377 387
388 dev_priv->ring.virtual_start = dev_priv->ring.map.handle;
389
378 dev_priv->ring.tail_mask = dev_priv->ring.Size - 1; 390 dev_priv->ring.tail_mask = dev_priv->ring.Size - 1;
379 391
380 dev_priv->w = init->w; 392 dev_priv->w = init->w;