diff options
author | Dave Airlie <airlied@linux.ie> | 2007-01-08 05:31:13 -0500 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2007-02-07 21:24:26 -0500 |
commit | b9094d3aaa9550e740b6fd12b68f485d9979ce27 (patch) | |
tree | 6785813186e909ff9e78dfbf17138c50547b34a9 /drivers/char/drm/i830_dma.c | |
parent | f239b7b0cac0682d582949087710a9663b1300d5 (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/i830_dma.c')
-rw-r--r-- | drivers/char/drm/i830_dma.c | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/drivers/char/drm/i830_dma.c b/drivers/char/drm/i830_dma.c index 4f0e5746ab33..95224455ec0c 100644 --- a/drivers/char/drm/i830_dma.c +++ b/drivers/char/drm/i830_dma.c | |||
@@ -223,8 +223,7 @@ static int i830_dma_cleanup(drm_device_t * dev) | |||
223 | (drm_i830_private_t *) dev->dev_private; | 223 | (drm_i830_private_t *) dev->dev_private; |
224 | 224 | ||
225 | if (dev_priv->ring.virtual_start) { | 225 | if (dev_priv->ring.virtual_start) { |
226 | drm_ioremapfree((void *)dev_priv->ring.virtual_start, | 226 | drm_core_ioremapfree(&dev_priv->ring.map, dev); |
227 | dev_priv->ring.Size, dev); | ||
228 | } | 227 | } |
229 | if (dev_priv->hw_status_page) { | 228 | if (dev_priv->hw_status_page) { |
230 | pci_free_consistent(dev->pdev, PAGE_SIZE, | 229 | pci_free_consistent(dev->pdev, PAGE_SIZE, |
@@ -242,8 +241,7 @@ static int i830_dma_cleanup(drm_device_t * dev) | |||
242 | drm_buf_t *buf = dma->buflist[i]; | 241 | drm_buf_t *buf = dma->buflist[i]; |
243 | drm_i830_buf_priv_t *buf_priv = buf->dev_private; | 242 | drm_i830_buf_priv_t *buf_priv = buf->dev_private; |
244 | if (buf_priv->kernel_virtual && buf->total) | 243 | if (buf_priv->kernel_virtual && buf->total) |
245 | drm_ioremapfree(buf_priv->kernel_virtual, | 244 | drm_core_ioremapfree(&buf_priv->map, dev); |
246 | buf->total, dev); | ||
247 | } | 245 | } |
248 | } | 246 | } |
249 | return 0; | 247 | return 0; |
@@ -320,8 +318,14 @@ static int i830_freelist_init(drm_device_t * dev, drm_i830_private_t * dev_priv) | |||
320 | 318 | ||
321 | *buf_priv->in_use = I830_BUF_FREE; | 319 | *buf_priv->in_use = I830_BUF_FREE; |
322 | 320 | ||
323 | buf_priv->kernel_virtual = drm_ioremap(buf->bus_address, | 321 | buf_priv->map.offset = buf->bus_address; |
324 | buf->total, dev); | 322 | buf_priv->map.size = buf->total; |
323 | buf_priv->map.type = _DRM_AGP; | ||
324 | buf_priv->map.flags = 0; | ||
325 | buf_priv->map.mtrr = 0; | ||
326 | |||
327 | drm_core_ioremap(&buf_priv->map, dev); | ||
328 | buf_priv->kernel_virtual = buf_priv->map.handle; | ||
325 | } | 329 | } |
326 | return 0; | 330 | return 0; |
327 | } | 331 | } |
@@ -373,18 +377,24 @@ static int i830_dma_initialize(drm_device_t * dev, | |||
373 | dev_priv->ring.End = init->ring_end; | 377 | dev_priv->ring.End = init->ring_end; |
374 | dev_priv->ring.Size = init->ring_size; | 378 | dev_priv->ring.Size = init->ring_size; |
375 | 379 | ||
376 | dev_priv->ring.virtual_start = drm_ioremap(dev->agp->base + | 380 | dev_priv->ring.map.offset = dev->agp->base + init->ring_start; |
377 | init->ring_start, | 381 | dev_priv->ring.map.size = init->ring_size; |
378 | init->ring_size, dev); | 382 | dev_priv->ring.map.type = _DRM_AGP; |
383 | dev_priv->ring.map.flags = 0; | ||
384 | dev_priv->ring.map.mtrr = 0; | ||
385 | |||
386 | drm_core_ioremap(&dev_priv->ring.map, dev); | ||
379 | 387 | ||
380 | if (dev_priv->ring.virtual_start == NULL) { | 388 | if (dev_priv->ring.map.handle == NULL) { |
381 | dev->dev_private = (void *)dev_priv; | 389 | dev->dev_private = (void *)dev_priv; |
382 | i830_dma_cleanup(dev); | 390 | i830_dma_cleanup(dev); |
383 | DRM_ERROR("can not ioremap virtual address for" | 391 | DRM_ERROR("can not ioremap virtual address for" |
384 | " ring buffer\n"); | 392 | " ring buffer\n"); |
385 | return -ENOMEM; | 393 | return DRM_ERR(ENOMEM); |
386 | } | 394 | } |
387 | 395 | ||
396 | dev_priv->ring.virtual_start = dev_priv->ring.map.handle; | ||
397 | |||
388 | dev_priv->ring.tail_mask = dev_priv->ring.Size - 1; | 398 | dev_priv->ring.tail_mask = dev_priv->ring.Size - 1; |
389 | 399 | ||
390 | dev_priv->w = init->w; | 400 | dev_priv->w = init->w; |