From 2f2d8b9688743ac6367bf13c3c023310a257ceb7 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 9 Jul 2007 15:59:09 -0700 Subject: Merge xgi_mem_req and xgi_mem_alloc into a single type. These two structures were used as the request and reply for certain ioctls. Having a different type for an ioctl's input and output is just wierd. In addition, each structure contained fields (e.g., pid) that had no business being there. This change requires updates to user-space. --- linux-core/xgi_pcie.c | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) (limited to 'linux-core/xgi_pcie.c') diff --git a/linux-core/xgi_pcie.c b/linux-core/xgi_pcie.c index 82111249..0f82e4ec 100644 --- a/linux-core/xgi_pcie.c +++ b/linux-core/xgi_pcie.c @@ -764,14 +764,13 @@ static struct xgi_pcie_block *xgi_pcie_mem_free(struct xgi_info * info, return (used_block); } -void xgi_pcie_alloc(struct xgi_info * info, unsigned long size, - enum PcieOwner owner, struct xgi_mem_alloc * alloc) +void xgi_pcie_alloc(struct xgi_info * info, struct xgi_mem_alloc * alloc, + pid_t pid) { struct xgi_pcie_block *block; - struct xgi_mem_pid *mempid_block; xgi_down(info->pcie_sem); - block = xgi_pcie_mem_alloc(info, size, owner); + block = xgi_pcie_mem_alloc(info, alloc->size, alloc->owner); xgi_up(info->pcie_sem); if (block == NULL) { @@ -794,17 +793,18 @@ void xgi_pcie_alloc(struct xgi_info * info, unsigned long size, PCIE_3D request means a opengl process created. PCIE_3D_TEXTURE request means texture cannot alloc from fb. */ - if (owner == PCIE_3D || owner == PCIE_3D_TEXTURE) { - mempid_block = + if ((alloc->owner == PCIE_3D) + || (alloc->owner == PCIE_3D_TEXTURE)) { + struct xgi_mem_pid *mempid_block = kmalloc(sizeof(struct xgi_mem_pid), GFP_KERNEL); if (!mempid_block) XGI_ERROR("mempid_block alloc failed\n"); mempid_block->location = XGI_MEMLOC_NON_LOCAL; - if (owner == PCIE_3D) + if (alloc->owner == PCIE_3D) mempid_block->bus_addr = 0xFFFFFFFF; /*xgi_pcie_vertex_block has the address */ else mempid_block->bus_addr = alloc->bus_addr; - mempid_block->pid = alloc->pid; + mempid_block->pid = pid; XGI_INFO ("Memory ProcessID add one pcie block pid:%ld successfully! \n", @@ -944,15 +944,6 @@ void *xgi_find_pcie_virt(struct xgi_info * info, unsigned long address) return NULL; } -void xgi_read_pcie_mem(struct xgi_info * info, struct xgi_mem_req * req) -{ - -} - -void xgi_write_pcie_mem(struct xgi_info * info, struct xgi_mem_req * req) -{ -} - /* address -- GE hw address */ -- cgit v1.2.3