summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/mga/mga_drv.h
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt2009-02-02 06:55:47 +0100
committerDave Airlie2009-03-13 05:23:57 +0100
commit41c2e75e60200a860a74b7c84a6375c105e7437f (patch)
tree18e97662d6859eead4de816e121d001b34a7352a /drivers/gpu/drm/mga/mga_drv.h
parentdrm: Split drm_map and drm_local_map (diff)
downloadkernel-qcow2-linux-41c2e75e60200a860a74b7c84a6375c105e7437f.tar.gz
kernel-qcow2-linux-41c2e75e60200a860a74b7c84a6375c105e7437f.tar.xz
kernel-qcow2-linux-41c2e75e60200a860a74b7c84a6375c105e7437f.zip
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/mga/mga_drv.h')
-rw-r--r--drivers/gpu/drm/mga/mga_drv.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/mga/mga_drv.h b/drivers/gpu/drm/mga/mga_drv.h
index 6bf4de990325..3d264f288237 100644
--- a/drivers/gpu/drm/mga/mga_drv.h
+++ b/drivers/gpu/drm/mga/mga_drv.h
@@ -317,8 +317,8 @@ do { \
DRM_INFO( "\n" ); \
DRM_INFO( " tail=0x%06x head=0x%06lx\n", \
dev_priv->prim.tail, \
- MGA_READ( MGA_PRIMADDRESS ) - \
- dev_priv->primary->offset ); \
+ (unsigned long)(MGA_READ(MGA_PRIMADDRESS) - \
+ dev_priv->primary->offset)); \
} \
if ( !test_bit( 0, &dev_priv->prim.wrapped ) ) { \
if ( dev_priv->prim.space < \