summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas@tungstengraphics.com>2006-06-16 15:20:20 +0000
committerThomas Hellstrom <thomas@tungstengraphics.com>2006-06-16 15:20:20 +0000
commit0203edaa21451c2840d3c4116fb0bdbec82cb0fe (patch)
tree7324ee4b272c81b69c385b7ddd32ebc7a362cef7 /linux-core
parentca1a77683d523dc1d2268531b19ea23b3e1ae4f0 (diff)
via: Return the requested size instead of the correct size of the allocated
regions. The 2D driver and XvMC lib has problems when the returned size is not the same as the allocated size.
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/via_mm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/linux-core/via_mm.c b/linux-core/via_mm.c
index 7d520ea2..71762b74 100644
--- a/linux-core/via_mm.c
+++ b/linux-core/via_mm.c
@@ -132,6 +132,7 @@ int via_mem_alloc(DRM_IOCTL_ARGS)
int retval = 0;
drm_memblock_item_t *item;
drm_via_private_t *dev_priv = (drm_via_private_t *) dev->dev_private;
+ unsigned long tmpSize;
DRM_COPY_FROM_USER_IOCTL(mem, (drm_via_mem_t __user *) data,
sizeof(mem));
@@ -149,8 +150,8 @@ int via_mem_alloc(DRM_IOCTL_ARGS)
return DRM_ERR(EINVAL);
}
- mem.size = (mem.size + VIA_MM_ALIGN_MASK) >> VIA_MM_ALIGN_SHIFT;
- item = drm_sman_alloc(&dev_priv->sman, mem.type, mem.size, 0,
+ tmpSize = (mem.size + VIA_MM_ALIGN_MASK) >> VIA_MM_ALIGN_SHIFT;
+ item = drm_sman_alloc(&dev_priv->sman, mem.type, tmpSize, 0,
(unsigned long)priv);
up(&dev->struct_sem);
if (item) {
@@ -159,7 +160,6 @@ int via_mem_alloc(DRM_IOCTL_ARGS)
(item->mm->
offset(item->mm, item->mm_info) << VIA_MM_ALIGN_SHIFT);
mem.index = item->user_hash.key;
- mem.size = mem.size << VIA_MM_ALIGN_SHIFT;
} else {
mem.offset = 0;
mem.size = 0;