Merge master.kernel.org:/pub/scm/linux/kernel/git/airlied/drm-2.6
[linux-2.6.git] / drivers / char / drm / radeon_cp.c
index e64d680899f533894b611230c34a90229f9d68b3..03839ea31092d2f407e5d70e869392b2cc767472 100644 (file)
@@ -1132,11 +1132,13 @@ static void radeon_cp_init_ring_buffer(drm_device_t * dev,
                              (dev_priv->gart_vm_start >> 16)));
 
                ring_start = (dev_priv->cp_ring->offset
-                             - dev->agp->base + dev_priv->gart_vm_start);
+                             - dev->agp->base
+                             + dev_priv->gart_vm_start);
        } else
 #endif
                ring_start = (dev_priv->cp_ring->offset
-                             - dev->sg->handle + dev_priv->gart_vm_start);
+                             - (unsigned long)dev->sg->virtual
+                             + dev_priv->gart_vm_start);
 
        RADEON_WRITE(RADEON_CP_RB_BASE, ring_start);
 
@@ -1162,7 +1164,8 @@ static void radeon_cp_init_ring_buffer(drm_device_t * dev,
                drm_sg_mem_t *entry = dev->sg;
                unsigned long tmp_ofs, page_ofs;
 
-               tmp_ofs = dev_priv->ring_rptr->offset - dev->sg->handle;
+               tmp_ofs = dev_priv->ring_rptr->offset -
+                               (unsigned long)dev->sg->virtual;
                page_ofs = tmp_ofs >> PAGE_SHIFT;
 
                RADEON_WRITE(RADEON_CP_RB_RPTR_ADDR, entry->busaddr[page_ofs]);
@@ -1529,8 +1532,8 @@ static int radeon_do_init_cp(drm_device_t * dev, drm_radeon_init_t * init)
        else
 #endif
                dev_priv->gart_buffers_offset = (dev->agp_buffer_map->offset
-                                                - dev->sg->handle
-                                                + dev_priv->gart_vm_start);
+                                       - (unsigned long)dev->sg->virtual
+                                       + dev_priv->gart_vm_start);
 
        DRM_DEBUG("dev_priv->gart_size %d\n", dev_priv->gart_size);
        DRM_DEBUG("dev_priv->gart_vm_start 0x%x\n", dev_priv->gart_vm_start);