summaryrefslogtreecommitdiffstats
path: root/sys/dev/drm/via_dma.c
diff options
context:
space:
mode:
authorrnoland <rnoland@FreeBSD.org>2010-04-22 18:21:25 +0000
committerrnoland <rnoland@FreeBSD.org>2010-04-22 18:21:25 +0000
commitb733ebaa1ccc608f662359519c4712cf384b1360 (patch)
tree4cbae1e0936ed160e9fca32b44038b3450bb6072 /sys/dev/drm/via_dma.c
parentc0d6a78ddcc9bdcf4f9ee2858efab1abf0db5bdf (diff)
downloadFreeBSD-src-b733ebaa1ccc608f662359519c4712cf384b1360.zip
FreeBSD-src-b733ebaa1ccc608f662359519c4712cf384b1360.tar.gz
Rework how drm maps are handled.
* On 32 bit platforms we steal the upper 4 bits of the map handle to store a unique map id. * On 64 bit platforms we steal the upper 24 bits. Resolves issues where the offsets that are handed to mmap may overlap the VRAM on some cards. Tested on: radeon, intel, mga, and via. This will break nouveau. I will spin new patches shortly.
Diffstat (limited to 'sys/dev/drm/via_dma.c')
-rw-r--r--sys/dev/drm/via_dma.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/dev/drm/via_dma.c b/sys/dev/drm/via_dma.c
index e1af293..6f435fe 100644
--- a/sys/dev/drm/via_dma.c
+++ b/sys/dev/drm/via_dma.c
@@ -158,6 +158,9 @@ static inline uint32_t *via_check_dma(drm_via_private_t * dev_priv,
int via_dma_cleanup(struct drm_device * dev)
{
+ drm_via_blitq_t *blitq;
+ int i;
+
if (dev->dev_private) {
drm_via_private_t *dev_priv =
(drm_via_private_t *) dev->dev_private;
@@ -169,6 +172,10 @@ int via_dma_cleanup(struct drm_device * dev)
dev_priv->ring.virtual_start = NULL;
}
+ for (i=0; i< VIA_NUM_BLIT_ENGINES; ++i) {
+ blitq = dev_priv->blit_queues + i;
+ mtx_destroy(&blitq->blit_lock);
+ }
}
return 0;
@@ -206,14 +213,14 @@ static int via_initialize(struct drm_device * dev,
drm_core_ioremap_wc(&dev_priv->ring.map, dev);
- if (dev_priv->ring.map.handle == NULL) {
+ if (dev_priv->ring.map.virtual == NULL) {
via_dma_cleanup(dev);
DRM_ERROR("can not ioremap virtual address for"
" ring buffer\n");
return -ENOMEM;
}
- dev_priv->ring.virtual_start = dev_priv->ring.map.handle;
+ dev_priv->ring.virtual_start = dev_priv->ring.map.virtual;
dev_priv->dma_ptr = dev_priv->ring.virtual_start;
dev_priv->dma_low = 0;
@@ -222,7 +229,7 @@ static int via_initialize(struct drm_device * dev,
dev_priv->dma_offset = init->offset;
dev_priv->last_pause_ptr = NULL;
dev_priv->hw_addr_ptr =
- (volatile uint32_t *)((char *)dev_priv->mmio->handle +
+ (volatile uint32_t *)((char *)dev_priv->mmio->virtual +
init->reg_pause_addr);
via_cmdbuf_start(dev_priv);
OpenPOWER on IntegriCloud