From 78e9c1a93d00097895bc77d9ac90da1945021804 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 6 Aug 2007 15:37:56 -0700 Subject: Eliminate special-case handling of framebuffer (fake) allocation. --- linux-core/xgi_drv.h | 2 +- linux-core/xgi_fb.c | 51 +++++++++++++++++++-------------------------------- 2 files changed, 20 insertions(+), 33 deletions(-) diff --git a/linux-core/xgi_drv.h b/linux-core/xgi_drv.h index f771517d..8a144fda 100644 --- a/linux-core/xgi_drv.h +++ b/linux-core/xgi_drv.h @@ -38,7 +38,7 @@ #define DRIVER_MAJOR 0 #define DRIVER_MINOR 10 -#define DRIVER_PATCHLEVEL 1 +#define DRIVER_PATCHLEVEL 2 #include "xgi_cmdlist.h" #include "xgi_drm.h" diff --git a/linux-core/xgi_fb.c b/linux-core/xgi_fb.c index bbdebb57..b27b6b20 100644 --- a/linux-core/xgi_fb.c +++ b/linux-core/xgi_fb.c @@ -247,32 +247,23 @@ int xgi_fb_alloc(struct xgi_info * info, struct xgi_mem_alloc * alloc, { struct xgi_mem_block *block; - if (alloc->is_front) { - alloc->location = XGI_MEMLOC_LOCAL; - alloc->offset = 0; - alloc->hw_addr = 0; - DRM_INFO - ("Video RAM allocation on front buffer successfully! \n"); + down(&info->fb_sem); + block = xgi_mem_alloc(&info->fb_heap, alloc->size); + up(&info->fb_sem); + + if (block == NULL) { + alloc->size = 0; + DRM_ERROR("Video RAM allocation failed\n"); + return -ENOMEM; } else { - down(&info->fb_sem); - block = xgi_mem_alloc(&info->fb_heap, alloc->size); - up(&info->fb_sem); - - if (block == NULL) { - alloc->location = XGI_MEMLOC_LOCAL; - alloc->size = 0; - DRM_ERROR("Video RAM allocation failed\n"); - return -ENOMEM; - } else { - DRM_INFO("Video RAM allocation succeeded: 0x%p\n", - (char *)block->offset); - alloc->location = XGI_MEMLOC_LOCAL; - alloc->size = block->size; - alloc->offset = block->offset; - alloc->hw_addr = block->offset; - - block->filp = filp; - } + DRM_INFO("Video RAM allocation succeeded: 0x%p\n", + (char *)block->offset); + alloc->location = XGI_MEMLOC_LOCAL; + alloc->size = block->size; + alloc->offset = block->offset; + alloc->hw_addr = block->offset; + + block->filp = filp; } return 0; @@ -295,13 +286,9 @@ int xgi_fb_free(struct xgi_info * info, unsigned long offset, { int err = 0; - if (offset == 0) { - DRM_INFO("free onscreen frame buffer successfully !\n"); - } else { - down(&info->fb_sem); - err = xgi_mem_free(&info->fb_heap, offset, filp); - up(&info->fb_sem); - } + down(&info->fb_sem); + err = xgi_mem_free(&info->fb_heap, offset, filp); + up(&info->fb_sem); return err; } -- cgit v1.2.3