Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Mosberger <davidm@napali.hpl.hp.com>2004-02-17 00:59:51 -0800
committerLinus Torvalds <torvalds@home.osdl.org>2004-02-17 00:59:51 -0800
commit015510a78955f0ba9977d661aae81c602bffa7b9 (patch)
tree379156bfbd3a394fcc362bdf042639166f7ed00c
parent607e971ed8301d5e18dc6a1f207c22720ab4f68f (diff)
[PATCH] Fix radeon warning on 64-bit platforms
Disable the RADEON_PARAM_SAREA_HANDLE ioctl on 64-bit architectures, since it is only used on some embedded platforms, and it isn't 64-bit safe.
-rw-r--r--drivers/char/drm/radeon_state.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/char/drm/radeon_state.c b/drivers/char/drm/radeon_state.c
index e4724ef139ab..29038ea00279 100644
--- a/drivers/char/drm/radeon_state.c
+++ b/drivers/char/drm/radeon_state.c
@@ -2185,10 +2185,21 @@ int radeon_cp_getparam( DRM_IOCTL_ARGS )
case RADEON_PARAM_STATUS_HANDLE:
value = dev_priv->ring_rptr_offset;
break;
+#if BITS_PER_LONG == 32
+ /*
+ * This ioctl() doesn't work on 64-bit platforms because hw_lock is a
+ * pointer which can't fit into an int-sized variable. According to
+ * Michel Dänzer, the ioctl() is only used on embedded platforms, so
+ * not supporting it shouldn't be a problem. If the same functionality
+ * is needed on 64-bit platforms, a new ioctl() would have to be added,
+ * so backwards-compatibility for the embedded platforms can be
+ * maintained. --davidm 4-Feb-2004.
+ */
case RADEON_PARAM_SAREA_HANDLE:
/* The lock is the first dword in the sarea. */
- value = (int)dev->lock.hw_lock;
- break;
+ value = (long)dev->lock.hw_lock;
+ break;
+#endif
case RADEON_PARAM_GART_TEX_HANDLE:
value = dev_priv->gart_textures_offset;
break;