gma500: begin adding GEM
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / drivers / staging / gma500 / psb_pvr_glue.c
blobda78946b57ad8300b99bd8f7780613396f5ef8f4
1 /*
2 * Copyright (c) 2009, Intel Corporation.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
19 #include "psb_pvr_glue.h"
21 /**
22 * FIXME: should NOT use these file under env/linux directly
25 int psb_get_meminfo_by_handle(void *hKernelMemInfo,
26 void **ppsKernelMemInfo)
28 return -EINVAL;
29 #if 0
30 void *psKernelMemInfo = IMG_NULL;
31 PVRSRV_PER_PROCESS_DATA *psPerProc = IMG_NULL;
32 PVRSRV_ERROR eError;
34 psPerProc = PVRSRVPerProcessData(task_tgid_nr(current));
35 eError = PVRSRVLookupHandle(psPerProc->psHandleBase,
36 (IMG_VOID *)&psKernelMemInfo,
37 hKernelMemInfo,
38 PVRSRV_HANDLE_TYPE_MEM_INFO);
39 if (eError != PVRSRV_OK) {
40 DRM_ERROR("Cannot find kernel meminfo for handle 0x%x\n",
41 (u32)hKernelMemInfo);
42 return -EINVAL;
45 *ppsKernelMemInfo = psKernelMemInfo;
47 DRM_DEBUG("Got Kernel MemInfo for handle %lx\n",
48 (u32)hKernelMemInfo);
49 return 0;
50 #endif
53 int psb_get_pages_by_mem_handle(void *hOSMemHandle, struct page ***pages)
55 return -EINVAL;
56 #if 0
57 LinuxMemArea *psLinuxMemArea = (LinuxMemArea *)hOSMemHandle;
58 struct page **page_list;
59 if (psLinuxMemArea->eAreaType != LINUX_MEM_AREA_ALLOC_PAGES) {
60 DRM_ERROR("MemArea type is not LINUX_MEM_AREA_ALLOC_PAGES\n");
61 return -EINVAL;
64 page_list = psLinuxMemArea->uData.sPageList.pvPageList;
65 if (!page_list) {
66 DRM_DEBUG("Page List is NULL\n");
67 return -ENOMEM;
70 *pages = page_list;
71 return 0;
72 #endif