aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/drm')
-rw-r--r--drivers/char/drm/drm_sysfs.c2
-rw-r--r--drivers/char/drm/radeon_cp.c13
2 files changed, 10 insertions, 5 deletions
diff --git a/drivers/char/drm/drm_sysfs.c b/drivers/char/drm/drm_sysfs.c
index 475cc5e555e1..6d3449761914 100644
--- a/drivers/char/drm/drm_sysfs.c
+++ b/drivers/char/drm/drm_sysfs.c
@@ -15,6 +15,8 @@
15#include <linux/device.h> 15#include <linux/device.h>
16#include <linux/kdev_t.h> 16#include <linux/kdev_t.h>
17#include <linux/err.h> 17#include <linux/err.h>
18#include <linux/slab.h>
19#include <linux/string.h>
18 20
19#include "drm_core.h" 21#include "drm_core.h"
20#include "drmP.h" 22#include "drmP.h"
diff --git a/drivers/char/drm/radeon_cp.c b/drivers/char/drm/radeon_cp.c
index e64d680899f5..03839ea31092 100644
--- a/drivers/char/drm/radeon_cp.c
+++ b/drivers/char/drm/radeon_cp.c
@@ -1132,11 +1132,13 @@ static void radeon_cp_init_ring_buffer(drm_device_t * dev,
1132 (dev_priv->gart_vm_start >> 16))); 1132 (dev_priv->gart_vm_start >> 16)));
1133 1133
1134 ring_start = (dev_priv->cp_ring->offset 1134 ring_start = (dev_priv->cp_ring->offset
1135 - dev->agp->base + dev_priv->gart_vm_start); 1135 - dev->agp->base
1136 + dev_priv->gart_vm_start);
1136 } else 1137 } else
1137#endif 1138#endif
1138 ring_start = (dev_priv->cp_ring->offset 1139 ring_start = (dev_priv->cp_ring->offset
1139 - dev->sg->handle + dev_priv->gart_vm_start); 1140 - (unsigned long)dev->sg->virtual
1141 + dev_priv->gart_vm_start);
1140 1142
1141 RADEON_WRITE(RADEON_CP_RB_BASE, ring_start); 1143 RADEON_WRITE(RADEON_CP_RB_BASE, ring_start);
1142 1144
@@ -1162,7 +1164,8 @@ static void radeon_cp_init_ring_buffer(drm_device_t * dev,
1162 drm_sg_mem_t *entry = dev->sg; 1164 drm_sg_mem_t *entry = dev->sg;
1163 unsigned long tmp_ofs, page_ofs; 1165 unsigned long tmp_ofs, page_ofs;
1164 1166
1165 tmp_ofs = dev_priv->ring_rptr->offset - dev->sg->handle; 1167 tmp_ofs = dev_priv->ring_rptr->offset -
1168 (unsigned long)dev->sg->virtual;
1166 page_ofs = tmp_ofs >> PAGE_SHIFT; 1169 page_ofs = tmp_ofs >> PAGE_SHIFT;
1167 1170
1168 RADEON_WRITE(RADEON_CP_RB_RPTR_ADDR, entry->busaddr[page_ofs]); 1171 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)
1529 else 1532 else
1530#endif 1533#endif
1531 dev_priv->gart_buffers_offset = (dev->agp_buffer_map->offset 1534 dev_priv->gart_buffers_offset = (dev->agp_buffer_map->offset
1532 - dev->sg->handle 1535 - (unsigned long)dev->sg->virtual
1533 + dev_priv->gart_vm_start); 1536 + dev_priv->gart_vm_start);
1534 1537
1535 DRM_DEBUG("dev_priv->gart_size %d\n", dev_priv->gart_size); 1538 DRM_DEBUG("dev_priv->gart_size %d\n", dev_priv->gart_size);
1536 DRM_DEBUG("dev_priv->gart_vm_start 0x%x\n", dev_priv->gart_vm_start); 1539 DRM_DEBUG("dev_priv->gart_vm_start 0x%x\n", dev_priv->gart_vm_start);