From 0203edaa21451c2840d3c4116fb0bdbec82cb0fe Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Fri, 16 Jun 2006 15:20:20 +0000 Subject: 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. --- linux-core/via_mm.c | 6 +++--- 1 file 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; -- cgit v1.2.3