{
struct xgi_mem_alloc mem_alloc = {
.size = size,
- .owner = PCIE_2D,
};
int err;
#define DRIVER_NAME "xgi"
#define DRIVER_DESC "XGI XP5 / XP10 / XG47"
-#define DRIVER_DATE "20070723"
+#define DRIVER_DATE "20070806"
#define DRIVER_MAJOR 0
#define DRIVER_MINOR 10
-#define DRIVER_PATCHLEVEL 0
+#define DRIVER_PATCHLEVEL 1
#include "xgi_cmdlist.h"
#include "xgi_drm.h"
unsigned long offset;
unsigned long size;
struct drm_file * filp;
-
- unsigned int owner;
};
struct xgi_mem_heap {
struct xgi_cmdring_info cmdring;
};
-enum PcieOwner {
- PCIE_2D = 0,
- /*
- PCIE_3D should not begin with 1,
- 2D alloc pcie memory will use owner 1.
- */
- PCIE_3D = 11, /*vetex buf */
- PCIE_3D_CMDLIST = 12,
- PCIE_3D_SCRATCHPAD = 13,
- PCIE_3D_TEXTURE = 14,
- PCIE_INVALID = 0x7fffffff
-};
-
-
extern struct kmem_cache *xgi_mem_block_cache;
extern struct xgi_mem_block *xgi_mem_alloc(struct xgi_mem_heap * heap,
- unsigned long size, enum PcieOwner owner);
+ unsigned long size);
extern int xgi_mem_free(struct xgi_mem_heap * heap, unsigned long offset,
struct drm_file * filp);
extern int xgi_mem_heap_init(struct xgi_mem_heap * heap, unsigned int start,
block->offset = 0;
block->size = 0;
- block->owner = PCIE_INVALID;
block->filp = (struct drm_file *) -1;
return block;
struct xgi_mem_block *xgi_mem_alloc(struct xgi_mem_heap * heap,
- unsigned long originalSize,
- enum PcieOwner owner)
+ unsigned long originalSize)
{
struct xgi_mem_block *block, *free_block, *used_block;
unsigned long size = (originalSize + PAGE_SIZE - 1) & PAGE_MASK;
heap->max_freesize -= size;
list_add(&used_block->list, &heap->used_list);
- used_block->owner = owner;
return (used_block);
}
("Video RAM allocation on front buffer successfully! \n");
} else {
down(&info->fb_sem);
- block = xgi_mem_alloc(&info->fb_heap, alloc->size, PCIE_2D);
+ block = xgi_mem_alloc(&info->fb_heap, alloc->size);
up(&info->fb_sem);
if (block == NULL) {
struct xgi_mem_block *block;
down(&info->pcie_sem);
- if ((alloc->owner == PCIE_3D) && (xgi_pcie_vertex_block)) {
- DRM_INFO("PCIE Vertex has been created, return directly.\n");
- block = xgi_pcie_vertex_block;
- }
- else if ((alloc->owner == PCIE_3D_CMDLIST) && (xgi_pcie_cmdlist_block)) {
- DRM_INFO("PCIE Cmdlist has been created, return directly.\n");
- block = xgi_pcie_cmdlist_block;
- }
- else if ((alloc->owner == PCIE_3D_SCRATCHPAD) && (xgi_pcie_scratchpad_block)) {
- DRM_INFO("PCIE Scratchpad has been created, return directly.\n");
- block = xgi_pcie_scratchpad_block;
- }
- else {
- block = xgi_mem_alloc(&info->pcie_heap, alloc->size, alloc->owner);
-
- if (alloc->owner == PCIE_3D) {
- xgi_pcie_vertex_block = block;
- }
- else if (alloc->owner == PCIE_3D_CMDLIST) {
- xgi_pcie_cmdlist_block = block;
- }
- else if (alloc->owner == PCIE_3D_SCRATCHPAD) {
- xgi_pcie_scratchpad_block = block;
- }
- }
+ block = xgi_mem_alloc(&info->pcie_heap, alloc->size);
up(&info->pcie_sem);
if (block == NULL) {