summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <idr@us.ibm.com>2007-08-06 15:37:56 -0700
committerIan Romanick <idr@us.ibm.com>2007-08-06 15:37:56 -0700
commit78e9c1a93d00097895bc77d9ac90da1945021804 (patch)
treea341f05292d1747f0067a164b417ed9c3397221c
parent997a9a738ec26cf0ef2c7dee5e30bb53bd11bf6c (diff)
Eliminate special-case handling of framebuffer (fake) allocation.
-rw-r--r--linux-core/xgi_drv.h2
-rw-r--r--linux-core/xgi_fb.c51
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;
}