diff options
author | Thomas Hellstrom <thomas@tungstengraphics.com> | 2006-06-16 15:20:20 +0000 |
---|---|---|
committer | Thomas Hellstrom <thomas@tungstengraphics.com> | 2006-06-16 15:20:20 +0000 |
commit | 0203edaa21451c2840d3c4116fb0bdbec82cb0fe (patch) | |
tree | 7324ee4b272c81b69c385b7ddd32ebc7a362cef7 | |
parent | ca1a77683d523dc1d2268531b19ea23b3e1ae4f0 (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.
-rw-r--r-- | linux-core/via_mm.c | 6 |
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; |