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 /include/drm/drmP.h | |
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 'include/drm/drmP.h')
-rw-r--r-- | include/drm/drmP.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 03a7c11cb24d..c91fbb68b460 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -526,7 +526,7 @@ struct drm_mm { | |||
526 | * Kernel side of a mapping | 526 | * Kernel side of a mapping |
527 | */ | 527 | */ |
528 | struct drm_local_map { | 528 | struct drm_local_map { |
529 | unsigned long offset; /**< Requested physical address (0 for SAREA)*/ | 529 | resource_size_t offset; /**< Requested physical address (0 for SAREA)*/ |
530 | unsigned long size; /**< Requested physical size (bytes) */ | 530 | unsigned long size; /**< Requested physical size (bytes) */ |
531 | enum drm_map_type type; /**< Type of memory to map */ | 531 | enum drm_map_type type; /**< Type of memory to map */ |
532 | enum drm_map_flags flags; /**< Flags */ | 532 | enum drm_map_flags flags; /**< Flags */ |
@@ -760,8 +760,8 @@ struct drm_driver { | |||
760 | struct drm_file *file_priv); | 760 | struct drm_file *file_priv); |
761 | void (*reclaim_buffers_idlelocked) (struct drm_device *dev, | 761 | void (*reclaim_buffers_idlelocked) (struct drm_device *dev, |
762 | struct drm_file *file_priv); | 762 | struct drm_file *file_priv); |
763 | unsigned long (*get_map_ofs) (struct drm_local_map * map); | 763 | resource_size_t (*get_map_ofs) (struct drm_local_map * map); |
764 | unsigned long (*get_reg_ofs) (struct drm_device *dev); | 764 | resource_size_t (*get_reg_ofs) (struct drm_device *dev); |
765 | void (*set_version) (struct drm_device *dev, | 765 | void (*set_version) (struct drm_device *dev, |
766 | struct drm_set_version *sv); | 766 | struct drm_set_version *sv); |
767 | 767 | ||
@@ -1062,8 +1062,8 @@ extern int drm_release(struct inode *inode, struct file *filp); | |||
1062 | extern int drm_mmap(struct file *filp, struct vm_area_struct *vma); | 1062 | extern int drm_mmap(struct file *filp, struct vm_area_struct *vma); |
1063 | extern int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma); | 1063 | extern int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma); |
1064 | extern void drm_vm_open_locked(struct vm_area_struct *vma); | 1064 | extern void drm_vm_open_locked(struct vm_area_struct *vma); |
1065 | extern unsigned long drm_core_get_map_ofs(struct drm_local_map * map); | 1065 | extern resource_size_t drm_core_get_map_ofs(struct drm_local_map * map); |
1066 | extern unsigned long drm_core_get_reg_ofs(struct drm_device *dev); | 1066 | extern resource_size_t drm_core_get_reg_ofs(struct drm_device *dev); |
1067 | extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait); | 1067 | extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait); |
1068 | 1068 | ||
1069 | /* Memory management support (drm_memory.h) */ | 1069 | /* Memory management support (drm_memory.h) */ |
@@ -1166,7 +1166,7 @@ extern int drm_i_have_hw_lock(struct drm_device *dev, struct drm_file *file_priv | |||
1166 | /* Buffer management support (drm_bufs.h) */ | 1166 | /* Buffer management support (drm_bufs.h) */ |
1167 | extern int drm_addbufs_agp(struct drm_device *dev, struct drm_buf_desc * request); | 1167 | extern int drm_addbufs_agp(struct drm_device *dev, struct drm_buf_desc * request); |
1168 | extern int drm_addbufs_pci(struct drm_device *dev, struct drm_buf_desc * request); | 1168 | extern int drm_addbufs_pci(struct drm_device *dev, struct drm_buf_desc * request); |
1169 | extern int drm_addmap(struct drm_device *dev, unsigned int offset, | 1169 | extern int drm_addmap(struct drm_device *dev, resource_size_t offset, |
1170 | unsigned int size, enum drm_map_type type, | 1170 | unsigned int size, enum drm_map_type type, |
1171 | enum drm_map_flags flags, struct drm_local_map **map_ptr); | 1171 | enum drm_map_flags flags, struct drm_local_map **map_ptr); |
1172 | extern int drm_addmap_ioctl(struct drm_device *dev, void *data, | 1172 | extern int drm_addmap_ioctl(struct drm_device *dev, void *data, |