diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-02-02 00:55:47 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-03-13 00:23:57 -0400 |
commit | 41c2e75e60200a860a74b7c84a6375c105e7437f (patch) | |
tree | 18e97662d6859eead4de816e121d001b34a7352a /drivers/gpu/drm/radeon/radeon_cp.c | |
parent | f77d390c9779c496aa5b99ec832996fb76bb1d13 (diff) |
drm: Make drm_local_map use a resource_size_t offset
This changes drm_local_map to use a resource_size for its "offset"
member instead of an unsigned long, thus allowing 32-bit machines
with a >32-bit physical address space to be able to store there
their register or framebuffer addresses when those are above 4G,
such as when using a PCI video card on a recent AMCC 440 SoC.
This patch isn't as "trivial" as it sounds: A few functions needed
to have some unsigned long/int changed to resource_size_t and a few
printk's had to be adjusted.
But also, because userspace isn't capable of passing such offsets,
I had to modify drm_find_matching_map() to ignore the offset passed
in for maps of type _DRM_FRAMEBUFFER or _DRM_REGISTERS.
If we ever support multiple _DRM_FRAMEBUFFER or _DRM_REGISTERS maps
for a given device, we might have to change that trick, but I don't
think that happens on any current driver.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_cp.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_cp.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_cp.c b/drivers/gpu/drm/radeon/radeon_cp.c index 92965dbb3c14..34c0b3f0c29e 100644 --- a/drivers/gpu/drm/radeon/radeon_cp.c +++ b/drivers/gpu/drm/radeon/radeon_cp.c | |||
@@ -1062,11 +1062,12 @@ static int radeon_do_init_cp(struct drm_device *dev, drm_radeon_init_t *init, | |||
1062 | } else | 1062 | } else |
1063 | #endif | 1063 | #endif |
1064 | { | 1064 | { |
1065 | dev_priv->cp_ring->handle = (void *)dev_priv->cp_ring->offset; | 1065 | dev_priv->cp_ring->handle = |
1066 | (void *)(unsigned long)dev_priv->cp_ring->offset; | ||
1066 | dev_priv->ring_rptr->handle = | 1067 | dev_priv->ring_rptr->handle = |
1067 | (void *)dev_priv->ring_rptr->offset; | 1068 | (void *)(unsigned long)dev_priv->ring_rptr->offset; |
1068 | dev->agp_buffer_map->handle = | 1069 | dev->agp_buffer_map->handle = |
1069 | (void *)dev->agp_buffer_map->offset; | 1070 | (void *)(unsigned long)dev->agp_buffer_map->offset; |
1070 | 1071 | ||
1071 | DRM_DEBUG("dev_priv->cp_ring->handle %p\n", | 1072 | DRM_DEBUG("dev_priv->cp_ring->handle %p\n", |
1072 | dev_priv->cp_ring->handle); | 1073 | dev_priv->cp_ring->handle); |
@@ -1177,7 +1178,7 @@ static int radeon_do_init_cp(struct drm_device *dev, drm_radeon_init_t *init, | |||
1177 | /* if we have an offset set from userspace */ | 1178 | /* if we have an offset set from userspace */ |
1178 | if (dev_priv->pcigart_offset_set) { | 1179 | if (dev_priv->pcigart_offset_set) { |
1179 | dev_priv->gart_info.bus_addr = | 1180 | dev_priv->gart_info.bus_addr = |
1180 | dev_priv->pcigart_offset + dev_priv->fb_location; | 1181 | (resource_size_t)dev_priv->pcigart_offset + dev_priv->fb_location; |
1181 | dev_priv->gart_info.mapping.offset = | 1182 | dev_priv->gart_info.mapping.offset = |
1182 | dev_priv->pcigart_offset + dev_priv->fb_aper_offset; | 1183 | dev_priv->pcigart_offset + dev_priv->fb_aper_offset; |
1183 | dev_priv->gart_info.mapping.size = | 1184 | dev_priv->gart_info.mapping.size = |