diff options
Diffstat (limited to 'drivers/char/drm')
-rw-r--r-- | drivers/char/drm/drm_vm.c | 3 | ||||
-rw-r--r-- | drivers/char/drm/mga_drv.h | 2 | ||||
-rw-r--r-- | drivers/char/drm/mga_state.c | 2 | ||||
-rw-r--r-- | drivers/char/drm/radeon_cp.c | 11 |
4 files changed, 10 insertions, 8 deletions
diff --git a/drivers/char/drm/drm_vm.c b/drivers/char/drm/drm_vm.c index ced4215e2275..39ea96e42c5b 100644 --- a/drivers/char/drm/drm_vm.c +++ b/drivers/char/drm/drm_vm.c | |||
@@ -148,7 +148,8 @@ static __inline__ struct page *drm_do_vm_shm_nopage(struct vm_area_struct *vma, | |||
148 | 148 | ||
149 | offset = address - vma->vm_start; | 149 | offset = address - vma->vm_start; |
150 | i = (unsigned long)map->handle + offset; | 150 | i = (unsigned long)map->handle + offset; |
151 | page = vmalloc_to_page((void *)i); | 151 | page = (map->type == _DRM_CONSISTENT) ? |
152 | virt_to_page((void *)i) : vmalloc_to_page((void *)i); | ||
152 | if (!page) | 153 | if (!page) |
153 | return NOPAGE_OOM; | 154 | return NOPAGE_OOM; |
154 | get_page(page); | 155 | get_page(page); |
diff --git a/drivers/char/drm/mga_drv.h b/drivers/char/drm/mga_drv.h index b22fdbd4f830..6059c5a5b105 100644 --- a/drivers/char/drm/mga_drv.h +++ b/drivers/char/drm/mga_drv.h | |||
@@ -227,7 +227,7 @@ static inline u32 _MGA_READ(u32 *addr) | |||
227 | #define MGA_EMIT_STATE( dev_priv, dirty ) \ | 227 | #define MGA_EMIT_STATE( dev_priv, dirty ) \ |
228 | do { \ | 228 | do { \ |
229 | if ( (dirty) & ~MGA_UPLOAD_CLIPRECTS ) { \ | 229 | if ( (dirty) & ~MGA_UPLOAD_CLIPRECTS ) { \ |
230 | if ( dev_priv->chipset == MGA_CARD_TYPE_G400 ) { \ | 230 | if ( dev_priv->chipset >= MGA_CARD_TYPE_G400 ) { \ |
231 | mga_g400_emit_state( dev_priv ); \ | 231 | mga_g400_emit_state( dev_priv ); \ |
232 | } else { \ | 232 | } else { \ |
233 | mga_g200_emit_state( dev_priv ); \ | 233 | mga_g200_emit_state( dev_priv ); \ |
diff --git a/drivers/char/drm/mga_state.c b/drivers/char/drm/mga_state.c index 05bbb4719376..6ac5e006226f 100644 --- a/drivers/char/drm/mga_state.c +++ b/drivers/char/drm/mga_state.c | |||
@@ -53,7 +53,7 @@ static void mga_emit_clip_rect( drm_mga_private_t *dev_priv, | |||
53 | 53 | ||
54 | /* Force reset of DWGCTL on G400 (eliminates clip disable bit). | 54 | /* Force reset of DWGCTL on G400 (eliminates clip disable bit). |
55 | */ | 55 | */ |
56 | if (dev_priv->chipset == MGA_CARD_TYPE_G400) { | 56 | if (dev_priv->chipset >= MGA_CARD_TYPE_G400) { |
57 | DMA_BLOCK(MGA_DWGCTL, ctx->dwgctl, | 57 | DMA_BLOCK(MGA_DWGCTL, ctx->dwgctl, |
58 | MGA_LEN + MGA_EXEC, 0x80000000, | 58 | MGA_LEN + MGA_EXEC, 0x80000000, |
59 | MGA_DWGCTL, ctx->dwgctl, | 59 | MGA_DWGCTL, ctx->dwgctl, |
diff --git a/drivers/char/drm/radeon_cp.c b/drivers/char/drm/radeon_cp.c index 6d9080a3ca7e..12ef13ff04ca 100644 --- a/drivers/char/drm/radeon_cp.c +++ b/drivers/char/drm/radeon_cp.c | |||
@@ -1133,10 +1133,10 @@ static void radeon_cp_init_ring_buffer( drm_device_t *dev, | |||
1133 | ring_start = (dev_priv->cp_ring->offset | 1133 | ring_start = (dev_priv->cp_ring->offset |
1134 | - dev->agp->base | 1134 | - dev->agp->base |
1135 | + dev_priv->gart_vm_start); | 1135 | + dev_priv->gart_vm_start); |
1136 | } else | 1136 | } else |
1137 | #endif | 1137 | #endif |
1138 | ring_start = (dev_priv->cp_ring->offset | 1138 | ring_start = (dev_priv->cp_ring->offset |
1139 | - dev->sg->handle | 1139 | - (unsigned long)dev->sg->virtual |
1140 | + dev_priv->gart_vm_start); | 1140 | + dev_priv->gart_vm_start); |
1141 | 1141 | ||
1142 | RADEON_WRITE( RADEON_CP_RB_BASE, ring_start ); | 1142 | RADEON_WRITE( RADEON_CP_RB_BASE, ring_start ); |
@@ -1164,7 +1164,8 @@ static void radeon_cp_init_ring_buffer( drm_device_t *dev, | |||
1164 | drm_sg_mem_t *entry = dev->sg; | 1164 | drm_sg_mem_t *entry = dev->sg; |
1165 | unsigned long tmp_ofs, page_ofs; | 1165 | unsigned long tmp_ofs, page_ofs; |
1166 | 1166 | ||
1167 | tmp_ofs = dev_priv->ring_rptr->offset - dev->sg->handle; | 1167 | tmp_ofs = dev_priv->ring_rptr->offset - |
1168 | (unsigned long)dev->sg->virtual; | ||
1168 | page_ofs = tmp_ofs >> PAGE_SHIFT; | 1169 | page_ofs = tmp_ofs >> PAGE_SHIFT; |
1169 | 1170 | ||
1170 | RADEON_WRITE( RADEON_CP_RB_RPTR_ADDR, | 1171 | RADEON_WRITE( RADEON_CP_RB_RPTR_ADDR, |
@@ -1491,8 +1492,8 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init ) | |||
1491 | else | 1492 | else |
1492 | #endif | 1493 | #endif |
1493 | dev_priv->gart_buffers_offset = (dev->agp_buffer_map->offset | 1494 | dev_priv->gart_buffers_offset = (dev->agp_buffer_map->offset |
1494 | - dev->sg->handle | 1495 | - (unsigned long)dev->sg->virtual |
1495 | + dev_priv->gart_vm_start); | 1496 | + dev_priv->gart_vm_start); |
1496 | 1497 | ||
1497 | DRM_DEBUG( "dev_priv->gart_size %d\n", | 1498 | DRM_DEBUG( "dev_priv->gart_size %d\n", |
1498 | dev_priv->gart_size ); | 1499 | dev_priv->gart_size ); |