diff options
author | Ian Romanick <idr@us.ibm.com> | 2007-08-06 17:27:15 -0700 |
---|---|---|
committer | Ian Romanick <idr@us.ibm.com> | 2007-08-06 17:27:15 -0700 |
commit | f7ba02b7458823627097a2320bf9befa84fc9c76 (patch) | |
tree | bc04994f289611ed53737b37b9391b6b4ea36dae /linux-core/xgi_fb.c | |
parent | 6718198897ef9e275506d3fcb497641e1b09d3b1 (diff) |
Unify infrastructure for freeing on-card / GART memory.
Diffstat (limited to 'linux-core/xgi_fb.c')
-rw-r--r-- | linux-core/xgi_fb.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/linux-core/xgi_fb.c b/linux-core/xgi_fb.c index f8341a67..26e6fc4e 100644 --- a/linux-core/xgi_fb.c +++ b/linux-core/xgi_fb.c @@ -169,8 +169,8 @@ static struct xgi_mem_block *xgi_mem_alloc(struct xgi_mem_heap * heap, return (used_block); } -int xgi_mem_free(struct xgi_mem_heap * heap, unsigned long offset, - struct drm_file * filp) +static int xgi_mem_free(struct xgi_mem_heap * heap, unsigned long offset, + struct drm_file * filp) { struct xgi_mem_block *used_block = NULL, *block; struct xgi_mem_block *prev, *next; @@ -287,13 +287,16 @@ int xgi_fb_alloc_ioctl(struct drm_device * dev, void * data, } -int xgi_fb_free(struct xgi_info * info, unsigned long offset, - struct drm_file * filp) +int xgi_free(struct xgi_info * info, unsigned long index, + struct drm_file * filp) { int err = 0; + const unsigned heap = index & 0x03; mutex_lock(&info->dev->struct_mutex); - err = xgi_mem_free(&info->fb_heap, offset, filp); + err = xgi_mem_free((heap == XGI_MEMLOC_NON_LOCAL) + ? &info->pcie_heap : &info->fb_heap, + (index & ~0x03), filp); mutex_unlock(&info->dev->struct_mutex); return err; @@ -305,7 +308,7 @@ int xgi_fb_free_ioctl(struct drm_device * dev, void * data, { struct xgi_info *info = dev->dev_private; - return xgi_fb_free(info, *(u32 *) data, filp); + return xgi_free(info, XGI_MEMLOC_LOCAL | *(u32 *) data, filp); } |