summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}