======================================================================
This file covers how to build and install the Imagination Technologies
-SGX DDK for the Linux kernel.
+SGX DDK for the Linux kernel.
Build System Environment Variables
-------------------------------------------
-The SGX DDK Build scripts depend on a number of environment variables
-being setup before compilation or installation of DDK software can
+The SGX DDK Build scripts depend on a number of environment variables
+being setup before compilation or installation of DDK software can
commence:
$DISCIMAGE
-The DDK Build scripts install files to the location specified by the
-DISCIMAGE environment variable, when the make install target is used.
+The DDK Build scripts install files to the location specified by the
+DISCIMAGE environment variable, when the make install target is used.
This should point to the target filesystem.
$ export DISCIMAGE=/path/to/filesystem
$KERNELDIR
-When building the SGX DDK kernel module, the build needs access
-to the headers of the Linux kernel
+When building the SGX DDK kernel module, the build needs access
+to the headers of the Linux kernel
$ export KERNELDIR=/path/to/kernel
$PATH
-If a cross compiler is being used make sure the PATH environment variable
+If a cross compiler is being used make sure the PATH environment variable
includes the path to the toolchain
$ export PATH=$PATH:/path/to/toolchain
$CROSS_COMPILE
-Since the SGX DDK Build scripts are geared toward a cross-compilation
-workflow, the CROSS_COMPILE environment variable needs to be set
+Since the SGX DDK Build scripts are geared toward a cross-compilation
+workflow, the CROSS_COMPILE environment variable needs to be set
$ export CROSS_COMPILE=toolchain-prefix-
Build and Install Instructions
-------------------------------------------
-The SGX DDK configures different target builds within directories under
-eurasiacon/build/linux/.
+The SGX DDK configures different target builds within directories under
+eurasiacon/build/linux/.
The supported build targets are:
clobber Removes all binaries for all builds as well.
install Runs the install script generated by the build.
-The following variables may be set on the command line to influence a build.
+The following variables may be set on the command line to influence a build.
- BUILD The type of build being performed.
- Alternatives are release, timing or debug.
- CFLAGS Build dependent optimisations and debug information flags.
- SILENT Determines whether text of commands is produced during build.
+ BUILD The type of build being performed.
+ Alternatives are release, timing or debug.
+ CFLAGS Build dependent optimisations and debug information flags.
+ SILENT Determines whether text of commands is produced during build.
To build for, change to the appropriate target directory, e.g.:
$ cd eurasiacon/build/linux/platform/kbuild
======================================================================
-About
+About
-------------------------------------------
-This is the Imagination Technologies SGX DDK for the Linux kernel.
+This is the Imagination Technologies SGX DDK for the Linux kernel.
License
You may use, distribute and copy this software under the terms of
GNU General Public License version 2.
-The full GNU General Public License version 2 is included in this
+The full GNU General Public License version 2 is included in this
distribution in the file called "COPYING".
-------------------------------------------
Imagination Technologies Ltd. <gpl-support@imgtec.com>
-Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
*****************************************************************************/
#define METHOD_BUFFERED 0
#define FILE_ANY_ACCESS 0
-#define CTL_CODE( DeviceType, Function, Method, Access ) (Function)
+#define CTL_CODE( DeviceType, Function, Method, Access ) (Function)
#define MAKEIOCTLINDEX(i) ((i) & 0xFFF)
#else
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
*******************************************************************************/
#if !defined (__IMG_DEFS_H__)
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
typedef void** IMG_HVOID, * IMG_PHVOID;
-#define IMG_NULL 0
+#define IMG_NULL 0
/* services/stream ID */
typedef IMG_UINT32 IMG_SID;
/* device virtual addresses are 32bit for now */
IMG_UINT32 uiAddr;
#define IMG_CAST_TO_DEVVADDR_UINT(var) (IMG_UINT32)(var)
-
+
} IMG_DEV_VIRTADDR;
typedef IMG_UINT32 IMG_DEVMEM_SIZE_T;
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
*****************************************************************************/
PVRSRV_PDUMP_PIXEL_FORMAT_BGRA5551 = 45,
PVRSRV_PDUMP_PIXEL_FORMAT_BGR565 = 46,
PVRSRV_PDUMP_PIXEL_FORMAT_A8 = 47,
-
+
PVRSRV_PDUMP_PIXEL_FORMAT_FORCE_I32 = 0x7fffffff
} PDUMP_PIXEL_FORMAT;
PVRSRV_PDUMP_MEM_FORMAT_TILED = 8,
PVRSRV_PDUMP_MEM_FORMAT_TWIDDLED = 9,
PVRSRV_PDUMP_MEM_FORMAT_HYBRID = 10,
-
+
PVRSRV_PDUMP_MEM_FORMAT_FORCE_I32 = 0x7fffffff
} PDUMP_MEM_FORMAT;
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#define _PVRMODULE_H_
MODULE_AUTHOR("Imagination Technologies Ltd. <gpl-support@imgtec.com>");
MODULE_LICENSE("GPL");
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
*/ /**************************************************************************/
#define PVRVERSION_FAMILY "sgxddk"
#define PVRVERSION_BRANCHNAME "1.8"
-#define PVRVERSION_BUILD 840215
+#define PVRVERSION_BUILD 793010
#define PVRVERSION_BSCONTROL "intel_android_sgx_ogles1_ogles2_GPL"
#define PVRVERSION_STRING "intel_android_sgx_ogles1_ogles2_GPL sgxddk 18 1.8@" PVR_STR2(PVRVERSION_BUILD)
#define COPYRIGHT_TXT "Copyright (c) Imagination Technologies Ltd. All Rights Reserved."
-#define PVRVERSION_BUILD_HI 84
-#define PVRVERSION_BUILD_LO 215
+#define PVRVERSION_BUILD_HI 79
+#define PVRVERSION_BUILD_LO 3010
#define PVRVERSION_STRING_NUMERIC PVR_STR2(PVRVERSION_MAJ) "." PVR_STR2(PVRVERSION_MIN) "." PVR_STR2(PVRVERSION_BUILD_HI) "." PVR_STR2(PVRVERSION_BUILD_LO)
#endif /* _PVRVERSION_H_ */
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#define PVRSRV_MAX_CMD_SIZE 1024
-#define PVRSRV_MAX_DEVICES 16
+#define PVRSRV_MAX_DEVICES 16
#define EVENTOBJNAME_MAXLENGTH (50)
#define PVRSRV_MEM_ION (1U<<29)
#define PVRSRV_MEM_ALLOCATENONCACHEDMEM (1UL<<30)
-#define PVRSRV_NO_CONTEXT_LOSS 0
-#define PVRSRV_SEVERE_LOSS_OF_CONTEXT 1
-#define PVRSRV_PRE_STATE_CHANGE_MASK 0x80
+#define PVRSRV_NO_CONTEXT_LOSS 0
+#define PVRSRV_SEVERE_LOSS_OF_CONTEXT 1
+#define PVRSRV_PRE_STATE_CHANGE_MASK 0x80
-#define PVRSRV_DEFAULT_DEV_COOKIE (1)
+#define PVRSRV_DEFAULT_DEV_COOKIE (1)
#define PVRSRV_MISC_INFO_TIMER_PRESENT (1U<<0)
PVRSRV_DEVICE_TYPE_VGX = 8,
PVRSRV_DEVICE_TYPE_TOPAZ = 9,
-
+
PVRSRV_DEVICE_TYPE_EXT = 10,
PVRSRV_DEVICE_TYPE_LAST = 10,
typedef struct _PVRSRV_DEVICE_IDENTIFIER_
{
- PVRSRV_DEVICE_TYPE eDeviceType;
- PVRSRV_DEVICE_CLASS eDeviceClass;
- IMG_UINT32 ui32DeviceIndex;
- IMG_CHAR *pszPDumpDevName;
- IMG_CHAR *pszPDumpRegName;
+ PVRSRV_DEVICE_TYPE eDeviceType;
+ PVRSRV_DEVICE_CLASS eDeviceClass;
+ IMG_UINT32 ui32DeviceIndex;
+ IMG_CHAR *pszPDumpDevName;
+ IMG_CHAR *pszPDumpRegName;
} PVRSRV_DEVICE_IDENTIFIER;
typedef struct _PVRSRV_CLIENT_DEV_DATA_
{
- IMG_UINT32 ui32NumDevices;
- PVRSRV_DEVICE_IDENTIFIER asDevID[PVRSRV_MAX_DEVICES];
- PVRSRV_ERROR (*apfnDevConnect[PVRSRV_MAX_DEVICES])(PPVRSRV_DEV_DATA);
- PVRSRV_ERROR (*apfnDumpTrace[PVRSRV_MAX_DEVICES])(PPVRSRV_DEV_DATA);
+ IMG_UINT32 ui32NumDevices;
+ PVRSRV_DEVICE_IDENTIFIER asDevID[PVRSRV_MAX_DEVICES];
+ PVRSRV_ERROR (*apfnDevConnect[PVRSRV_MAX_DEVICES])(PPVRSRV_DEV_DATA);
+ PVRSRV_ERROR (*apfnDumpTrace[PVRSRV_MAX_DEVICES])(PPVRSRV_DEV_DATA);
} PVRSRV_CLIENT_DEV_DATA;
typedef struct _PVRSRV_CONNECTION_
{
- IMG_HANDLE hServices;
- IMG_UINT32 ui32ProcessID;
- PVRSRV_CLIENT_DEV_DATA sClientDevData;
- IMG_UINT32 ui32SrvFlags;
+ IMG_HANDLE hServices;
+ IMG_UINT32 ui32ProcessID;
+ PVRSRV_CLIENT_DEV_DATA sClientDevData;
+ IMG_UINT32 ui32SrvFlags;
}PVRSRV_CONNECTION;
typedef struct _PVRSRV_DEV_DATA_
{
- IMG_CONST PVRSRV_CONNECTION *psConnection;
+ IMG_CONST PVRSRV_CONNECTION *psConnection;
#if defined (SUPPORT_SID_INTERFACE)
- IMG_SID hDevCookie;
+ IMG_SID hDevCookie;
#else
- IMG_HANDLE hDevCookie;
+ IMG_HANDLE hDevCookie;
#endif
} PVRSRV_DEV_DATA;
typedef struct _PVRSRV_MEMUPDATE_
{
- IMG_UINT32 ui32UpdateAddr;
- IMG_UINT32 ui32UpdateVal;
+ IMG_UINT32 ui32UpdateAddr;
+ IMG_UINT32 ui32UpdateVal;
} PVRSRV_MEMUPDATE;
typedef struct _PVRSRV_HWREG_
{
- IMG_UINT32 ui32RegAddr;
- IMG_UINT32 ui32RegVal;
+ IMG_UINT32 ui32RegAddr;
+ IMG_UINT32 ui32RegVal;
} PVRSRV_HWREG;
typedef struct _PVRSRV_MEMBLK_
{
- IMG_DEV_VIRTADDR sDevVirtAddr;
- IMG_HANDLE hOSMemHandle;
- IMG_HANDLE hOSWrapMem;
- IMG_HANDLE hBuffer;
- IMG_HANDLE hResItem;
+ IMG_DEV_VIRTADDR sDevVirtAddr;
+ IMG_HANDLE hOSMemHandle;
+ IMG_HANDLE hOSWrapMem;
+ IMG_HANDLE hBuffer;
+ IMG_HANDLE hResItem;
IMG_SYS_PHYADDR *psIntSysPAddr;
} PVRSRV_MEMBLK;
typedef struct _PVRSRV_CLIENT_MEM_INFO_
{
-
+
IMG_PVOID pvLinAddr;
-
+
IMG_PVOID pvLinAddrKM;
-
+
IMG_DEV_VIRTADDR sDevVAddr;
-
+
IMG_CPU_PHYADDR sCpuPAddr;
-
+
IMG_UINT32 ui32Flags;
-
+
IMG_UINT32 ui32ClientFlags;
-
+
IMG_SIZE_T uAllocSize;
-
+
struct _PVRSRV_CLIENT_SYNC_INFO_ *psClientSyncInfo;
#if defined (SUPPORT_SID_INTERFACE)
-
+
IMG_SID hMappingInfo;
-
+
IMG_SID hKernelMemInfo;
-
+
IMG_SID hResItem;
#else
-
+
IMG_HANDLE hMappingInfo;
-
+
IMG_HANDLE hKernelMemInfo;
-
+
IMG_HANDLE hResItem;
#endif
#if defined(SUPPORT_MEMINFO_IDS)
#if !defined(USE_CODE)
-
+
IMG_UINT64 ui64Stamp;
- #else
+ #else
IMG_UINT32 dummy1;
IMG_UINT32 dummy2;
- #endif
-#endif
-
+ #endif
+#endif
+
struct _PVRSRV_CLIENT_MEM_INFO_ *psNext;
typedef struct _PVRSRV_EVENTOBJECT_
{
-
+
IMG_CHAR szName[EVENTOBJNAME_MAXLENGTH];
-
+
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hOSEventKM;
#else
typedef struct _PVRSRV_MISC_INFO_
{
- IMG_UINT32 ui32StateRequest;
- IMG_UINT32 ui32StatePresent;
-
+ IMG_UINT32 ui32StateRequest;
+ IMG_UINT32 ui32StatePresent;
+
IMG_VOID *pvSOCTimerRegisterKM;
IMG_VOID *pvSOCTimerRegisterUM;
#if defined (SUPPORT_SID_INTERFACE)
IMG_HANDLE hSOCTimerRegisterMappingInfo;
#endif
-
+
IMG_VOID *pvSOCClockGateRegs;
IMG_UINT32 ui32SOCClockGateRegsSize;
-
+
IMG_CHAR *pszMemoryStr;
IMG_UINT32 ui32MemoryStrLen;
-
+
PVRSRV_EVENTOBJECT sGlobalEventObject;
#if defined (SUPPORT_SID_INTERFACE)
IMG_EVENTSID hOSGlobalEvent;
IMG_HANDLE hOSGlobalEvent;
#endif
-
+
IMG_UINT32 aui32DDKVersion[4];
-
+
struct
{
-
+
IMG_BOOL bDeferOp;
-
+
PVRSRV_MISC_INFO_CPUCACHEOP_TYPE eCacheOpType;
-
+
#if !defined (SUPPORT_SID_INTERFACE)
union
{
-
+
PVRSRV_CLIENT_MEM_INFO *psClientMemInfo;
-
+
struct _PVRSRV_KERNEL_MEM_INFO_ *psKernelMemInfo;
} u;
#endif
-
+
IMG_VOID *pvBaseVAddr;
-
+
IMG_UINT32 ui32Length;
} sCacheOpCtl;
-
+
struct
{
-
+
#if !defined(SUPPORT_SID_INTERFACE)
union
{
-
+
PVRSRV_CLIENT_MEM_INFO *psClientMemInfo;
-
+
struct _PVRSRV_KERNEL_MEM_INFO_ *psKernelMemInfo;
} u;
#endif
-
+
IMG_UINT32 ui32RefCount;
} sGetRefCountCtl;
} PVRSRV_MISC_INFO;
typedef struct _PVRSRV_SYNC_TOKEN_
{
-
+
struct
{
IMG_HANDLE hDstDevMemHeap,
#endif
PVRSRV_CLIENT_MEM_INFO **ppsDstMemInfo);
-#endif
+#endif
#if defined(SUPPORT_ION)
PVRSRV_ERROR PVRSRVMapIonHandle(const PVRSRV_DEV_DATA *psDevData,
PVRSRV_ERROR PVRSRVUnmapIonHandle(const PVRSRV_DEV_DATA *psDevData,
PVRSRV_CLIENT_MEM_INFO *psMemInfo);
-#endif
+#endif
typedef enum _PVRSRV_SYNCVAL_MODE_
{
IMG_SID hKernelMemInfo,
#else
PVRSRV_CLIENT_MEM_INFO *psMemInfo,
-#endif
+#endif
IMG_UINT32 ui32Offset,
IMG_UINT32 ui32Value,
IMG_UINT32 ui32Mask,
PVR_UNREFERENCED_PARAMETER(iPostCount);
}
-#endif
+#endif
#if (defined(DEBUG) && defined(__linux__))
IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVFreeUserModeMemTracking(IMG_VOID *pvMem);
-IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVReallocUserModeMemTracking(IMG_VOID *pvMem, IMG_SIZE_T ui32NewSize,
+IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVReallocUserModeMemTracking(IMG_VOID *pvMem, IMG_SIZE_T ui32NewSize,
IMG_CHAR *pszFileName, IMG_UINT32 ui32LineNumber);
-#endif
+#endif
IMG_IMPORT PVRSRV_ERROR PVRSRVEventObjectWait(const PVRSRV_CONNECTION *psConnection,
#if defined (SUPPORT_SID_INTERFACE)
#if defined (__cplusplus)
}
#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#if !defined (__SERVICESEXT_H__)
#define __SERVICESEXT_H__
-#define PVRSRV_LOCKFLG_READONLY (1)
+#define PVRSRV_LOCKFLG_READONLY (1)
typedef enum _PVRSRV_ERROR_
{
typedef enum _PVRSRV_SYS_POWER_STATE_
{
- PVRSRV_SYS_POWER_STATE_Unspecified = -1,
- PVRSRV_SYS_POWER_STATE_D0 = 0,
- PVRSRV_SYS_POWER_STATE_D1 = 1,
- PVRSRV_SYS_POWER_STATE_D2 = 2,
- PVRSRV_SYS_POWER_STATE_D3 = 3,
- PVRSRV_SYS_POWER_STATE_D4 = 4,
+ PVRSRV_SYS_POWER_STATE_Unspecified = -1,
+ PVRSRV_SYS_POWER_STATE_D0 = 0,
+ PVRSRV_SYS_POWER_STATE_D1 = 1,
+ PVRSRV_SYS_POWER_STATE_D2 = 2,
+ PVRSRV_SYS_POWER_STATE_D3 = 3,
+ PVRSRV_SYS_POWER_STATE_D4 = 4,
PVRSRV_SYS_POWER_STATE_FORCE_I32 = 0x7fffffff
typedef enum _PVRSRV_DEV_POWER_STATE_
{
- PVRSRV_DEV_POWER_STATE_DEFAULT = -1,
- PVRSRV_DEV_POWER_STATE_ON = 0,
- PVRSRV_DEV_POWER_STATE_IDLE = 1,
- PVRSRV_DEV_POWER_STATE_OFF = 2,
+ PVRSRV_DEV_POWER_STATE_DEFAULT = -1,
+ PVRSRV_DEV_POWER_STATE_ON = 0,
+ PVRSRV_DEV_POWER_STATE_IDLE = 1,
+ PVRSRV_DEV_POWER_STATE_OFF = 2,
PVRSRV_DEV_POWER_STATE_FORCE_I32 = 0x7fffffff
-} PVRSRV_DEV_POWER_STATE, *PPVRSRV_DEV_POWER_STATE;
+} PVRSRV_DEV_POWER_STATE, *PPVRSRV_DEV_POWER_STATE;
typedef PVRSRV_ERROR (*PFN_PRE_POWER) (IMG_HANDLE hDevHandle,
typedef enum _PVRSRV_PIXEL_FORMAT_ {
-
+
PVRSRV_PIXEL_FORMAT_UNKNOWN = 0,
PVRSRV_PIXEL_FORMAT_RGB565 = 1,
PVRSRV_PIXEL_FORMAT_RGB555 = 2,
- PVRSRV_PIXEL_FORMAT_RGB888 = 3,
- PVRSRV_PIXEL_FORMAT_BGR888 = 4,
+ PVRSRV_PIXEL_FORMAT_RGB888 = 3,
+ PVRSRV_PIXEL_FORMAT_BGR888 = 4,
PVRSRV_PIXEL_FORMAT_GREY_SCALE = 8,
PVRSRV_PIXEL_FORMAT_PAL12 = 13,
PVRSRV_PIXEL_FORMAT_PAL8 = 14,
PVRSRV_PIXEL_FORMAT_BGRA8888 = 28,
PVRSRV_PIXEL_FORMAT_XRGB4444 = 29,
PVRSRV_PIXEL_FORMAT_ARGB8332 = 30,
- PVRSRV_PIXEL_FORMAT_A2RGB10 = 31,
- PVRSRV_PIXEL_FORMAT_A2BGR10 = 32,
+ PVRSRV_PIXEL_FORMAT_A2RGB10 = 31,
+ PVRSRV_PIXEL_FORMAT_A2BGR10 = 32,
PVRSRV_PIXEL_FORMAT_P8 = 33,
PVRSRV_PIXEL_FORMAT_L8 = 34,
PVRSRV_PIXEL_FORMAT_A8L8 = 35,
PVRSRV_PIXEL_FORMAT_D24S8 = 45,
PVRSRV_PIXEL_FORMAT_D24X8 = 46,
-
+
PVRSRV_PIXEL_FORMAT_ABGR16 = 47,
PVRSRV_PIXEL_FORMAT_ABGR16F = 48,
PVRSRV_PIXEL_FORMAT_ABGR32 = 49,
PVRSRV_PIXEL_FORMAT_GR32 = 54,
PVRSRV_PIXEL_FORMAT_E5BGR9 = 55,
-
+
PVRSRV_PIXEL_FORMAT_RESERVED1 = 56,
PVRSRV_PIXEL_FORMAT_RESERVED2 = 57,
PVRSRV_PIXEL_FORMAT_RESERVED3 = 58,
PVRSRV_PIXEL_FORMAT_RESERVED4 = 59,
PVRSRV_PIXEL_FORMAT_RESERVED5 = 60,
-
+
PVRSRV_PIXEL_FORMAT_R8G8_B8G8 = 61,
PVRSRV_PIXEL_FORMAT_G8R8_G8B8 = 62,
-
+
PVRSRV_PIXEL_FORMAT_NV11 = 63,
PVRSRV_PIXEL_FORMAT_NV12 = 64,
-
+
PVRSRV_PIXEL_FORMAT_YUY2 = 65,
PVRSRV_PIXEL_FORMAT_YUV420 = 66,
PVRSRV_PIXEL_FORMAT_YUV444 = 67,
PVRSRV_PIXEL_FORMAT_UYVY = 71,
PVRSRV_PIXEL_FORMAT_VYUY = 72,
- PVRSRV_PIXEL_FORMAT_FOURCC_ORG_UYVY = 73,
- PVRSRV_PIXEL_FORMAT_FOURCC_ORG_YUYV = 74,
- PVRSRV_PIXEL_FORMAT_FOURCC_ORG_YVYU = 75,
- PVRSRV_PIXEL_FORMAT_FOURCC_ORG_VYUY = 76,
- PVRSRV_PIXEL_FORMAT_FOURCC_ORG_AYUV = 77,
-
-
- PVRSRV_PIXEL_FORMAT_A32B32G32R32 = 78,
- PVRSRV_PIXEL_FORMAT_A32B32G32R32F = 79,
- PVRSRV_PIXEL_FORMAT_A32B32G32R32_UINT = 80,
- PVRSRV_PIXEL_FORMAT_A32B32G32R32_SINT = 81,
-
-
- PVRSRV_PIXEL_FORMAT_B32G32R32 = 82,
- PVRSRV_PIXEL_FORMAT_B32G32R32F = 83,
- PVRSRV_PIXEL_FORMAT_B32G32R32_UINT = 84,
- PVRSRV_PIXEL_FORMAT_B32G32R32_SINT = 85,
-
-
- PVRSRV_PIXEL_FORMAT_G32R32 = 86,
- PVRSRV_PIXEL_FORMAT_G32R32F = 87,
- PVRSRV_PIXEL_FORMAT_G32R32_UINT = 88,
- PVRSRV_PIXEL_FORMAT_G32R32_SINT = 89,
-
-
- PVRSRV_PIXEL_FORMAT_D32F = 90,
- PVRSRV_PIXEL_FORMAT_R32 = 91,
- PVRSRV_PIXEL_FORMAT_R32F = 92,
- PVRSRV_PIXEL_FORMAT_R32_UINT = 93,
- PVRSRV_PIXEL_FORMAT_R32_SINT = 94,
-
-
- PVRSRV_PIXEL_FORMAT_A16B16G16R16 = 95,
- PVRSRV_PIXEL_FORMAT_A16B16G16R16F = 96,
- PVRSRV_PIXEL_FORMAT_A16B16G16R16_SINT = 97,
- PVRSRV_PIXEL_FORMAT_A16B16G16R16_SNORM = 98,
- PVRSRV_PIXEL_FORMAT_A16B16G16R16_UINT = 99,
- PVRSRV_PIXEL_FORMAT_A16B16G16R16_UNORM = 100,
-
-
- PVRSRV_PIXEL_FORMAT_G16R16 = 101,
- PVRSRV_PIXEL_FORMAT_G16R16F = 102,
- PVRSRV_PIXEL_FORMAT_G16R16_UINT = 103,
- PVRSRV_PIXEL_FORMAT_G16R16_UNORM = 104,
- PVRSRV_PIXEL_FORMAT_G16R16_SINT = 105,
- PVRSRV_PIXEL_FORMAT_G16R16_SNORM = 106,
-
-
- PVRSRV_PIXEL_FORMAT_R16 = 107,
- PVRSRV_PIXEL_FORMAT_R16F = 108,
- PVRSRV_PIXEL_FORMAT_R16_UINT = 109,
- PVRSRV_PIXEL_FORMAT_R16_UNORM = 110,
- PVRSRV_PIXEL_FORMAT_R16_SINT = 111,
- PVRSRV_PIXEL_FORMAT_R16_SNORM = 112,
-
-
- PVRSRV_PIXEL_FORMAT_X8R8G8B8 = 113,
- PVRSRV_PIXEL_FORMAT_X8R8G8B8_UNORM = 114,
- PVRSRV_PIXEL_FORMAT_X8R8G8B8_UNORM_SRGB = 115,
-
- PVRSRV_PIXEL_FORMAT_A8R8G8B8 = 116,
- PVRSRV_PIXEL_FORMAT_A8R8G8B8_UNORM = 117,
- PVRSRV_PIXEL_FORMAT_A8R8G8B8_UNORM_SRGB = 118,
-
- PVRSRV_PIXEL_FORMAT_A8B8G8R8 = 119,
- PVRSRV_PIXEL_FORMAT_A8B8G8R8_UINT = 120,
- PVRSRV_PIXEL_FORMAT_A8B8G8R8_UNORM = 121,
- PVRSRV_PIXEL_FORMAT_A8B8G8R8_UNORM_SRGB = 122,
- PVRSRV_PIXEL_FORMAT_A8B8G8R8_SINT = 123,
- PVRSRV_PIXEL_FORMAT_A8B8G8R8_SNORM = 124,
-
-
- PVRSRV_PIXEL_FORMAT_G8R8 = 125,
- PVRSRV_PIXEL_FORMAT_G8R8_UINT = 126,
- PVRSRV_PIXEL_FORMAT_G8R8_UNORM = 127,
- PVRSRV_PIXEL_FORMAT_G8R8_SINT = 128,
- PVRSRV_PIXEL_FORMAT_G8R8_SNORM = 129,
-
-
- PVRSRV_PIXEL_FORMAT_A8 = 130,
- PVRSRV_PIXEL_FORMAT_R8 = 131,
- PVRSRV_PIXEL_FORMAT_R8_UINT = 132,
- PVRSRV_PIXEL_FORMAT_R8_UNORM = 133,
- PVRSRV_PIXEL_FORMAT_R8_SINT = 134,
- PVRSRV_PIXEL_FORMAT_R8_SNORM = 135,
-
-
- PVRSRV_PIXEL_FORMAT_A2B10G10R10 = 136,
- PVRSRV_PIXEL_FORMAT_A2B10G10R10_UNORM = 137,
- PVRSRV_PIXEL_FORMAT_A2B10G10R10_UINT = 138,
-
-
- PVRSRV_PIXEL_FORMAT_B10G11R11 = 139,
- PVRSRV_PIXEL_FORMAT_B10G11R11F = 140,
-
-
- PVRSRV_PIXEL_FORMAT_X24G8R32 = 141,
- PVRSRV_PIXEL_FORMAT_G8R24 = 142,
+ PVRSRV_PIXEL_FORMAT_FOURCC_ORG_UYVY = 73,
+ PVRSRV_PIXEL_FORMAT_FOURCC_ORG_YUYV = 74,
+ PVRSRV_PIXEL_FORMAT_FOURCC_ORG_YVYU = 75,
+ PVRSRV_PIXEL_FORMAT_FOURCC_ORG_VYUY = 76,
+ PVRSRV_PIXEL_FORMAT_FOURCC_ORG_AYUV = 77,
+
+
+ PVRSRV_PIXEL_FORMAT_A32B32G32R32 = 78,
+ PVRSRV_PIXEL_FORMAT_A32B32G32R32F = 79,
+ PVRSRV_PIXEL_FORMAT_A32B32G32R32_UINT = 80,
+ PVRSRV_PIXEL_FORMAT_A32B32G32R32_SINT = 81,
+
+
+ PVRSRV_PIXEL_FORMAT_B32G32R32 = 82,
+ PVRSRV_PIXEL_FORMAT_B32G32R32F = 83,
+ PVRSRV_PIXEL_FORMAT_B32G32R32_UINT = 84,
+ PVRSRV_PIXEL_FORMAT_B32G32R32_SINT = 85,
+
+
+ PVRSRV_PIXEL_FORMAT_G32R32 = 86,
+ PVRSRV_PIXEL_FORMAT_G32R32F = 87,
+ PVRSRV_PIXEL_FORMAT_G32R32_UINT = 88,
+ PVRSRV_PIXEL_FORMAT_G32R32_SINT = 89,
+
+
+ PVRSRV_PIXEL_FORMAT_D32F = 90,
+ PVRSRV_PIXEL_FORMAT_R32 = 91,
+ PVRSRV_PIXEL_FORMAT_R32F = 92,
+ PVRSRV_PIXEL_FORMAT_R32_UINT = 93,
+ PVRSRV_PIXEL_FORMAT_R32_SINT = 94,
+
+
+ PVRSRV_PIXEL_FORMAT_A16B16G16R16 = 95,
+ PVRSRV_PIXEL_FORMAT_A16B16G16R16F = 96,
+ PVRSRV_PIXEL_FORMAT_A16B16G16R16_SINT = 97,
+ PVRSRV_PIXEL_FORMAT_A16B16G16R16_SNORM = 98,
+ PVRSRV_PIXEL_FORMAT_A16B16G16R16_UINT = 99,
+ PVRSRV_PIXEL_FORMAT_A16B16G16R16_UNORM = 100,
+
+
+ PVRSRV_PIXEL_FORMAT_G16R16 = 101,
+ PVRSRV_PIXEL_FORMAT_G16R16F = 102,
+ PVRSRV_PIXEL_FORMAT_G16R16_UINT = 103,
+ PVRSRV_PIXEL_FORMAT_G16R16_UNORM = 104,
+ PVRSRV_PIXEL_FORMAT_G16R16_SINT = 105,
+ PVRSRV_PIXEL_FORMAT_G16R16_SNORM = 106,
+
+
+ PVRSRV_PIXEL_FORMAT_R16 = 107,
+ PVRSRV_PIXEL_FORMAT_R16F = 108,
+ PVRSRV_PIXEL_FORMAT_R16_UINT = 109,
+ PVRSRV_PIXEL_FORMAT_R16_UNORM = 110,
+ PVRSRV_PIXEL_FORMAT_R16_SINT = 111,
+ PVRSRV_PIXEL_FORMAT_R16_SNORM = 112,
+
+
+ PVRSRV_PIXEL_FORMAT_X8R8G8B8 = 113,
+ PVRSRV_PIXEL_FORMAT_X8R8G8B8_UNORM = 114,
+ PVRSRV_PIXEL_FORMAT_X8R8G8B8_UNORM_SRGB = 115,
+
+ PVRSRV_PIXEL_FORMAT_A8R8G8B8 = 116,
+ PVRSRV_PIXEL_FORMAT_A8R8G8B8_UNORM = 117,
+ PVRSRV_PIXEL_FORMAT_A8R8G8B8_UNORM_SRGB = 118,
+
+ PVRSRV_PIXEL_FORMAT_A8B8G8R8 = 119,
+ PVRSRV_PIXEL_FORMAT_A8B8G8R8_UINT = 120,
+ PVRSRV_PIXEL_FORMAT_A8B8G8R8_UNORM = 121,
+ PVRSRV_PIXEL_FORMAT_A8B8G8R8_UNORM_SRGB = 122,
+ PVRSRV_PIXEL_FORMAT_A8B8G8R8_SINT = 123,
+ PVRSRV_PIXEL_FORMAT_A8B8G8R8_SNORM = 124,
+
+
+ PVRSRV_PIXEL_FORMAT_G8R8 = 125,
+ PVRSRV_PIXEL_FORMAT_G8R8_UINT = 126,
+ PVRSRV_PIXEL_FORMAT_G8R8_UNORM = 127,
+ PVRSRV_PIXEL_FORMAT_G8R8_SINT = 128,
+ PVRSRV_PIXEL_FORMAT_G8R8_SNORM = 129,
+
+
+ PVRSRV_PIXEL_FORMAT_A8 = 130,
+ PVRSRV_PIXEL_FORMAT_R8 = 131,
+ PVRSRV_PIXEL_FORMAT_R8_UINT = 132,
+ PVRSRV_PIXEL_FORMAT_R8_UNORM = 133,
+ PVRSRV_PIXEL_FORMAT_R8_SINT = 134,
+ PVRSRV_PIXEL_FORMAT_R8_SNORM = 135,
+
+
+ PVRSRV_PIXEL_FORMAT_A2B10G10R10 = 136,
+ PVRSRV_PIXEL_FORMAT_A2B10G10R10_UNORM = 137,
+ PVRSRV_PIXEL_FORMAT_A2B10G10R10_UINT = 138,
+
+
+ PVRSRV_PIXEL_FORMAT_B10G11R11 = 139,
+ PVRSRV_PIXEL_FORMAT_B10G11R11F = 140,
+
+
+ PVRSRV_PIXEL_FORMAT_X24G8R32 = 141,
+ PVRSRV_PIXEL_FORMAT_G8R24 = 142,
PVRSRV_PIXEL_FORMAT_X8R24 = 143,
- PVRSRV_PIXEL_FORMAT_E5B9G9R9 = 144,
- PVRSRV_PIXEL_FORMAT_R1 = 145,
+ PVRSRV_PIXEL_FORMAT_E5B9G9R9 = 144,
+ PVRSRV_PIXEL_FORMAT_R1 = 145,
PVRSRV_PIXEL_FORMAT_RESERVED6 = 146,
PVRSRV_PIXEL_FORMAT_RESERVED7 = 147,
PVRSRV_PIXEL_FORMAT_RESERVED19 = 159,
PVRSRV_PIXEL_FORMAT_RESERVED20 = 160,
-
- PVRSRV_PIXEL_FORMAT_UBYTE4 = 161,
- PVRSRV_PIXEL_FORMAT_SHORT4 = 162,
- PVRSRV_PIXEL_FORMAT_SHORT4N = 163,
- PVRSRV_PIXEL_FORMAT_USHORT4N = 164,
- PVRSRV_PIXEL_FORMAT_SHORT2N = 165,
- PVRSRV_PIXEL_FORMAT_SHORT2 = 166,
- PVRSRV_PIXEL_FORMAT_USHORT2N = 167,
- PVRSRV_PIXEL_FORMAT_UDEC3 = 168,
- PVRSRV_PIXEL_FORMAT_DEC3N = 169,
- PVRSRV_PIXEL_FORMAT_F16_2 = 170,
- PVRSRV_PIXEL_FORMAT_F16_4 = 171,
-
-
+
+ PVRSRV_PIXEL_FORMAT_UBYTE4 = 161,
+ PVRSRV_PIXEL_FORMAT_SHORT4 = 162,
+ PVRSRV_PIXEL_FORMAT_SHORT4N = 163,
+ PVRSRV_PIXEL_FORMAT_USHORT4N = 164,
+ PVRSRV_PIXEL_FORMAT_SHORT2N = 165,
+ PVRSRV_PIXEL_FORMAT_SHORT2 = 166,
+ PVRSRV_PIXEL_FORMAT_USHORT2N = 167,
+ PVRSRV_PIXEL_FORMAT_UDEC3 = 168,
+ PVRSRV_PIXEL_FORMAT_DEC3N = 169,
+ PVRSRV_PIXEL_FORMAT_F16_2 = 170,
+ PVRSRV_PIXEL_FORMAT_F16_4 = 171,
+
+
PVRSRV_PIXEL_FORMAT_L_F16 = 172,
PVRSRV_PIXEL_FORMAT_L_F16_REP = 173,
PVRSRV_PIXEL_FORMAT_L_F16_A_F16 = 174,
PVRSRV_PIXEL_FORMAT_A_F32 = 178,
PVRSRV_PIXEL_FORMAT_L_F32_A_F32 = 179,
-
+
PVRSRV_PIXEL_FORMAT_PVRTC2 = 180,
PVRSRV_PIXEL_FORMAT_PVRTC4 = 181,
PVRSRV_PIXEL_FORMAT_PVRTCII2 = 182,
PVRSRV_PIXEL_FORMAT_MONO8 = 193,
PVRSRV_PIXEL_FORMAT_MONO16 = 194,
-
+
PVRSRV_PIXEL_FORMAT_C0_YUYV = 195,
PVRSRV_PIXEL_FORMAT_C0_UYVY = 196,
PVRSRV_PIXEL_FORMAT_C0_YVYU = 197,
PVRSRV_PIXEL_FORMAT_C1_YVYU = 201,
PVRSRV_PIXEL_FORMAT_C1_VYUY = 202,
-
+
PVRSRV_PIXEL_FORMAT_C0_YUV420_2P_UV = 203,
PVRSRV_PIXEL_FORMAT_C0_YUV420_2P_VU = 204,
PVRSRV_PIXEL_FORMAT_C0_YUV420_3P = 205,
PVRSRV_PIXEL_FORMAT_A2B10G10R10F = 209,
PVRSRV_PIXEL_FORMAT_B8G8R8_SINT = 210,
PVRSRV_PIXEL_FORMAT_PVRF32SIGNMASK = 211,
-
- PVRSRV_PIXEL_FORMAT_ABGR4444 = 212,
+
+ PVRSRV_PIXEL_FORMAT_ABGR4444 = 212,
PVRSRV_PIXEL_FORMAT_ABGR1555 = 213,
- PVRSRV_PIXEL_FORMAT_BGR565 = 214,
-
+ PVRSRV_PIXEL_FORMAT_BGR565 = 214,
+
PVRSRV_PIXEL_FORMAT_C0_4KYUV420_2P_UV = 215,
PVRSRV_PIXEL_FORMAT_C0_4KYUV420_2P_VU = 216,
PVRSRV_PIXEL_FORMAT_C1_4KYUV420_2P_UV = 217,
PVRSRV_PIXEL_FORMAT_C1_4KYUV420_2P_VU = 218,
- PVRSRV_PIXEL_FORMAT_P208 = 219,
- PVRSRV_PIXEL_FORMAT_A8P8 = 220,
+ PVRSRV_PIXEL_FORMAT_P208 = 219,
+ PVRSRV_PIXEL_FORMAT_A8P8 = 220,
PVRSRV_PIXEL_FORMAT_A4 = 221,
PVRSRV_PIXEL_FORMAT_AYUV8888 = 222,
typedef struct _PVRSRV_SYNC_DATA_
{
-
+
IMG_UINT32 ui32WriteOpsPending;
volatile IMG_UINT32 ui32WriteOpsComplete;
-
+
IMG_UINT32 ui32ReadOpsPending;
volatile IMG_UINT32 ui32ReadOpsComplete;
-
+
IMG_UINT32 ui32ReadOps2Pending;
volatile IMG_UINT32 ui32ReadOps2Complete;
typedef struct _PVRSRV_CLIENT_SYNC_INFO_
{
-
+
PVRSRV_SYNC_DATA *psSyncData;
-
+
IMG_DEV_VIRTADDR sWriteOpsCompleteDevVAddr;
-
+
IMG_DEV_VIRTADDR sReadOpsCompleteDevVAddr;
-
+
IMG_DEV_VIRTADDR sReadOps2CompleteDevVAddr;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hMappingInfo;
-
+
IMG_SID hKernelSyncInfo;
#else
IMG_HANDLE hMappingInfo;
-
+
IMG_HANDLE hKernelSyncInfo;
#endif
typedef struct DISPLAY_FORMAT_TAG
{
-
+
PVRSRV_PIXEL_FORMAT pixelformat;
} DISPLAY_FORMAT;
typedef struct DISPLAY_SURF_ATTRIBUTES_TAG
{
-
+
PVRSRV_PIXEL_FORMAT pixelformat;
-
+
DISPLAY_DIMS sDims;
} DISPLAY_SURF_ATTRIBUTES;
typedef struct DISPLAY_MODE_INFO_TAG
{
-
+
PVRSRV_PIXEL_FORMAT pixelformat;
-
+
DISPLAY_DIMS sDims;
-
+
IMG_UINT32 ui32RefreshHZ;
-
+
IMG_UINT32 ui32OEMFlags;
} DISPLAY_MODE_INFO;
-#define MAX_DISPLAY_NAME_SIZE (50)
+#define MAX_DISPLAY_NAME_SIZE (50)
typedef struct DISPLAY_INFO_TAG
{
-
+
IMG_UINT32 ui32MaxSwapChains;
-
+
IMG_UINT32 ui32MaxSwapChainBuffers;
-
+
IMG_UINT32 ui32MinSwapInterval;
-
+
IMG_UINT32 ui32MaxSwapInterval;
-
+
IMG_UINT32 ui32PhysicalWidthmm;
IMG_UINT32 ui32PhysicalHeightmm;
-
+
IMG_CHAR szDisplayName[MAX_DISPLAY_NAME_SIZE];
#if defined(SUPPORT_HW_CURSOR)
-
+
IMG_UINT16 ui32CursorWidth;
IMG_UINT16 ui32CursorHeight;
#endif
{
IMG_UINT32 ui32Size;
IMG_UINT32 ui32FBPhysBaseAddress;
- IMG_UINT32 ui32FBMemAvailable;
+ IMG_UINT32 ui32FBMemAvailable;
IMG_UINT32 ui32SysPhysBaseAddress;
IMG_UINT32 ui32SysSize;
IMG_UINT32 ui32DevIRQ;
#define PVRSRV_PDUMP_SUSPEND_Q_NAME "PVRSRVPDumpSuspendMsgQ"
#define PVRSRV_PDUMP_SUSPEND_Q_LENGTH 8
-#endif
+#endif
typedef struct _PVRSRV_REGISTRY_INFO_
#define PVRSRV_BC_FLAGS_YUVCSC_BT601 (0 << 1)
#define PVRSRV_BC_FLAGS_YUVCSC_BT709 (1 << 1)
-#define MAX_BUFFER_DEVICE_NAME_SIZE (50)
+#define MAX_BUFFER_DEVICE_NAME_SIZE (50)
typedef struct BUFFER_INFO_TAG
{
BOB_EVEN_NONINTERLEAVED
} OVERLAY_DEINTERLACE_MODE;
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
* their ISP controll stream to.
*/
#if (defined(SUPPORT_PERCONTEXT_PB) || defined(SUPPORT_HYBRID_PB))
-#define SGX_3DPARAMETERS_HEAP_ID SGX_PERCONTEXT_3DPARAMETERS_HEAP_ID
+#define SGX_3DPARAMETERS_HEAP_ID SGX_PERCONTEXT_3DPARAMETERS_HEAP_ID
#else
#define SGX_3DPARAMETERS_HEAP_ID SGX_SHARED_3DPARAMETERS_HEAP_ID
#endif
{
/* See PVRSRV_SGX_HWPERF_STATUS_* */
IMG_UINT32 ui32NewHWPerfStatus;
-
+
#if defined(SGX_FEATURE_EXTENDED_PERF_COUNTERS)
/* Specifies the HW's active group selectors */
IMG_UINT32 aui32PerfGroup[PVRSRV_SGX_HWPERF_NUM_COUNTERS];
#if defined(SUPPORT_SGX_NEW_STATUS_VALS)
IMG_HANDLE hCtrlKernelMemInfo; /*< MemInfo handle for the control structure of the
circular buffer */
- IMG_DEV_VIRTADDR sCtrlDevVAddr; /*< Device virtual address of the memory in the
+ IMG_DEV_VIRTADDR sCtrlDevVAddr; /*< Device virtual address of the memory in the
control structure to be checked */
#endif
IMG_PCHAR pszName; /*< Name of buffer */
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
*****************************************************************************/
#ifndef __SGXSCRIPT_H__
IMG_UINT32 ui32Value;
} sPDumpHWReg;
#endif
-#if defined(FIX_HW_BRN_22997) && defined(FIX_HW_BRN_23030) && defined(SGX_FEATURE_HOST_PORT)
+#if defined(FIX_HW_BRN_22997) && defined(FIX_HW_BRN_23030) && defined(SGX_FEATURE_HOST_PORT)
struct {
SGX_INIT_OPERATION eOp;
} sWorkaroundBRN22997;
-#endif
+#endif
} SGX_INIT_COMMAND;
typedef struct _SGX_INIT_SCRIPTS_
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
static PVRSRV_ERROR OpenBCDevice(IMG_UINT32 ui32DeviceID, IMG_HANDLE *phDevice)
{
BC_EXAMPLE_DEVINFO *psDevInfo;
-
-
+
+
UNREFERENCED_PARAMETER(ui32DeviceID);
psDevInfo = GetAnchorPtr();
-
+
*phDevice = (IMG_HANDLE)psDevInfo;
return (PVRSRV_OK);
{
BC_EXAMPLE_DEVINFO *psDevInfo;
+
+
-
-
-
+
psDevInfo = GetAnchorPtr();
if (psDevInfo == NULL)
{
-
+
psDevInfo = (BC_EXAMPLE_DEVINFO *)BCAllocKernelMem(sizeof(BC_EXAMPLE_DEVINFO));
if(!psDevInfo)
return (BCE_ERROR_OUT_OF_MEMORY);
}
-
+
SetAnchorPtr((void*)psDevInfo);
-
+
psDevInfo->ulRefCount = 0;
-
+
if(BCOpenPVRServices(&psDevInfo->hPVRServices) != BCE_OK)
{
return (BCE_ERROR_INIT_FAILURE);
return (BCE_ERROR_INIT_FAILURE);
}
-
+
if(!(*pfnGetPVRJTable)(&psDevInfo->sPVRJTable))
{
return (BCE_ERROR_INIT_FAILURE);
}
-
+
psDevInfo->ulNumBuffers = 0;
return (BCE_ERROR_OUT_OF_MEMORY);
}
-
+
psDevInfo->sBufferInfo.pixelformat = PVRSRV_PIXEL_FORMAT_UNKNOWN;
psDevInfo->sBufferInfo.ui32Width = 0;
psDevInfo->sBufferInfo.ui32Height = 0;
psDevInfo->sBufferInfo.ui32BufferDeviceID = BC_EXAMPLE_DEVICEID;
psDevInfo->sBufferInfo.ui32Flags = 0;
psDevInfo->sBufferInfo.ui32BufferCount = (IMG_UINT32)psDevInfo->ulNumBuffers;
-
+
strncpy(psDevInfo->sBufferInfo.szDeviceName, BUFFERCLASS_DEVICE_NAME, MAX_BUFFER_DEVICE_NAME_SIZE);
-
+
psDevInfo->sBCJTable.ui32TableSize = sizeof(PVRSRV_BC_SRV2BUFFER_KMJTABLE);
psDevInfo->sBCJTable.pfnOpenBCDevice = OpenBCDevice;
psDevInfo->sBCJTable.pfnGetBufferAddr = GetBCBufferAddr;
-
-
+
+
if(psDevInfo->sPVRJTable.pfnPVRSRVRegisterBCDevice (&psDevInfo->sBCJTable,
(IMG_UINT32*)&psDevInfo->ulDeviceID ) != PVRSRV_OK)
{
}
}
-
+
psDevInfo->ulRefCount++;
-
+
return (BCE_OK);
}
psDevInfo = GetAnchorPtr();
-
+
if (psDevInfo == NULL)
{
return (BCE_ERROR_GENERIC);
}
-
+
psDevInfo->ulRefCount--;
if (psDevInfo->ulRefCount == 0)
{
-
+
PVRSRV_BC_BUFFER2SRV_KMJTABLE *psJTable = &psDevInfo->sPVRJTable;
-
+
if (psJTable->pfnPVRSRVRemoveBCDevice(psDevInfo->ulDeviceID) != PVRSRV_OK)
{
return (BCE_ERROR_GENERIC);
BCFreeKernelMem(psDevInfo->psSystemBuffer);
}
-
+
BCFreeKernelMem(psDevInfo);
-
+
SetAnchorPtr(NULL);
}
-
+
return (BCE_OK);
}
IMG_UINT32 ui32MaxWidth = 320 * 4;
-
+
psDevInfo = GetAnchorPtr();
if (psDevInfo == NULL)
{
-
+
return (BCE_ERROR_DEVICE_REGISTER_FAILED);
}
if (psDevInfo->ulNumBuffers)
{
-
+
return (BCE_ERROR_GENERIC);
}
-
-
+
+
psDevInfo->sBufferInfo.pixelformat = BC_EXAMPLE_PIXELFORMAT;
psDevInfo->sBufferInfo.ui32Width = ui32Width;
psDevInfo->sBufferInfo.ui32Height = ui32Height;
if(psDevInfo->sBufferInfo.pixelformat == PVRSRV_PIXEL_FORMAT_NV12)
{
-
+
ulSize += ((ui32ByteStride >> 1) * (ui32Height >> 1) << 1);
}
else if(psDevInfo->sBufferInfo.pixelformat == PVRSRV_PIXEL_FORMAT_I420)
{
-
+
ulSize += (ui32ByteStride >> 1) * (ui32Height >> 1);
-
-
+
+
ulSize += (ui32ByteStride >> 1) * (ui32Height >> 1);
}
break;
}
#else
-
+
if (BCAllocContigMemory(ulSize,
&psDevInfo->psSystemBuffer[i].hMemHandle,
&psDevInfo->psSystemBuffer[i].sCPUVAddr,
psDevInfo->sBufferInfo.ui32BufferCount = (IMG_UINT32)psDevInfo->ulNumBuffers;
-
+
psDevInfo->sBCJTable.ui32TableSize = sizeof(PVRSRV_BC_SRV2BUFFER_KMJTABLE);
psDevInfo->sBCJTable.pfnOpenBCDevice = OpenBCDevice;
psDevInfo->sBCJTable.pfnGetBCBuffer = GetBCBuffer;
psDevInfo->sBCJTable.pfnGetBCInfo = GetBCInfo;
psDevInfo->sBCJTable.pfnGetBufferAddr = GetBCBufferAddr;
+
-
-
+
if (ui32Width < ui32MaxWidth)
{
switch(pixelformat)
ui32ByteStride = BC_EXAMPLE_STRIDE;
}
-
+
return (BCE_OK);
}
psDevInfo = GetAnchorPtr();
-
+
if (psDevInfo == NULL)
{
-
+
return (BCE_ERROR_DEVICE_REGISTER_FAILED);
}
-
+
for(i = 0; i < psDevInfo->ulNumBuffers; i++)
{
}
psDevInfo->ulNumBuffers = 0;
-
+
psDevInfo->sBufferInfo.pixelformat = PVRSRV_PIXEL_FORMAT_UNKNOWN;
psDevInfo->sBufferInfo.ui32Width = 0;
psDevInfo->sBufferInfo.ui32Height = 0;
psDevInfo->sBufferInfo.ui32Flags = 0;
psDevInfo->sBufferInfo.ui32BufferCount = (IMG_UINT32)psDevInfo->ulNumBuffers;
-
+
return (BCE_OK);
}
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
unsigned long ulSize;
BCE_HANDLE hMemHandle;
-
-
+
+
#if defined(BC_DISCONTIG_BUFFERS)
IMG_SYS_PHYADDR *psSysAddr;
#else
BC_EXAMPLE_BUFFER *psSystemBuffer;
-
+
unsigned long ulNumBuffers;
-
+
PVRSRV_BC_BUFFER2SRV_KMJTABLE sPVRJTable;
-
+
PVRSRV_BC_SRV2BUFFER_KMJTABLE sBCJTable;
-
+
BCE_HANDLE hPVRServices;
-
+
unsigned long ulRefCount;
-
-
+
+
BUFFER_INFO sBufferInfo;
} BC_EXAMPLE_DEVINFO;
}
#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#define unref__ __attribute__ ((unused))
#if defined(LMA)
-#define PVR_BUFFERCLASS_MEMOFFSET (220 * 1024 * 1024)
-#define PVR_BUFFERCLASS_MEMSIZE (4 * 1024 * 1024)
+#define PVR_BUFFERCLASS_MEMOFFSET (220 * 1024 * 1024)
+#define PVR_BUFFERCLASS_MEMSIZE (4 * 1024 * 1024)
unsigned long g_ulMemBase = 0;
unsigned long g_ulMemCurrent = 0;
psPCIDev = pci_get_device(VENDOR_ID_PVR, DEVICE_ID_PVR, NULL);
if (psPCIDev == NULL)
{
-
+
psPCIDev = pci_get_device(VENDOR_ID_PVR, DEVICE_ID1_PVR, NULL);
}
#endif
#if defined(LDM_PLATFORM) || defined(LDM_PCI)
-
+
psPvrClass = class_create(THIS_MODULE, "bc_example");
if (IS_ERR(psPvrClass))
psDev = device_create(psPvrClass, NULL, MKDEV(AssignedMajorNumber, 0),
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,26))
NULL,
-#endif
+#endif
DEVNAME);
if (IS_ERR(psDev))
{
printk(KERN_ERR DRVNAME ": BC_Example_ModInit: unable to create device (%ld)", PTR_ERR(psDev));
goto ExitDestroyClass;
}
-#endif
+#endif
#if defined(LMA)
-
+
g_ulMemBase = pci_resource_start(psPCIDev, PVR_MEM_PCI_BASENUM) + PVR_BUFFERCLASS_MEMOFFSET;
#endif
}
#if defined(LMA)
-
+
pci_disable_device(psPCIDev);
#endif
ExitError:
#endif
return -EBUSY;
-}
+}
static void __exit BC_Example_ModCleanup(void)
{
#endif
unregister_chrdev(AssignedMajorNumber, DEVNAME);
-
+
if(BC_Example_Deinit() != BCE_OK)
{
printk (KERN_ERR DRVNAME ": BC_Example_ModCleanup: can't deinit device\n");
}
-}
+}
void *BCAllocKernelMem(unsigned long ulSize)
vfree(LinAddr);
}
-#else
+#else
BCE_ERROR BCAllocContigMemory(unsigned long ulSize,
BCE_HANDLE unref__ *phMemHandle,
{
#if defined(LMA)
void *pvLinAddr;
-
-
+
+
if(g_ulMemCurrent + ulSize >= PVR_BUFFERCLASS_MEMSIZE)
{
return (BCE_ERROR_OUT_OF_MEMORY);
if(pvLinAddr)
{
pPhysAddr->uiAddr = g_ulMemBase + g_ulMemCurrent;
- *pLinAddr = pvLinAddr;
-
+ *pLinAddr = pvLinAddr;
+
g_ulMemCurrent += ulSize;
return (BCE_OK);
}
return (BCE_ERROR_OUT_OF_MEMORY);
-#else
+#else
#if defined(BCE_USE_SET_MEMORY)
void *pvLinAddr;
unsigned long ulAlignedSize = PAGE_ALIGN(ulSize);
*pLinAddr = pvLinAddr;
return (BCE_OK);
-#else
+#else
dma_addr_t dma;
void *pvLinAddr;
*pLinAddr = pvLinAddr;
return (BCE_OK);
-#endif
-#endif
+#endif
+#endif
}
void BCFreeContigMemory(unsigned long ulSize,
#if defined(LMA)
g_ulMemCurrent -= ulSize;
iounmap(LinAddr);
-#else
+#else
#if defined(BCE_USE_SET_MEMORY)
unsigned long ulAlignedSize = PAGE_ALIGN(ulSize);
int iError;
printk(KERN_ERR DRVNAME ": BCFreeContigMemory: set_memory_wb failed (%d)\n", iError);
}
kfree(LinAddr);
-#else
+#else
dma_free_coherent(NULL, ulSize, LinAddr, (dma_addr_t)PhysAddr.uiAddr);
-#endif
-#endif
+#endif
+#endif
}
-#endif
+#endif
IMG_SYS_PHYADDR CpuPAddrToSysPAddrBC(IMG_CPU_PHYADDR cpu_paddr)
{
IMG_SYS_PHYADDR sys_paddr;
-
-
+
+
sys_paddr.uiAddr = cpu_paddr.uiAddr;
return sys_paddr;
}
IMG_CPU_PHYADDR SysPAddrToCpuPAddrBC(IMG_SYS_PHYADDR sys_paddr)
{
-
+
IMG_CPU_PHYADDR cpu_paddr;
-
+
cpu_paddr.uiAddr = sys_paddr.uiAddr;
return cpu_paddr;
}
BCE_ERROR BCOpenPVRServices (BCE_HANDLE *phPVRServices)
{
-
+
*phPVRServices = 0;
return (BCE_OK);
}
BCE_ERROR BCClosePVRServices (BCE_HANDLE unref__ hPVRServices)
{
-
+
return (BCE_OK);
}
return (BCE_ERROR_INVALID_PARAMS);
}
-
+
*ppfnFuncTable = PVRGetBufferClassJTable;
return (BCE_OK);
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#define BC_Example_ioctl_get_buffer_count BC_EXAMPLE_IOWR(1)
#define BC_Example_ioctl_reconfigure_buffer BC_EXAMPLE_IOWR(2)
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
u = (j<(height/2))? ((i<(width/2))? 0xFF:0x33) : ((i<(width/2))? 0x33:0xAA);
v = (j<(height/2))? ((i<(width/2))? 0xAC:0x0) : ((i<(width/2))? 0x03:0xEE);
-
+
pui16uv[count++] = (v << 8) | u;
}
case PVRSRV_PIXEL_FORMAT_FOURCC_ORG_YVYU:
pui32yuv[count++] = (u << 24) | (y1 << 16) | (v << 8) | y0;
break;
-
+
default:
break;
unsigned long Colour32;
unsigned short Colour16;
static unsigned char Colour8 = 0;
-
+
Colour16 = (Colour8>>3) | ((Colour8>>2)<<5) | ((Colour8>>3)<<11);
Colour32 = Colour16 | Colour16 << 16;
-
+
Count = (height * bytestride)>>2;
for(i=0; i<Count; i++)
pui16Addr = (unsigned short *)((unsigned char *)pui16Addr + bytestride);
}
Count = bytestride >> 2;
-
+
pui32Addr = (unsigned long *)((unsigned char *)pvDest + (bytestride * (MIN(height - 1, 0xFF) - Colour8)));
for(i=0; i<Count; i++)
pui32Addr[i] = 0x001F001FUL;
}
-
+
Colour8 = (Colour8 + 1) % MIN(height - 1, 0xFFU);
}
BUFFER_INFO *psBufferInfo;
PVRSRV_SYNC_DATA *psSyncData;
-
+
if(psDevInfo == NULL)
{
return -1;
psBuffer = &psDevInfo->psSystemBuffer[uiBufferIndex];
psBufferInfo = &psDevInfo->sBufferInfo;
-
+
psSyncData = psBuffer->psSyncData;
if(psSyncData)
{
-
+
if(psSyncData->ui32ReadOpsPending != psSyncData->ui32ReadOpsComplete)
{
return -1;
}
-
+
psSyncData->ui32WriteOpsPending++;
}
case PVRSRV_PIXEL_FORMAT_RGB565:
default:
{
- FillRGB565Image(psBuffer->sCPUVAddr,
- psBufferInfo->ui32Width,
- psBufferInfo->ui32Height,
+ FillRGB565Image(psBuffer->sCPUVAddr,
+ psBufferInfo->ui32Width,
+ psBufferInfo->ui32Height,
psBufferInfo->ui32ByteStride);
break;
}
case PVRSRV_PIXEL_FORMAT_FOURCC_ORG_YUYV:
case PVRSRV_PIXEL_FORMAT_FOURCC_ORG_YVYU:
{
- FillYUV422Image(psBuffer->sCPUVAddr,
- psBufferInfo->ui32Width,
- psBufferInfo->ui32Height,
- psBufferInfo->ui32ByteStride,
+ FillYUV422Image(psBuffer->sCPUVAddr,
+ psBufferInfo->ui32Width,
+ psBufferInfo->ui32Height,
+ psBufferInfo->ui32ByteStride,
psBufferInfo->pixelformat);
break;
}
case PVRSRV_PIXEL_FORMAT_NV12:
{
- FillNV12Image(psBuffer->sCPUVAddr,
- psBufferInfo->ui32Width,
- psBufferInfo->ui32Height,
+ FillNV12Image(psBuffer->sCPUVAddr,
+ psBufferInfo->ui32Width,
+ psBufferInfo->ui32Height,
psBufferInfo->ui32ByteStride);
break;
}
case PVRSRV_PIXEL_FORMAT_I420:
{
- FillI420Image(psBuffer->sCPUVAddr,
- psBufferInfo->ui32Width,
- psBufferInfo->ui32Height,
+ FillI420Image(psBuffer->sCPUVAddr,
+ psBufferInfo->ui32Width,
+ psBufferInfo->ui32Height,
psBufferInfo->ui32ByteStride);
break;
}
}
-
+
if(psSyncData)
{
psSyncData->ui32WriteOpsComplete++;
{
BC_EXAMPLE_DEVINFO *psDevInfo = GetAnchorPtr();
-
+
if(psDevInfo == IMG_NULL)
{
return -1;
}
-
+
*puiBufferCount = (unsigned int)psDevInfo->sBufferInfo.ui32BufferCount;
return 0;
int ReconfigureBuffer(unsigned int *uiSucceed)
{
BCE_ERROR eError;
-
-
+
+
eError = BC_Example_Buffers_Destroy();
if (eError != BCE_OK)
return -1;
}
+
-
-
+
eError = BC_Example_Buffers_Create();
if (eError != BCE_OK)
return -1;
}
-
+
*uiSucceed = 1;
return 0;
}
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
int GetBufferCount(unsigned int *puiBufferCount);
int ReconfigureBuffer(unsigned int *uiSucceed);
-#endif
+#endif
#
# Copyright (C) Imagination Technologies Ltd. All rights reserved.
-#
+#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
-#
-# This program is distributed in the hope it will be useful but, except
-# as otherwise stated in writing, without any warranty; without even the
-# implied warranty of merchantability or fitness for a particular purpose.
+#
+# This program is distributed in the hope it will be useful but, except
+# as otherwise stated in writing, without any warranty; without even the
+# implied warranty of merchantability or fitness for a particular purpose.
# See the GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-#
+#
# The full GNU General Public License is included in this distribution in
# the file called "COPYING".
#
# Contact Information:
# Imagination Technologies Ltd. <gpl-support@imgtec.com>
-# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
-#
+# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+#
#
modules := medfield_drm moorestown_drm poulsbo_drm
#
# Copyright (C) Imagination Technologies Ltd. All rights reserved.
-#
+#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
-#
-# This program is distributed in the hope it will be useful but, except
-# as otherwise stated in writing, without any warranty; without even the
-# implied warranty of merchantability or fitness for a particular purpose.
+#
+# This program is distributed in the hope it will be useful but, except
+# as otherwise stated in writing, without any warranty; without even the
+# implied warranty of merchantability or fitness for a particular purpose.
# See the GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-#
+#
# The full GNU General Public License is included in this distribution in
# the file called "COPYING".
#
# Contact Information:
# Imagination Technologies Ltd. <gpl-support@imgtec.com>
-# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
-#
+# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+#
#
MRST_SOURCE_DIR := drivers/staging/mrst
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
typedef struct MRSTLFB_BUFFER_TAG
{
-
+
IMG_UINT32 ui32BufferSize;
union {
-
+
IMG_SYS_PHYADDR *psNonCont;
-
+
IMG_SYS_PHYADDR sCont;
} uSysAddr;
-
+
IMG_DEV_VIRTADDR sDevVAddr;
-
- IMG_CPU_VIRTADDR sCPUVAddr;
-
+
+ IMG_CPU_VIRTADDR sCPUVAddr;
+
PVRSRV_SYNC_DATA *psSyncData;
-
+
MRST_BOOL bIsContiguous;
-
+
MRST_BOOL bIsAllocated;
IMG_UINT32 ui32OwnerTaskID;
typedef struct MRSTLFB_VSYNC_FLIP_ITEM_TAG
{
-
-
-
MRST_HANDLE hCmdComplete;
-
+
unsigned long ulSwapInterval;
-
+
MRST_BOOL bValid;
-
+
MRST_BOOL bFlipped;
-
+
MRST_BOOL bCmdCompleted;
-
-
-
-
-
MRSTLFB_BUFFER* psBuffer;
struct mdfld_plane_contexts sPlaneContexts;
typedef struct MRSTLFB_SWAPCHAIN_TAG
{
-
+
unsigned long ulBufferCount;
IMG_UINT32 ui32SwapChainID;
IMG_UINT32 ui32SwapChainPropertyFlag;
unsigned long ulSwapChainGTTOffset;
-
+
MRSTLFB_BUFFER **ppsBuffer;
-
+
unsigned long ulSwapChainLength;
-
+
MRSTLFB_VSYNC_FLIP_ITEM *psVSyncFlips;
-
+
unsigned long ulInsertIndex;
-
-
+
+
unsigned long ulRemoveIndex;
-
+
PVRSRV_DC_DISP2SRV_KMJTABLE *psPVRJTable;
-
+
struct drm_driver *psDrmDriver;
-
+
struct drm_device *psDrmDev;
struct MRSTLFB_SWAPCHAIN_TAG *psNext;
struct drm_device *psDrmDevice;
-
+
MRSTLFB_BUFFER sSystemBuffer;
-
+
PVRSRV_DC_DISP2SRV_KMJTABLE sPVRJTable;
-
-
+
+
PVRSRV_DC_SRV2DISP_KMJTABLE sDCJTable;
-
+
unsigned long ulRefCount;
MRSTLFB_SWAPCHAIN *psCurrentSwapChain;
IMG_UINT32 ui32SwapChainNum;
MRSTLFB_BUFFER *psCurrentBuffer;
-
+
void *pvRegs;
-
+
unsigned long ulSetFlushStateRefCount;
-
+
MRST_BOOL bFlushCommands;
-
+
MRST_BOOL bBlanked;
-
+
struct fb_info *psLINFBInfo;
-
+
struct notifier_block sLINNotifBlock;
-
+
spinlock_t sSwapChainLock;
+
+
-
-
-
+
IMG_DEV_VIRTADDR sDisplayDevVAddr;
DISPLAY_INFO sDisplayInfo;
-
+
DISPLAY_FORMAT sDisplayFormat;
-
-
+
+
DISPLAY_DIMS sDisplayDim;
IMG_UINT32 ui32MainPipe;
-
+
MRST_BOOL bSuspended;
-
+
MRST_BOOL bLeaveVT;
-
+
unsigned long ulLastFlipAddr;
-
+
MRST_BOOL bLastFlipAddrValid;
uint32_t uPlaneACntr;
MRST_ERROR MRSTLFBChangeSwapChainProperty(unsigned long *psSwapChainGTTOffset,
unsigned long ulSwapChainGTTSize, IMG_INT32 i32Pipe);
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
psDevInfo->bLastFlipAddrValid = MRST_FALSE;
}
-
+
static void FlushInternalVSyncQueue(MRSTLFB_SWAPCHAIN *psSwapChain, MRST_BOOL bFlip)
{
MRSTLFB_VSYNC_FLIP_ITEM *psFlipItem;
unsigned long ulMaxIndex;
unsigned long i;
-
+
psFlipItem = &psSwapChain->psVSyncFlips[psSwapChain->ulRemoveIndex];
ulMaxIndex = psSwapChain->ulSwapChainLength - 1;
MRSTLFBFlipContexts(psSwapChain->psDevInfo,
&psFlipItem->sPlaneContexts);
}
-
+
if(psFlipItem->bCmdCompleted == MRST_FALSE)
{
DEBUG_PRINTK((KERN_INFO DRIVER_PREFIX ": FlushInternalVSyncQueue: Calling command complete for swap buffer (index %lu)\n", psSwapChain->ulRemoveIndex));
psSwapChain->psPVRJTable->pfnPVRSRVCmdComplete((IMG_HANDLE)psFlipItem->hCmdComplete, MRST_TRUE);
}
-
+
psSwapChain->ulRemoveIndex++;
-
+
if(psSwapChain->ulRemoveIndex > ulMaxIndex)
{
psSwapChain->ulRemoveIndex = 0;
}
-
+
psFlipItem->bFlipped = MRST_FALSE;
psFlipItem->bCmdCompleted = MRST_FALSE;
psFlipItem->bValid = MRST_FALSE;
-
-
+
+
psFlipItem = &psSwapChain->psVSyncFlips[psSwapChain->ulRemoveIndex];
}
psSwapChain->ulRemoveIndex = 0;
}
-static void DRMLFBFlipBuffer(MRSTLFB_DEVINFO *psDevInfo, MRSTLFB_SWAPCHAIN *psSwapChain, MRSTLFB_BUFFER *psBuffer)
+static void DRMLFBFlipBuffer(MRSTLFB_DEVINFO *psDevInfo,
+ MRSTLFB_SWAPCHAIN *psSwapChain,
+ MRSTLFB_BUFFER *psBuffer)
{
- if(psSwapChain != NULL)
+ if (psSwapChain != NULL)
{
if(psDevInfo->psCurrentSwapChain != NULL)
{
- if(psDevInfo->psCurrentSwapChain != psSwapChain)
+ if(psDevInfo->psCurrentSwapChain != psSwapChain)
FlushInternalVSyncQueue(psDevInfo->psCurrentSwapChain, MRST_FALSE);
}
psDevInfo->psCurrentSwapChain = psSwapChain;
struct fb_event *psFBEvent = (struct fb_event *)data;
MRST_BOOL bBlanked;
-
+
if (event != FB_EVENT_BLANK)
{
return 0;
int res;
MRST_ERROR eError;
-
+
memset(&psDevInfo->sLINNotifBlock, 0, sizeof(psDevInfo->sLINNotifBlock));
psDevInfo->sLINNotifBlock.notifier_call = FrameBufferEvents;
{
int res;
-
+
res = fb_unregister_client(&psDevInfo->sLINNotifBlock);
if (res != 0)
{
psDevInfo = GetAnchorPtr();
-
+
psDevInfo->sSystemBuffer.psSyncData = psSystemBufferSyncData;
psDevInfo->ulSetFlushStateRefCount = 0;
return PVRSRV_ERROR_UNABLE_TO_OPEN_DC_DEVICE;
}
-
+
*phDevice = (IMG_HANDLE)psDevInfo;
-
+
return (PVRSRV_OK);
}
DISPLAY_FORMAT *psFormat)
{
MRSTLFB_DEVINFO *psDevInfo;
-
+
if(!hDevice || !pui32NumFormats)
{
return (PVRSRV_ERROR_INVALID_PARAMS);
}
psDevInfo = (MRSTLFB_DEVINFO*)hDevice;
-
+
*pui32NumFormats = 1;
-
+
if(psFormat)
{
psFormat[0] = psDevInfo->sDisplayFormat;
return (PVRSRV_OK);
}
-static PVRSRV_ERROR EnumDCDims(IMG_HANDLE hDevice,
+static PVRSRV_ERROR EnumDCDims(IMG_HANDLE hDevice,
DISPLAY_FORMAT *psFormat,
IMG_UINT32 *pui32NumDims,
DISPLAY_DIMS *psDim)
*pui32NumDims = 1;
-
+
if(psDim)
{
psDim[0] = psDevInfo->sDisplayDim;
}
-
+
return (PVRSRV_OK);
}
static PVRSRV_ERROR GetDCSystemBuffer(IMG_HANDLE hDevice, IMG_HANDLE *phBuffer)
{
MRSTLFB_DEVINFO *psDevInfo;
-
+
if(!hDevice || !phBuffer)
{
return (PVRSRV_ERROR_INVALID_PARAMS);
psDevInfo = (MRSTLFB_DEVINFO*)hDevice;
-
-
+
+
*phBuffer = (IMG_HANDLE)&psDevInfo->sSystemBuffer;
return (PVRSRV_OK);
static PVRSRV_ERROR GetDCInfo(IMG_HANDLE hDevice, DISPLAY_INFO *psDCInfo)
{
MRSTLFB_DEVINFO *psDevInfo;
-
+
if(!hDevice || !psDCInfo)
{
return (PVRSRV_ERROR_INVALID_PARAMS);
}
static PVRSRV_ERROR GetDCBufferAddr(IMG_HANDLE hDevice,
- IMG_HANDLE hBuffer,
+ IMG_HANDLE hBuffer,
IMG_SYS_PHYADDR **ppsSysAddr,
IMG_SIZE_T *pui32ByteSize,
IMG_VOID **ppvCpuVAddr,
return (PVRSRV_ERROR_INVALID_PARAMS);
}
psDevInfo = (MRSTLFB_DEVINFO*)hDevice;
-
+
if(!hBuffer)
{
return (PVRSRV_ERROR_INVALID_PARAMS);
return (PVRSRV_ERROR_INVALID_PARAMS);
}
- if( psSystemBuffer->bIsContiguous )
+ if( psSystemBuffer->bIsContiguous )
*ppsSysAddr = &psSystemBuffer->uSysAddr.sCont;
else
*ppsSysAddr = psSystemBuffer->uSysAddr.psNonCont;
struct psb_fbdev *fbdev = NULL;
UNREFERENCED_PARAMETER(ui32OEMFlags);
-
-
+
+
if(!hDevice
|| !psDstSurfAttrib
|| !psSrcSurfAttrib
}
psDevInfo = (MRSTLFB_DEVINFO*)hDevice;
-
-
+
+
if(ui32BufferCount > psDevInfo->sDisplayInfo.ui32MaxSwapChainBuffers)
{
return (PVRSRV_ERROR_TOOMANYBUFFERS);
}
-
-
+
+
ulSwapChainLength = ui32BufferCount + 1;
-
+
if(psDstSurfAttrib->pixelformat != psDevInfo->sDisplayFormat.pixelformat
|| psDstSurfAttrib->sDims.ui32ByteStride != psDevInfo->sDisplayDim.ui32ByteStride
|| psDstSurfAttrib->sDims.ui32Width != psDevInfo->sDisplayDim.ui32Width
|| psDstSurfAttrib->sDims.ui32Height != psDevInfo->sDisplayDim.ui32Height)
{
-
+
return (PVRSRV_ERROR_INVALID_PARAMS);
- }
+ }
if(psDstSurfAttrib->pixelformat != psSrcSurfAttrib->pixelformat
|| psDstSurfAttrib->sDims.ui32ByteStride != psSrcSurfAttrib->sDims.ui32ByteStride
|| psDstSurfAttrib->sDims.ui32Width != psSrcSurfAttrib->sDims.ui32Width
|| psDstSurfAttrib->sDims.ui32Height != psSrcSurfAttrib->sDims.ui32Height)
{
-
+
return (PVRSRV_ERROR_INVALID_PARAMS);
- }
-
+ }
+
UNREFERENCED_PARAMETER(ui32Flags);
-
-
+
+
psSwapChain = (MRSTLFB_SWAPCHAIN*)MRSTLFBAllocKernelMem(sizeof(MRSTLFB_SWAPCHAIN));
if(!psSwapChain)
{
return (PVRSRV_ERROR_OUT_OF_MEMORY);
}
- for(iSCId = 0;iSCId < MAX_SWAPCHAINS;++iSCId)
+ for(iSCId = 0;iSCId < MAX_SWAPCHAINS;++iSCId)
{
if( psDevInfo->apsSwapChains[iSCId] == NULL )
{
}
}
- if(iSCId == MAX_SWAPCHAINS)
+ if(iSCId == MAX_SWAPCHAINS)
{
eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto ErrorFreeSwapChain;
goto ErrorFreeSwapChain;
}
for (i = 0; i < ui32BufferCount; i++) ppsBuffer[i] = NULL;
-
+
psVSyncFlips = (MRSTLFB_VSYNC_FLIP_ITEM *)MRSTLFBAllocKernelMem(sizeof(MRSTLFB_VSYNC_FLIP_ITEM) * ulSwapChainLength);
if (!psVSyncFlips)
psSwapChain->ulRemoveIndex = 0;
psSwapChain->psPVRJTable = &psDevInfo->sPVRJTable;
-
-
+
+
for (i = 0; i < ui32BufferCount; i++)
{
unsigned long bufSize = psDevInfo->sDisplayDim.ui32ByteStride * psDevInfo->sDisplayDim.ui32Height;
eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto ErrorFreeAllocatedBuffes;
}
- ppsBuffer[i]->psSyncData = ppsSyncData[i];
+ ppsBuffer[i]->psSyncData = ppsSyncData[i];
}
-
+
for (i = 0; i < ulSwapChainLength; i++)
{
psVSyncFlips[i].bValid = MRST_FALSE;
psbfb = fbdev->pfb;
spin_lock_irqsave(&psDevInfo->sSwapChainLock, ulLockFlags);
-
+
psSwapChain->ui32SwapChainID = *pui32SwapChainID = iSCId+1;
psSwapChain->ui32SwapChainPropertyFlag =
PVRSRV_SWAPCHAIN_ATTACHED_PLANE_A
spin_unlock_irqrestore(&psDevInfo->sSwapChainLock, ulLockFlags);
-
+
*phSwapChain = (IMG_HANDLE)psSwapChain;
return (PVRSRV_OK);
ErrorFreeAllocatedBuffes:
for (i = 0; i < ui32BufferCount; i++)
{
- if(ppsBuffer[i] != NULL)
+ if(ppsBuffer[i] != NULL)
MRSTLFBFreeBuffer( psDevInfo, &ppsBuffer[i] );
}
MRSTLFBFreeKernelMem(psVSyncFlips);
ErrorFreeBuffers:
MRSTLFBFreeKernelMem(ppsBuffer);
ErrorFreeSwapChain:
- if(iSCId != MAX_SWAPCHAINS && psDevInfo->apsSwapChains[iSCId] == psSwapChain )
- psDevInfo->apsSwapChains[iSCId] = NULL;
+ if(iSCId != MAX_SWAPCHAINS && psDevInfo->apsSwapChains[iSCId] == psSwapChain )
+ psDevInfo->apsSwapChains[iSCId] = NULL;
MRSTLFBFreeKernelMem(psSwapChain);
return eError;
{
return (PVRSRV_ERROR_INVALID_PARAMS);
}
-
+
psDevInfo = (MRSTLFB_DEVINFO*)hDevice;
psSwapChain = (MRSTLFB_SWAPCHAIN*)hSwapChain;
psDevInfo->ui32SwapChainNum--;
- if(psDevInfo->ui32SwapChainNum == 0)
+ if(psDevInfo->ui32SwapChainNum == 0)
{
MRSTLFBDisableVSyncInterrupt(psDevInfo);
}
psDevInfo->apsSwapChains[ psSwapChain->ui32SwapChainID -1] = NULL;
-
+
FlushInternalVSyncQueue(psSwapChain, psDevInfo->ui32SwapChainNum == 0);
if (psDevInfo->ui32SwapChainNum == 0)
{
-
+
DRMLFBFlipBuffer(psDevInfo, NULL, &psDevInfo->sSystemBuffer);
MRSTLFBClearSavedFlip(psDevInfo);
}
UNREFERENCED_PARAMETER(hSwapChain);
UNREFERENCED_PARAMETER(psRect);
-
-
+
+
return (PVRSRV_ERROR_NOT_SUPPORTED);
}
UNREFERENCED_PARAMETER(hSwapChain);
UNREFERENCED_PARAMETER(psRect);
-
+
return (PVRSRV_ERROR_NOT_SUPPORTED);
}
UNREFERENCED_PARAMETER(hSwapChain);
UNREFERENCED_PARAMETER(ui32CKColour);
-
+
return (PVRSRV_ERROR_NOT_SUPPORTED);
}
UNREFERENCED_PARAMETER(hSwapChain);
UNREFERENCED_PARAMETER(ui32CKColour);
-
+
return (PVRSRV_ERROR_NOT_SUPPORTED);
}
MRSTLFB_DEVINFO *psDevInfo;
MRSTLFB_SWAPCHAIN *psSwapChain;
unsigned long i;
-
-
- if(!hDevice
+
+
+ if(!hDevice
|| !hSwapChain
|| !pui32BufferCount
|| !phBuffer)
{
return (PVRSRV_ERROR_INVALID_PARAMS);
}
-
+
psDevInfo = (MRSTLFB_DEVINFO*)hDevice;
psSwapChain = (MRSTLFB_SWAPCHAIN*)hSwapChain;
-
-
+
+
*pui32BufferCount = (IMG_UINT32)psSwapChain->ulBufferCount;
-
-
+
+
for (i = 0; i < psSwapChain->ulBufferCount; i++)
{
phBuffer[i] = (IMG_HANDLE)psSwapChain->ppsBuffer[i];
}
-
+
return (PVRSRV_OK);
}
UNREFERENCED_PARAMETER(ui32SwapInterval);
UNREFERENCED_PARAMETER(hPrivateTag);
UNREFERENCED_PARAMETER(psClipRect);
-
- if(!hDevice
+
+ if(!hDevice
|| !hBuffer
|| (ui32ClipRectCount != 0))
{
psDevInfo = (MRSTLFB_DEVINFO*)hDevice;
-
+
return (PVRSRV_OK);
}
return (PVRSRV_ERROR_INVALID_PARAMS);
}
-
+
return (PVRSRV_OK);
}
MRSTLFB_SWAPCHAIN *psSwapChain;
spin_lock_irqsave(&psDevInfo->sSwapChainLock, ulLockFlags);
-
-
+
psSwapChain = psDevInfo->psCurrentSwapChain;
if (psSwapChain == NULL)
goto ExitUnlock;
-
- if (psDevInfo->bFlushCommands || psDevInfo->bSuspended || psDevInfo->bLeaveVT)
+
+ if (psDevInfo->bFlushCommands || psDevInfo->bSuspended ||
+ psDevInfo->bLeaveVT)
goto ExitUnlock;
psFlipItem = &psSwapChain->psVSyncFlips[psSwapChain->ulRemoveIndex];
ulMaxIndex = psSwapChain->ulSwapChainLength - 1;
- while(psFlipItem->bValid)
- {
- if(psFlipItem->bFlipped)
- {
- if(!psFlipItem->bCmdCompleted)
- {
+ while (psFlipItem->bValid) {
+ if (psFlipItem->bFlipped) {
+ if (!psFlipItem->bCmdCompleted) {
MRST_BOOL bScheduleMISR;
-
bScheduleMISR = MRST_TRUE;
psSwapChain->psPVRJTable->pfnPVRSRVCmdComplete((IMG_HANDLE)psFlipItem->hCmdComplete, bScheduleMISR);
psFlipItem->bCmdCompleted = MRST_TRUE;
}
-
+
psFlipItem->ulSwapInterval--;
-
- if(psFlipItem->ulSwapInterval == 0)
- {
+
+ if (psFlipItem->ulSwapInterval == 0) {
psSwapChain->ulRemoveIndex++;
if(psSwapChain->ulRemoveIndex > ulMaxIndex)
psSwapChain->ulRemoveIndex = 0;
-
+
psFlipItem->bCmdCompleted = MRST_FALSE;
psFlipItem->bFlipped = MRST_FALSE;
-
+
psFlipItem->bValid = MRST_FALSE;
- }
- else
- {
-
+ } else
break;
- }
- }
- else
- {
+ } else {
if (psFlipItem->psBuffer)
DRMLFBFlipBuffer(psDevInfo, psSwapChain,
psFlipItem->psBuffer);
DRMLFBFlipBuffer2(psDevInfo, psSwapChain,
&psFlipItem->sPlaneContexts);
psFlipItem->bFlipped = MRST_TRUE;
-
-
break;
}
-
-
+
psFlipItem = &psSwapChain->psVSyncFlips[psSwapChain->ulRemoveIndex];
}
static int
MRSTLFBVSyncISR(struct drm_device *psDrmDevice, int iPipe)
{
- MRSTLFB_DEVINFO *psDevInfo = GetAnchorPtr();
+ MRSTLFB_DEVINFO *psDevInfo = GetAnchorPtr();
return MRSTLFBVSyncIHandler(psDevInfo, iPipe);
}
unsigned long irqflags;
struct drm_device *dev;
struct drm_psb_private *dev_priv;
-
+
if(!hCmdCookie || !pvData)
return IMG_FALSE;
-
psFlipCmd = (DISPLAYCLASS_FLIP_COMMAND*)pvData;
if (psFlipCmd == IMG_NULL)
return IMG_FALSE;
-
psDevInfo = (MRSTLFB_DEVINFO*)psFlipCmd->hExtDevice;
dev = psDevInfo->psDrmDevice;
dev_priv = (struct drm_psb_private *)
spin_lock_irqsave(&psDevInfo->sSwapChainLock, ulLockFlags);
#if defined(MRST_USING_INTERRUPTS)
-
+
if(!drm_psb_3D_vblank || psFlipCmd->ui32SwapInterval == 0 || psDevInfo->bFlushCommands)
{
#endif
DRMLFBFlipBuffer(psDevInfo, psSwapChain, psBuffer);
-
-
+
+
psSwapChain->psPVRJTable->pfnPVRSRVCmdComplete(hCmdCookie, IMG_TRUE);
#if defined(MRST_USING_INTERRUPTS)
if(psFlipItem->bValid == MRST_FALSE)
{
unsigned long ulMaxIndex = psSwapChain->ulSwapChainLength - 1;
-
+
if(psSwapChain->ulInsertIndex == psSwapChain->ulRemoveIndex)
{
-
+
DRMLFBFlipBuffer(psDevInfo, psSwapChain, psBuffer);
psFlipItem->bFlipped = MRST_TRUE;
goto ExitTrueUnlock;
}
-
+
spin_unlock_irqrestore(&psDevInfo->sSwapChainLock, ulLockFlags);
return IMG_FALSE;
int i;
struct drm_psb_private * dev_priv;
struct psb_gtt * pg;
-
+
if( !psDevInfo->sSystemBuffer.bIsContiguous )
MRSTLFBFreeKernelMem( psDevInfo->sSystemBuffer.uSysAddr.psNonCont );
-
+
dev_priv = (struct drm_psb_private *)dev->dev_private;
pg = dev_priv->pg;
-
+
psDevInfo->sDisplayDim.ui32ByteStride = psbfb->base.pitch;
psDevInfo->sDisplayDim.ui32Width = psbfb->base.width;
psDevInfo->sDisplayDim.ui32Height = psbfb->base.height;
psDevInfo->sSystemBuffer.ui32BufferSize = psbfb->size;
-
+
psDevInfo->sSystemBuffer.sCPUVAddr = pg->vram_addr;
-
+
psDevInfo->sSystemBuffer.sDevVAddr.uiAddr = 0;
- psDevInfo->sSystemBuffer.bIsAllocated = IMG_FALSE;
+ psDevInfo->sSystemBuffer.bIsAllocated = IMG_FALSE;
- if(psbfb->bo )
+ if(psbfb->bo )
{
-
+
psDevInfo->sSystemBuffer.bIsContiguous = IMG_FALSE;
- psDevInfo->sSystemBuffer.uSysAddr.psNonCont = MRSTLFBAllocKernelMem( sizeof( IMG_SYS_PHYADDR ) * psbfb->bo->ttm->num_pages);
- for(i = 0;i < psbfb->bo->ttm->num_pages;++i)
+ psDevInfo->sSystemBuffer.uSysAddr.psNonCont = MRSTLFBAllocKernelMem( sizeof( IMG_SYS_PHYADDR ) * psbfb->bo->ttm->num_pages);
+ for(i = 0;i < psbfb->bo->ttm->num_pages;++i)
{
struct page *p = ttm_tt_get_page( psbfb->bo->ttm, i);
- psDevInfo->sSystemBuffer.uSysAddr.psNonCont[i].uiAddr = page_to_pfn(p) << PAGE_SHIFT;
-
+ psDevInfo->sSystemBuffer.uSysAddr.psNonCont[i].uiAddr = page_to_pfn(p) << PAGE_SHIFT;
+
}
- }
- else
+ }
+ else
{
-
-
-
-
+
+
+
+
psDevInfo->sSystemBuffer.bIsContiguous = IMG_TRUE;
psDevInfo->sSystemBuffer.uSysAddr.sCont.uiAddr = pg->stolen_base;
MRSTLFB_DEVINFO *psDevInfo = GetAnchorPtr();
int i;
-
+
if( !psDevInfo->sSystemBuffer.bIsContiguous )
MRSTLFBFreeKernelMem( psDevInfo->sSystemBuffer.uSysAddr.psNonCont );
-
+
psDevInfo->sDisplayDim.ui32ByteStride = psbfb->base.pitch;
psDevInfo->sDisplayDim.ui32Width = psbfb->base.width;
psDevInfo->sDisplayDim.ui32Height = psbfb->base.height;
psDevInfo->sSystemBuffer.ui32BufferSize = psbfb->buf.size;
psDevInfo->sSystemBuffer.sCPUVAddr = psbfb->buf.kMapping;
psDevInfo->sSystemBuffer.sDevVAddr.uiAddr = psbfb->buf.offsetGTT;
- psDevInfo->sSystemBuffer.bIsAllocated = MRST_FALSE;
+ psDevInfo->sSystemBuffer.bIsAllocated = MRST_FALSE;
if ( psbfb->buf.type == PSB_BUFFER_VRAM )
{
-
- struct drm_device * psDrmDevice = psDevInfo->psDrmDevice;
+
+ struct drm_device * psDrmDevice = psDevInfo->psDrmDevice;
struct drm_psb_private * dev_priv = (struct drm_psb_private *)psDrmDevice->dev_private;
struct psb_gtt * pg = dev_priv->pg;
psDevInfo->sSystemBuffer.bIsContiguous = MRST_TRUE;
psDevInfo->sSystemBuffer.uSysAddr.sCont.uiAddr = pg->stolen_base;
} else {
-
+
psDevInfo->sSystemBuffer.bIsContiguous = MRST_FALSE;
- psDevInfo->sSystemBuffer.uSysAddr.psNonCont = MRSTLFBAllocKernelMem( sizeof( IMG_SYS_PHYADDR ) * (psbfb->buf.pagesNum));
- for (i = 0; i < psbfb->buf.pagesNum; i++)
+ psDevInfo->sSystemBuffer.uSysAddr.psNonCont = MRSTLFBAllocKernelMem( sizeof( IMG_SYS_PHYADDR ) * (psbfb->buf.pagesNum));
+ for (i = 0; i < psbfb->buf.pagesNum; i++)
{
- psDevInfo->sSystemBuffer.uSysAddr.psNonCont[i].uiAddr = psbfb_get_buffer_pfn( psDevInfo->psDrmDevice, &psbfb->buf, i) << PAGE_SHIFT;
+ psDevInfo->sSystemBuffer.uSysAddr.psNonCont[i].uiAddr = psbfb_get_buffer_pfn( psDevInfo->psDrmDevice, &psbfb->buf, i) << PAGE_SHIFT;
}
- }
+ }
return 0;
}
return eError;
}
-static int MRSTLFBFindMainPipe(struct drm_device *dev)
+static int MRSTLFBFindMainPipe(struct drm_device *dev)
{
struct drm_crtc *crtc;
- list_for_each_entry(crtc, &dev->mode_config.crtc_list, head)
+ list_for_each_entry(crtc, &dev->mode_config.crtc_list, head)
{
- if ( drm_helper_crtc_in_use(crtc) )
+ if ( drm_helper_crtc_in_use(crtc) )
{
struct psb_intel_crtc *psb_intel_crtc = to_psb_intel_crtc(crtc);
return psb_intel_crtc->pipe;
}
- }
-
+ }
+
return 0;
}
#ifndef DRM_PVR_USE_INTEL_FB
-static int DRMLFBLeaveVTHandler(struct drm_device *dev)
+static int DRMLFBLeaveVTHandler(struct drm_device *dev)
{
MRSTLFB_DEVINFO *psDevInfo = GetAnchorPtr();
unsigned long ulLockFlags;
-
+
spin_lock_irqsave(&psDevInfo->sSwapChainLock, ulLockFlags);
if (!psDevInfo->bLeaveVT)
return 0;
}
-static int DRMLFBEnterVTHandler(struct drm_device *dev)
+static int DRMLFBEnterVTHandler(struct drm_device *dev)
{
MRSTLFB_DEVINFO *psDevInfo = GetAnchorPtr();
unsigned long ulLockFlags;
#endif
struct drm_framebuffer * psDrmFB;
struct psb_framebuffer *psbfb;
-
+
int hdisplay;
int vdisplay;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
psDrmFB = psPsbFBDev->psb_fb_helper.fb;
#else
- psDrmFB = list_first_entry(&psDrmDevice->mode_config.fb_kernel_list,
- struct drm_framebuffer,
+ psDrmFB = list_first_entry(&psDrmDevice->mode_config.fb_kernel_list,
+ struct drm_framebuffer,
filp_head);
#endif
if(!psDrmFB) {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
psLINFBInfo = (struct fb_info*)psPsbFBDev->psb_fb_helper.fbdev;
#else
- psLINFBInfo = (struct fb_info*)psDrmFB->fbdev;
+ psLINFBInfo = (struct fb_info*)psDrmFB->fbdev;
#endif
#if defined(PVR_MRST_FB_SET_PAR_ON_INIT)
MRSTFBSetPar(psLINFBInfo);
#endif
-
+
psDevInfo->sSystemBuffer.bIsContiguous = MRST_TRUE;
psDevInfo->sSystemBuffer.bIsAllocated = MRST_FALSE;
MRSTLFBHandleChangeFB(psDrmDevice, psbfb);
- switch( psDrmFB->depth )
+ switch( psDrmFB->depth )
{
case 32:
case 24:
{
psDevInfo->sDisplayFormat.pixelformat = PVRSRV_PIXEL_FORMAT_RGB565;
break;
- }
+ }
default:
- {
+ {
printk(KERN_ERR"%s: Unknown bit depth %d\n",__FUNCTION__,psDrmFB->depth);
}
}
psDevInfo->psLINFBInfo = psLINFBInfo;
psDevInfo->ui32MainPipe = MRSTLFBFindMainPipe(psDevInfo->psDrmDevice);
-
- for(i = 0;i < MAX_SWAPCHAINS;++i)
+
+ for(i = 0;i < MAX_SWAPCHAINS;++i)
{
psDevInfo->apsSwapChains[i] = NULL;
}
-
-
-
+
+
+
psDevInfo->pvRegs = psbfb_vdc_reg(psDevInfo->psDrmDevice);
if (psDevInfo->pvRegs == NULL)
#endif
psDevInfo = GetAnchorPtr();
-
+
if (psDevInfo == NULL)
{
PFN_CMD_PROC pfnCmdProcList[MRSTLFB_COMMAND_COUNT];
IMG_UINT32 aui32SyncCountList[MRSTLFB_COMMAND_COUNT][2];
-
+
psDevInfo = (MRSTLFB_DEVINFO *)MRSTLFBAllocKernelMem(sizeof(MRSTLFB_DEVINFO));
if(!psDevInfo)
return (MRST_ERROR_OUT_OF_MEMORY);
}
-
+
memset(psDevInfo, 0, sizeof(MRSTLFB_DEVINFO));
-
+
SetAnchorPtr((void*)psDevInfo);
psDevInfo->psDrmDevice = dev;
return (MRST_ERROR_INIT_FAILURE);
}
-
+
if(!(*pfnGetPVRJTable)(&psDevInfo->sPVRJTable))
{
return (MRST_ERROR_INIT_FAILURE);
}
-
+
spin_lock_init(&psDevInfo->sSwapChainLock);
psDevInfo->psCurrentSwapChain = NULL;
strncpy(psDevInfo->sDisplayInfo.szDisplayName, DISPLAY_DEVICE_NAME, MAX_DISPLAY_NAME_SIZE);
-
-
+
+
DEBUG_PRINTK((KERN_INFO DRIVER_PREFIX
": Maximum number of swap chain buffers: %u\n",
psDevInfo->sDisplayInfo.ui32MaxSwapChainBuffers));
+
-
-
+
psDevInfo->sDCJTable.ui32TableSize = sizeof(PVRSRV_DC_SRV2DISP_KMJTABLE);
psDevInfo->sDCJTable.pfnOpenDCDevice = OpenDCDevice;
psDevInfo->sDCJTable.pfnSetDCState = SetDCState;
psDevInfo->sDCJTable.pfnGetDCFrontBuffer = GetDCFrontBuffer;
-
+
if(psDevInfo->sPVRJTable.pfnPVRSRVRegisterDCDevice (
&psDevInfo->sDCJTable,
&psDevInfo->uiDeviceID ) != PVRSRV_OK)
printk("Device ID: %d\n", (int)psDevInfo->uiDeviceID);
+
-
-
+
#if defined (MRST_USING_INTERRUPTS)
-
+
if(MRSTLFBInstallVSyncISR(psDevInfo,MRSTLFBVSyncISR) != MRST_OK)
{
DEBUG_PRINTK((KERN_INFO DRIVER_PREFIX "ISR Installation failed\n"));
}
#endif
-
+
pfnCmdProcList[DC_FLIP_COMMAND] = ProcessFlip;
-
-
- aui32SyncCountList[DC_FLIP_COMMAND][0] = 0;
- aui32SyncCountList[DC_FLIP_COMMAND][1] = 2;
-
-
+
+
+ aui32SyncCountList[DC_FLIP_COMMAND][0] = 0;
+ aui32SyncCountList[DC_FLIP_COMMAND][1] = 2;
+
+
}
-
+
#ifndef DRM_PVR_USE_INTEL_FB
- psDrmPriv->psb_change_fb_handler = MRSTLFBHandleChangeFB;
+ psDrmPriv->psb_change_fb_handler = MRSTLFBHandleChangeFB;
psDrmPriv->psb_leave_vt_handler = DRMLFBLeaveVTHandler;
psDrmPriv->psb_enter_vt_handler = DRMLFBEnterVTHandler;
#endif
MRSTLFBInstallScreenEvents(psDevInfo, MRSTLFBScreenEventHandler);
-
+
psDevInfo->ulRefCount++;
-
- return (MRST_OK);
+
+ return (MRST_OK);
}
MRST_ERROR MRSTLFBDeinit(void)
psDevFirst = GetAnchorPtr();
psDevInfo = psDevFirst;
-
+
if (psDevInfo == NULL)
{
return (MRST_ERROR_GENERIC);
}
-
+
psDevInfo->ulRefCount--;
if (psDevInfo->ulRefCount == 0)
{
-
+
PVRSRV_DC_DISP2SRV_KMJTABLE *psJTable = &psDevInfo->sPVRJTable;
if (psDevInfo->sPVRJTable.pfnPVRSRVRemoveCmdProcList (psDevInfo->uiDeviceID, MRSTLFB_COMMAND_COUNT) != PVRSRV_OK)
}
#if defined (MRST_USING_INTERRUPTS)
-
+
if(MRSTLFBUninstallVSyncISR(psDevInfo) != MRST_OK)
{
return (MRST_ERROR_GENERIC);
}
#endif
-
+
if (psJTable->pfnPVRSRVRemoveDCDevice(psDevInfo->uiDeviceID) != PVRSRV_OK)
{
return (MRST_ERROR_GENERIC);
}
-
-
+
+
MRSTLFBFreeKernelMem(psDevInfo);
}
-
-
+
+
SetAnchorPtr(NULL);
-
+
return (MRST_OK);
}
int i;
pvBuf = __vmalloc( ui32Size, GFP_KERNEL | __GFP_HIGHMEM, __pgprot((pgprot_val(PAGE_KERNEL ) & ~_PAGE_CACHE_MASK) | _PAGE_CACHE_WC) );
- if( pvBuf == NULL )
+ if( pvBuf == NULL )
{
return MRST_ERROR_OUT_OF_MEMORY;
}
ulPagesNumber = (ui32Size + PAGE_SIZE -1) / PAGE_SIZE;
- *ppBuffer = MRSTLFBAllocKernelMem( sizeof( MRSTLFB_BUFFER ) );
+ *ppBuffer = MRSTLFBAllocKernelMem( sizeof( MRSTLFB_BUFFER ) );
(*ppBuffer)->sCPUVAddr = pvBuf;
(*ppBuffer)->ui32BufferSize = ui32Size;
- (*ppBuffer)->uSysAddr.psNonCont = MRSTLFBAllocKernelMem( sizeof( IMG_SYS_PHYADDR ) * ulPagesNumber);
+ (*ppBuffer)->uSysAddr.psNonCont = MRSTLFBAllocKernelMem( sizeof( IMG_SYS_PHYADDR ) * ulPagesNumber);
(*ppBuffer)->bIsAllocated = MRST_TRUE;
(*ppBuffer)->bIsContiguous = MRST_FALSE;
(*ppBuffer)->ui32OwnerTaskID = task_tgid_nr(current);
i = 0;
- for (ulCounter = 0; ulCounter < ui32Size; ulCounter += PAGE_SIZE)
+ for (ulCounter = 0; ulCounter < ui32Size; ulCounter += PAGE_SIZE)
{
(*ppBuffer)->uSysAddr.psNonCont[i++].uiAddr = vmalloc_to_pfn( pvBuf + ulCounter ) << PAGE_SHIFT;
}
-
- psb_gtt_map_pvr_memory( psDevInfo->psDrmDevice,
- (unsigned int)*ppBuffer,
+
+ psb_gtt_map_pvr_memory( psDevInfo->psDrmDevice,
+ (unsigned int)*ppBuffer,
(*ppBuffer)->ui32OwnerTaskID,
- (IMG_CPU_PHYADDR*) (*ppBuffer)->uSysAddr.psNonCont,
+ (IMG_CPU_PHYADDR*) (*ppBuffer)->uSysAddr.psNonCont,
ulPagesNumber,
&(*ppBuffer)->sDevVAddr.uiAddr );
(*ppBuffer)->sDevVAddr.uiAddr <<= PAGE_SHIFT;
- return MRST_OK;
+ return MRST_OK;
}
MRST_ERROR MRSTLFBFreeBuffer(struct MRSTLFB_DEVINFO_TAG *psDevInfo, MRSTLFB_BUFFER **ppBuffer)
if( !(*ppBuffer)->bIsAllocated )
return MRST_ERROR_INVALID_PARAMS;
-#ifndef DRM_PVR_USE_INTEL_FB
- psb_gtt_unmap_memory( psDevInfo->psDrmDevice,
+#ifndef DRM_PVR_USE_INTEL_FB
+ psb_gtt_unmap_memory( psDevInfo->psDrmDevice,
#else
- psb_gtt_unmap_pvr_memory( psDevInfo->psDrmDevice,
+ psb_gtt_unmap_pvr_memory( psDevInfo->psDrmDevice,
#endif
(unsigned int)*ppBuffer,
(*ppBuffer)->ui32OwnerTaskID);
vfree( (*ppBuffer)->sCPUVAddr );
MRSTLFBFreeKernelMem( (*ppBuffer)->uSysAddr.psNonCont );
-
+
MRSTLFBFreeKernelMem( *ppBuffer);
*ppBuffer = NULL;
- return MRST_OK;
+ return MRST_OK;
}
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
/*
return (MRST_ERROR_INVALID_PARAMS);
}
-
+
*ppfnFuncTable = PVRGetDisplayClassJTable;
return (MRST_OK);
void MRSTLFBEnableVSyncInterrupt(MRSTLFB_DEVINFO * psDevinfo)
{
-#if defined(MRST_USING_INTERRUPTS)
+#if defined(MRST_USING_INTERRUPTS)
if( drm_vblank_get( psDevinfo->psDrmDevice , psDevinfo->ui32MainPipe ) )
{
DEBUG_PRINTK((KERN_INFO DRIVER_PREFIX "Couldn't get vsync enabled"));
void MRSTLFBDisableVSyncInterrupt(MRSTLFB_DEVINFO * psDevinfo)
{
-#if defined(MRST_USING_INTERRUPTS)
- drm_vblank_put( psDevinfo->psDrmDevice, psDevinfo->ui32MainPipe );
+#if defined(MRST_USING_INTERRUPTS)
+ drm_vblank_put( psDevinfo->psDrmDevice, psDevinfo->ui32MainPipe );
#endif
}
dev_priv->psb_vsync_handler = NULL;
return (MRST_OK);
}
-#endif
+#endif
void MRSTLFBFlipToSurface(MRSTLFB_DEVINFO *psDevInfo, unsigned long uiAddr)
MRSTLFB_SWAPCHAIN *psCurrentSwapChain = psDevInfo->psCurrentSwapChain;
if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, false))
- {
+ {
if (IS_MRST(dev)) {
MRSTLFBVSyncWriteReg(psDevInfo, dspsurf, uiAddr);
} else if (IS_MDFLD(dev)) {
}
} else {
MRSTLFBVSyncWriteReg(psDevInfo, dspbase, uiAddr);
- }
+ }
ospm_power_using_hw_end(OSPM_DISPLAY_ISLAND);
- }
+ }
}
void MRSTLFBSavePlaneConfig(MRSTLFB_DEVINFO *psDevInfo)
}
void PVR_DRM_MAKENAME(DISPLAY_CONTROLLER, _Cleanup)(struct drm_device unref__ *dev)
-{
+{
if(MRSTLFBDeinit() != MRST_OK)
{
printk(KERN_WARNING DRIVER_PREFIX ": %s: can't deinit device\n", __FUNCTION__);
#
# Copyright(c) 2008 Imagination Technologies Ltd. All rights reserved.
-#
+#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
-#
-# This program is distributed in the hope it will be useful but, except
-# as otherwise stated in writing, without any warranty; without even the
-# implied warranty of merchantability or fitness for a particular purpose.
+#
+# This program is distributed in the hope it will be useful but, except
+# as otherwise stated in writing, without any warranty; without even the
+# implied warranty of merchantability or fitness for a particular purpose.
# See the GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-#
+#
# The full GNU General Public License is included in this distribution in
# the file called "COPYING".
#
# Contact Information:
# Imagination Technologies Ltd. <gpl-support@imgtec.com>
-# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
-#
+# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+#
#
#
imgv/psb_ttm_glue.medfield.c \
imgv/psb_ttm_fence.medfield.c \
imgv/psb_ttm_fence_user.medfield.c \
- imgv/psb_ttm_placement_user.medfield.c
+ imgv/psb_ttm_placement_user.medfield.c
EXT_SOURCE_LIST += \
ttm/ttm_agp_backend.c \
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#if defined(SUPPORT_DRI_DRM)
#if defined(SUPPORT_DRI_DRM_EXT)
-#define PVR_DRM_SRVKM_CMD DRM_PVR_RESERVED1
-#define PVR_DRM_DISP_CMD DRM_PVR_RESERVED2
-#define PVR_DRM_BC_CMD DRM_PVR_RESERVED3
-#define PVR_DRM_IS_MASTER_CMD DRM_PVR_RESERVED4
-#define PVR_DRM_UNPRIV_CMD DRM_PVR_RESERVED5
-#define PVR_DRM_DBGDRV_CMD DRM_PVR_RESERVED6
-#else
-#define PVR_DRM_SRVKM_CMD 0
-#define PVR_DRM_DISP_CMD 1
-#define PVR_DRM_BC_CMD 2
-#define PVR_DRM_IS_MASTER_CMD 3
-#define PVR_DRM_UNPRIV_CMD 4
-#define PVR_DRM_DBGDRV_CMD 5
-#endif
-
-#define PVR_DRM_UNPRIV_INIT_SUCCESFUL 0
+#define PVR_DRM_SRVKM_CMD DRM_PVR_RESERVED1
+#define PVR_DRM_DISP_CMD DRM_PVR_RESERVED2
+#define PVR_DRM_BC_CMD DRM_PVR_RESERVED3
+#define PVR_DRM_IS_MASTER_CMD DRM_PVR_RESERVED4
+#define PVR_DRM_UNPRIV_CMD DRM_PVR_RESERVED5
+#define PVR_DRM_DBGDRV_CMD DRM_PVR_RESERVED6
+#else
+#define PVR_DRM_SRVKM_CMD 0
+#define PVR_DRM_DISP_CMD 1
+#define PVR_DRM_BC_CMD 2
+#define PVR_DRM_IS_MASTER_CMD 3
+#define PVR_DRM_UNPRIV_CMD 4
+#define PVR_DRM_DBGDRV_CMD 5
+#endif
+
+#define PVR_DRM_UNPRIV_INIT_SUCCESFUL 0
#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
typedef PVRSRV_ERROR (*PFN_BC_REGISTER_BUFFER_DEV)(PVRSRV_BC_SRV2BUFFER_KMJTABLE*, IMG_UINT32*);
typedef IMG_VOID (*PFN_BC_SCHEDULE_DEVICES)(IMG_VOID);
-typedef PVRSRV_ERROR (*PFN_BC_REMOVE_BUFFER_DEV)(IMG_UINT32);
+typedef PVRSRV_ERROR (*PFN_BC_REMOVE_BUFFER_DEV)(IMG_UINT32);
typedef struct PVRSRV_BC_BUFFER2SRV_KMJTABLE_TAG
{
} PVRSRV_BC_BUFFER2SRV_KMJTABLE, *PPVRSRV_BC_BUFFER2SRV_KMJTABLE;
-typedef IMG_BOOL (*PFN_BC_GET_PVRJTABLE) (PPVRSRV_BC_BUFFER2SRV_KMJTABLE);
+typedef IMG_BOOL (*PFN_BC_GET_PVRJTABLE) (PPVRSRV_BC_BUFFER2SRV_KMJTABLE);
IMG_IMPORT IMG_BOOL PVRGetBufferClassJTable(PVRSRV_BC_BUFFER2SRV_KMJTABLE *psJTable);
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
typedef PVRSRV_ERROR (*PFN_GET_DC_SYSTEMBUFFER)(IMG_HANDLE, IMG_HANDLE*);
typedef PVRSRV_ERROR (*PFN_GET_DC_INFO)(IMG_HANDLE, DISPLAY_INFO*);
typedef PVRSRV_ERROR (*PFN_CREATE_DC_SWAPCHAIN)(IMG_HANDLE,
- IMG_UINT32,
- DISPLAY_SURF_ATTRIBUTES*,
+ IMG_UINT32,
+ DISPLAY_SURF_ATTRIBUTES*,
DISPLAY_SURF_ATTRIBUTES*,
- IMG_UINT32,
+ IMG_UINT32,
PVRSRV_SYNC_DATA**,
IMG_UINT32,
- IMG_HANDLE*,
+ IMG_HANDLE*,
IMG_UINT32*);
-typedef PVRSRV_ERROR (*PFN_DESTROY_DC_SWAPCHAIN)(IMG_HANDLE,
+typedef PVRSRV_ERROR (*PFN_DESTROY_DC_SWAPCHAIN)(IMG_HANDLE,
IMG_HANDLE);
typedef PVRSRV_ERROR (*PFN_SET_DC_DSTRECT)(IMG_HANDLE, IMG_HANDLE, IMG_RECT*);
typedef PVRSRV_ERROR (*PFN_SET_DC_SRCRECT)(IMG_HANDLE, IMG_HANDLE, IMG_RECT*);
typedef struct DISPLAYCLASS_FLIP_COMMAND_TAG
{
-
+
IMG_HANDLE hExtDevice;
-
+
IMG_HANDLE hExtSwapChain;
-
+
IMG_HANDLE hExtBuffer;
-
+
IMG_HANDLE hPrivateTag;
-
+
IMG_UINT32 ui32ClipRectCount;
-
+
IMG_RECT *psClipRect;
-
+
IMG_UINT32 ui32SwapInterval;
} DISPLAYCLASS_FLIP_COMMAND;
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#define PDUMP_FLAGS_CONTINUOUS 0x40000000U
#define PDUMP_FLAGS_PERSISTENT 0x80000000U
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#ifdef __linux__
#include <linux/ioctl.h>
-
+
#define PVRSRV_IOC_GID 'g'
#define PVRSRV_IO(INDEX) _IO(PVRSRV_IOC_GID, INDEX, PVRSRV_BRIDGE_PACKAGE)
#define PVRSRV_IOW(INDEX) _IOW(PVRSRV_IOC_GID, INDEX, PVRSRV_BRIDGE_PACKAGE)
#define PVRSRV_IOR(INDEX) _IOR(PVRSRV_IOC_GID, INDEX, PVRSRV_BRIDGE_PACKAGE)
#define PVRSRV_IOWR(INDEX) _IOWR(PVRSRV_IOC_GID, INDEX, PVRSRV_BRIDGE_PACKAGE)
-#else
+#else
#error Unknown platform: Cannot define ioctls
#define PVRSRV_IOWR(INDEX) (PVRSRV_IOC_GID + (INDEX))
#define PVRSRV_BRIDGE_BASE PVRSRV_IOC_GID
-#endif
+#endif
#define PVRSRV_BRIDGE_CORE_CMD_FIRST 0UL
-#define PVRSRV_BRIDGE_ENUM_DEVICES PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+0)
-#define PVRSRV_BRIDGE_ACQUIRE_DEVICEINFO PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+1)
-#define PVRSRV_BRIDGE_RELEASE_DEVICEINFO PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+2)
-#define PVRSRV_BRIDGE_CREATE_DEVMEMCONTEXT PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+3)
-#define PVRSRV_BRIDGE_DESTROY_DEVMEMCONTEXT PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+4)
-#define PVRSRV_BRIDGE_GET_DEVMEM_HEAPINFO PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+5)
-#define PVRSRV_BRIDGE_ALLOC_DEVICEMEM PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+6)
-#define PVRSRV_BRIDGE_FREE_DEVICEMEM PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+7)
-#define PVRSRV_BRIDGE_GETFREE_DEVICEMEM PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+8)
-#define PVRSRV_BRIDGE_CREATE_COMMANDQUEUE PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+9)
-#define PVRSRV_BRIDGE_DESTROY_COMMANDQUEUE PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+10)
-#define PVRSRV_BRIDGE_MHANDLE_TO_MMAP_DATA PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+11)
-#define PVRSRV_BRIDGE_CONNECT_SERVICES PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+12)
-#define PVRSRV_BRIDGE_DISCONNECT_SERVICES PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+13)
-#define PVRSRV_BRIDGE_WRAP_DEVICE_MEM PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+14)
-#define PVRSRV_BRIDGE_GET_DEVICEMEMINFO PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+15)
+#define PVRSRV_BRIDGE_ENUM_DEVICES PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+0)
+#define PVRSRV_BRIDGE_ACQUIRE_DEVICEINFO PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+1)
+#define PVRSRV_BRIDGE_RELEASE_DEVICEINFO PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+2)
+#define PVRSRV_BRIDGE_CREATE_DEVMEMCONTEXT PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+3)
+#define PVRSRV_BRIDGE_DESTROY_DEVMEMCONTEXT PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+4)
+#define PVRSRV_BRIDGE_GET_DEVMEM_HEAPINFO PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+5)
+#define PVRSRV_BRIDGE_ALLOC_DEVICEMEM PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+6)
+#define PVRSRV_BRIDGE_FREE_DEVICEMEM PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+7)
+#define PVRSRV_BRIDGE_GETFREE_DEVICEMEM PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+8)
+#define PVRSRV_BRIDGE_CREATE_COMMANDQUEUE PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+9)
+#define PVRSRV_BRIDGE_DESTROY_COMMANDQUEUE PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+10)
+#define PVRSRV_BRIDGE_MHANDLE_TO_MMAP_DATA PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+11)
+#define PVRSRV_BRIDGE_CONNECT_SERVICES PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+12)
+#define PVRSRV_BRIDGE_DISCONNECT_SERVICES PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+13)
+#define PVRSRV_BRIDGE_WRAP_DEVICE_MEM PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+14)
+#define PVRSRV_BRIDGE_GET_DEVICEMEMINFO PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+15)
#define PVRSRV_BRIDGE_RESERVE_DEV_VIRTMEM PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+16)
#define PVRSRV_BRIDGE_FREE_DEV_VIRTMEM PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+17)
#define PVRSRV_BRIDGE_MAP_EXT_MEMORY PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+18)
#define PVRSRV_BRIDGE_CORE_CMD_LAST (PVRSRV_BRIDGE_CORE_CMD_FIRST+30)
#define PVRSRV_BRIDGE_SIM_CMD_FIRST (PVRSRV_BRIDGE_CORE_CMD_LAST+1)
-#define PVRSRV_BRIDGE_PROCESS_SIMISR_EVENT PVRSRV_IOWR(PVRSRV_BRIDGE_SIM_CMD_FIRST+0)
-#define PVRSRV_BRIDGE_REGISTER_SIM_PROCESS PVRSRV_IOWR(PVRSRV_BRIDGE_SIM_CMD_FIRST+1)
-#define PVRSRV_BRIDGE_UNREGISTER_SIM_PROCESS PVRSRV_IOWR(PVRSRV_BRIDGE_SIM_CMD_FIRST+2)
+#define PVRSRV_BRIDGE_PROCESS_SIMISR_EVENT PVRSRV_IOWR(PVRSRV_BRIDGE_SIM_CMD_FIRST+0)
+#define PVRSRV_BRIDGE_REGISTER_SIM_PROCESS PVRSRV_IOWR(PVRSRV_BRIDGE_SIM_CMD_FIRST+1)
+#define PVRSRV_BRIDGE_UNREGISTER_SIM_PROCESS PVRSRV_IOWR(PVRSRV_BRIDGE_SIM_CMD_FIRST+2)
#define PVRSRV_BRIDGE_SIM_CMD_LAST (PVRSRV_BRIDGE_SIM_CMD_FIRST+2)
#define PVRSRV_BRIDGE_MAPPING_CMD_FIRST (PVRSRV_BRIDGE_SIM_CMD_LAST+1)
-#define PVRSRV_BRIDGE_MAPPHYSTOUSERSPACE PVRSRV_IOWR(PVRSRV_BRIDGE_MAPPING_CMD_FIRST+0)
-#define PVRSRV_BRIDGE_UNMAPPHYSTOUSERSPACE PVRSRV_IOWR(PVRSRV_BRIDGE_MAPPING_CMD_FIRST+1)
-#define PVRSRV_BRIDGE_GETPHYSTOUSERSPACEMAP PVRSRV_IOWR(PVRSRV_BRIDGE_MAPPING_CMD_FIRST+2)
+#define PVRSRV_BRIDGE_MAPPHYSTOUSERSPACE PVRSRV_IOWR(PVRSRV_BRIDGE_MAPPING_CMD_FIRST+0)
+#define PVRSRV_BRIDGE_UNMAPPHYSTOUSERSPACE PVRSRV_IOWR(PVRSRV_BRIDGE_MAPPING_CMD_FIRST+1)
+#define PVRSRV_BRIDGE_GETPHYSTOUSERSPACEMAP PVRSRV_IOWR(PVRSRV_BRIDGE_MAPPING_CMD_FIRST+2)
#define PVRSRV_BRIDGE_MAPPING_CMD_LAST (PVRSRV_BRIDGE_MAPPING_CMD_FIRST+2)
#define PVRSRV_BRIDGE_STATS_CMD_FIRST (PVRSRV_BRIDGE_MAPPING_CMD_LAST+1)
-#define PVRSRV_BRIDGE_GET_FB_STATS PVRSRV_IOWR(PVRSRV_BRIDGE_STATS_CMD_FIRST+0)
+#define PVRSRV_BRIDGE_GET_FB_STATS PVRSRV_IOWR(PVRSRV_BRIDGE_STATS_CMD_FIRST+0)
#define PVRSRV_BRIDGE_STATS_CMD_LAST (PVRSRV_BRIDGE_STATS_CMD_FIRST+0)
#define PVRSRV_BRIDGE_MISC_CMD_FIRST (PVRSRV_BRIDGE_STATS_CMD_LAST+1)
-#define PVRSRV_BRIDGE_GET_MISC_INFO PVRSRV_IOWR(PVRSRV_BRIDGE_MISC_CMD_FIRST+0)
-#define PVRSRV_BRIDGE_RELEASE_MISC_INFO PVRSRV_IOWR(PVRSRV_BRIDGE_MISC_CMD_FIRST+1)
+#define PVRSRV_BRIDGE_GET_MISC_INFO PVRSRV_IOWR(PVRSRV_BRIDGE_MISC_CMD_FIRST+0)
+#define PVRSRV_BRIDGE_RELEASE_MISC_INFO PVRSRV_IOWR(PVRSRV_BRIDGE_MISC_CMD_FIRST+1)
#define PVRSRV_BRIDGE_MISC_CMD_LAST (PVRSRV_BRIDGE_MISC_CMD_FIRST+1)
#if defined (SUPPORT_OVERLAY_ROTATE_BLIT)
#define PVRSRV_BRIDGE_OVERLAY_CMD_FIRST (PVRSRV_BRIDGE_MISC_CMD_LAST+1)
-#define PVRSRV_BRIDGE_INIT_3D_OVL_BLT_RES PVRSRV_IOWR(PVRSRV_BRIDGE_OVERLAY_CMD_FIRST+0)
-#define PVRSRV_BRIDGE_DEINIT_3D_OVL_BLT_RES PVRSRV_IOWR(PVRSRV_BRIDGE_OVERLAY_CMD_FIRST+1)
+#define PVRSRV_BRIDGE_INIT_3D_OVL_BLT_RES PVRSRV_IOWR(PVRSRV_BRIDGE_OVERLAY_CMD_FIRST+0)
+#define PVRSRV_BRIDGE_DEINIT_3D_OVL_BLT_RES PVRSRV_IOWR(PVRSRV_BRIDGE_OVERLAY_CMD_FIRST+1)
#define PVRSRV_BRIDGE_OVERLAY_CMD_LAST (PVRSRV_BRIDGE_OVERLAY_CMD_FIRST+1)
#else
#define PVRSRV_BRIDGE_OVERLAY_CMD_LAST PVRSRV_BRIDGE_MISC_CMD_LAST
#if defined(PDUMP)
#define PVRSRV_BRIDGE_PDUMP_CMD_FIRST (PVRSRV_BRIDGE_OVERLAY_CMD_LAST+1)
-#define PVRSRV_BRIDGE_PDUMP_INIT PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+0)
-#define PVRSRV_BRIDGE_PDUMP_MEMPOL PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+1)
-#define PVRSRV_BRIDGE_PDUMP_DUMPMEM PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+2)
-#define PVRSRV_BRIDGE_PDUMP_REG PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+3)
-#define PVRSRV_BRIDGE_PDUMP_REGPOL PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+4)
-#define PVRSRV_BRIDGE_PDUMP_COMMENT PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+5)
-#define PVRSRV_BRIDGE_PDUMP_SETFRAME PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+6)
-#define PVRSRV_BRIDGE_PDUMP_ISCAPTURING PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+7)
-#define PVRSRV_BRIDGE_PDUMP_DUMPBITMAP PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+8)
-#define PVRSRV_BRIDGE_PDUMP_DUMPREADREG PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+9)
-#define PVRSRV_BRIDGE_PDUMP_SYNCPOL PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+10)
-#define PVRSRV_BRIDGE_PDUMP_DUMPSYNC PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+11)
-#define PVRSRV_BRIDGE_PDUMP_MEMPAGES PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+12)
-#define PVRSRV_BRIDGE_PDUMP_DRIVERINFO PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+13)
-#define PVRSRV_BRIDGE_PDUMP_DUMPPDDEVPADDR PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+15)
+#define PVRSRV_BRIDGE_PDUMP_INIT PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+0)
+#define PVRSRV_BRIDGE_PDUMP_MEMPOL PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+1)
+#define PVRSRV_BRIDGE_PDUMP_DUMPMEM PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+2)
+#define PVRSRV_BRIDGE_PDUMP_REG PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+3)
+#define PVRSRV_BRIDGE_PDUMP_REGPOL PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+4)
+#define PVRSRV_BRIDGE_PDUMP_COMMENT PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+5)
+#define PVRSRV_BRIDGE_PDUMP_SETFRAME PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+6)
+#define PVRSRV_BRIDGE_PDUMP_ISCAPTURING PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+7)
+#define PVRSRV_BRIDGE_PDUMP_DUMPBITMAP PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+8)
+#define PVRSRV_BRIDGE_PDUMP_DUMPREADREG PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+9)
+#define PVRSRV_BRIDGE_PDUMP_SYNCPOL PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+10)
+#define PVRSRV_BRIDGE_PDUMP_DUMPSYNC PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+11)
+#define PVRSRV_BRIDGE_PDUMP_MEMPAGES PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+12)
+#define PVRSRV_BRIDGE_PDUMP_DRIVERINFO PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+13)
+#define PVRSRV_BRIDGE_PDUMP_DUMPPDDEVPADDR PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+15)
#define PVRSRV_BRIDGE_PDUMP_CYCLE_COUNT_REG_READ PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+16)
#define PVRSRV_BRIDGE_PDUMP_STARTINITPHASE PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+17)
#define PVRSRV_BRIDGE_PDUMP_STOPINITPHASE PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+18)
#endif
#define PVRSRV_BRIDGE_OEM_CMD_FIRST (PVRSRV_BRIDGE_PDUMP_CMD_LAST+1)
-#define PVRSRV_BRIDGE_GET_OEMJTABLE PVRSRV_IOWR(PVRSRV_BRIDGE_OEM_CMD_FIRST+0)
+#define PVRSRV_BRIDGE_GET_OEMJTABLE PVRSRV_IOWR(PVRSRV_BRIDGE_OEM_CMD_FIRST+0)
#define PVRSRV_BRIDGE_OEM_CMD_LAST (PVRSRV_BRIDGE_OEM_CMD_FIRST+0)
#define PVRSRV_BRIDGE_DEVCLASS_CMD_FIRST (PVRSRV_BRIDGE_OEM_CMD_LAST+1)
typedef struct PVRSRV_BRIDGE_PACKAGE_TAG
{
- IMG_UINT32 ui32BridgeID;
- IMG_UINT32 ui32Size;
- IMG_VOID *pvParamIn;
- IMG_UINT32 ui32InBufferSize;
- IMG_VOID *pvParamOut;
- IMG_UINT32 ui32OutBufferSize;
+ IMG_UINT32 ui32BridgeID;
+ IMG_UINT32 ui32Size;
+ IMG_VOID *pvParamIn;
+ IMG_UINT32 ui32InBufferSize;
+ IMG_VOID *pvParamOut;
+ IMG_UINT32 ui32OutBufferSize;
#if defined (SUPPORT_SID_INTERFACE)
- IMG_SID hKernelServices;
+ IMG_SID hKernelServices;
#else
- IMG_HANDLE hKernelServices;
+ IMG_HANDLE hKernelServices;
#endif
}PVRSRV_BRIDGE_PACKAGE;
typedef struct PVRSRV_BRIDGE_IN_CONNECT_SERVICES_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
IMG_UINT32 ui32Flags;
} PVRSRV_BRIDGE_IN_CONNECT_SERVICES;
typedef struct PVRSRV_BRIDGE_IN_ACQUIRE_DEVICEINFO_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
IMG_UINT32 uiDevIndex;
PVRSRV_DEVICE_TYPE eDeviceType;
typedef struct PVRSRV_BRIDGE_IN_ENUMCLASS_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
PVRSRV_DEVICE_CLASS sDeviceClass;
} PVRSRV_BRIDGE_IN_ENUMCLASS;
typedef struct PVRSRV_BRIDGE_IN_CLOSE_DISPCLASS_DEVICE_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDeviceKM;
#else
typedef struct PVRSRV_BRIDGE_IN_ENUM_DISPCLASS_FORMATS_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDeviceKM;
#else
typedef struct PVRSRV_BRIDGE_IN_GET_DISPCLASS_SYSBUFFER_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDeviceKM;
#else
typedef struct PVRSRV_BRIDGE_IN_GET_DISPCLASS_INFO_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDeviceKM;
#else
typedef struct PVRSRV_BRIDGE_IN_CLOSE_BUFFERCLASS_DEVICE_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDeviceKM;
#else
typedef struct PVRSRV_BRIDGE_IN_GET_BUFFERCLASS_INFO_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDeviceKM;
#else
typedef struct PVRSRV_BRIDGE_IN_RELEASE_DEVICEINFO_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
#else
typedef struct PVRSRV_BRIDGE_IN_FREE_CLASSDEVICEINFO_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
PVRSRV_DEVICE_CLASS DeviceClass;
IMG_VOID* pvDevInfo;
typedef struct PVRSRV_BRIDGE_IN_GET_DEVMEM_HEAPINFO_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
IMG_SID hDevMemContext;
typedef struct PVRSRV_BRIDGE_IN_CREATE_DEVMEMCONTEXT_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
#else
typedef struct PVRSRV_BRIDGE_IN_DESTROY_DEVMEMCONTEXT_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
IMG_SID hDevMemContext;
typedef struct PVRSRV_BRIDGE_IN_ALLOCDEVICEMEM_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
IMG_SID hDevMemHeap;
typedef struct PVRSRV_BRIDGE_IN_MAPMEMINFOTOUSER_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hKernelMemInfo;
#else
typedef struct PVRSRV_BRIDGE_IN_UNMAPMEMINFOFROMUSER_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hKernelMemInfo;
#else
typedef struct PVRSRV_BRIDGE_IN_FREEDEVICEMEM_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
IMG_SID hKernelMemInfo;
typedef struct PVRSRV_BRIDGE_IN_EXPORTDEVICEMEM_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
IMG_SID hKernelMemInfo;
typedef struct PVRSRV_BRIDGE_IN_GETFREEDEVICEMEM_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
IMG_UINT32 ui32Flags;
} PVRSRV_BRIDGE_IN_GETFREEDEVICEMEM;
typedef struct PVRSRV_BRIDGE_IN_CREATECOMMANDQUEUE_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
#else
typedef struct PVRSRV_BRIDGE_IN_DESTROYCOMMANDQUEUE_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
#else
typedef struct PVRSRV_BRIDGE_IN_MHANDLE_TO_MMAP_DATA_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
- IMG_SID hMHandle;
+ IMG_SID hMHandle;
#else
- IMG_HANDLE hMHandle;
+ IMG_HANDLE hMHandle;
#endif
} PVRSRV_BRIDGE_IN_MHANDLE_TO_MMAP_DATA;
typedef struct PVRSRV_BRIDGE_IN_RELEASE_MMAP_DATA_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
- IMG_SID hMHandle;
+ IMG_SID hMHandle;
#else
- IMG_HANDLE hMHandle;
+ IMG_HANDLE hMHandle;
#endif
} PVRSRV_BRIDGE_IN_RELEASE_MMAP_DATA;
typedef struct PVRSRV_BRIDGE_IN_RESERVE_DEV_VIRTMEM_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevMemHeap;
#else
typedef struct PVRSRV_BRIDGE_IN_FREE_DEV_VIRTMEM_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hKernelMemInfo;
#else
typedef struct PVRSRV_BRIDGE_IN_MAP_DEV_MEMORY_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hKernelMemInfo;
IMG_SID hDstDevMemHeap;
typedef struct PVRSRV_BRIDGE_IN_UNMAP_DEV_MEMORY_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hKernelMemInfo;
#else
typedef struct PVRSRV_BRIDGE_IN_MAP_EXT_MEMORY_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hKernelMemInfo;
#else
typedef struct PVRSRV_BRIDGE_IN_UNMAP_EXT_MEMORY_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
PVRSRV_CLIENT_MEM_INFO sClientMemInfo;
PVRSRV_CLIENT_SYNC_INFO sClientSyncInfo;
IMG_UINT32 ui32Flags;
typedef struct PVRSRV_BRIDGE_IN_MAP_DEVICECLASS_MEMORY_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDeviceClassBuffer;
IMG_SID hDevMemContext;
typedef struct PVRSRV_BRIDGE_IN_UNMAP_DEVICECLASS_MEMORY_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hKernelMemInfo;
#else
typedef struct PVRSRV_BRIDGE_IN_PDUMP_MEMPOL_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hKernelMemInfo;
#else
typedef struct PVRSRV_BRIDGE_IN_PDUMP_SYNCPOL_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hKernelSyncInfo;
#else
typedef struct PVRSRV_BRIDGE_IN_PDUMP_DUMPMEM_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
IMG_PVOID pvLinAddr;
IMG_PVOID pvAltLinAddr;
#if defined (SUPPORT_SID_INTERFACE)
typedef struct PVRSRV_BRIDGE_IN_PDUMP_DUMPSYNC_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
IMG_PVOID pvAltLinAddr;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hKernelSyncInfo;
typedef struct PVRSRV_BRIDGE_IN_PDUMP_DUMPREG_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
#else
typedef struct PVRSRV_BRIDGE_IN_PDUMP_REGPOL_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
#else
typedef struct PVRSRV_BRIDGE_IN_PDUMP_DUMPPDREG_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
PVRSRV_HWREG sHWReg;
IMG_UINT32 ui32Flags;
typedef struct PVRSRV_BRIDGE_IN_PDUMP_MEMPAGES_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
IMG_SID hKernelMemInfo;
typedef struct PVRSRV_BRIDGE_IN_PDUMP_COMMENT_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
IMG_CHAR szComment[PVRSRV_PDUMP_MAX_COMMENT_SIZE];
IMG_UINT32 ui32Flags;
typedef struct PVRSRV_BRIDGE_IN_PDUMP_SETFRAME_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
IMG_UINT32 ui32Frame;
}PVRSRV_BRIDGE_IN_PDUMP_SETFRAME;
typedef struct PVRSRV_BRIDGE_IN_PDUMP_BITMAP_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
#else
typedef struct PVRSRV_BRIDGE_IN_PDUMP_READREG_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
#else
typedef struct PVRSRV_BRIDGE_IN_PDUMP_DRIVERINFO_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
IMG_CHAR szString[PVRSRV_PDUMP_MAX_COMMENT_SIZE];
IMG_BOOL bContinuous;
typedef struct PVRSRV_BRIDGE_IN_PDUMP_DUMPPDDEVPADDR_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hKernelMemInfo;
#else
typedef struct PVRSRV_BRIDGE_PDUM_IN_CYCLE_COUNT_REG_READ_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
#else
typedef struct PVRSRV_BRIDGE_IN_OPEN_DISPCLASS_DEVICE_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
IMG_UINT32 ui32DeviceID;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
typedef struct PVRSRV_BRIDGE_IN_WRAP_EXT_MEMORY_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
IMG_SID hDevMemContext;
typedef struct PVRSRV_BRIDGE_IN_UNWRAP_EXT_MEMORY_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hKernelMemInfo;
#else
typedef struct PVRSRV_BRIDGE_IN_ENUM_DISPCLASS_DIMS_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDeviceKM;
#else
typedef struct PVRSRV_BRIDGE_IN_CREATE_DISPCLASS_SWAPCHAIN_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDeviceKM;
#else
typedef struct PVRSRV_BRIDGE_IN_DESTROY_DISPCLASS_SWAPCHAIN_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDeviceKM;
IMG_SID hSwapChain;
typedef struct PVRSRV_BRIDGE_IN_SET_DISPCLASS_RECT_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDeviceKM;
IMG_SID hSwapChain;
typedef struct PVRSRV_BRIDGE_IN_SET_DISPCLASS_COLOURKEY_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDeviceKM;
IMG_SID hSwapChain;
typedef struct PVRSRV_BRIDGE_IN_GET_DISPCLASS_BUFFERS_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDeviceKM;
IMG_SID hSwapChain;
typedef struct PVRSRV_BRIDGE_IN_SWAP_DISPCLASS_TO_BUFFER_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDeviceKM;
IMG_SID hBuffer;
typedef struct PVRSRV_BRIDGE_IN_SWAP_DISPCLASS_TO_SYSTEM_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDeviceKM;
IMG_SID hSwapChain;
typedef struct PVRSRV_BRIDGE_IN_GET_DISPCLASS_FRONT_BUFFER_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
IMG_HANDLE hDeviceKM;
} PVRSRV_BRIDGE_IN_GET_DISPCLASS_FRONT_BUFFER;
typedef struct PVRSRV_BRIDGE_IN_OPEN_BUFFERCLASS_DEVICE_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
IMG_UINT32 ui32DeviceID;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
typedef struct PVRSRV_BRIDGE_IN_GET_BUFFERCLASS_BUFFER_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDeviceKM;
#else
{
PVRSRV_ERROR eError;
-
+
IMG_UINT32 ui32MMapOffset;
-
+
IMG_UINT32 ui32ByteOffset;
-
+
IMG_UINT32 ui32RealByteSize;
-
+
IMG_UINT32 ui32UserVAddr;
} PVRSRV_BRIDGE_OUT_MHANDLE_TO_MMAP_DATA;
{
PVRSRV_ERROR eError;
-
+
IMG_BOOL bMUnmap;
-
+
IMG_UINT32 ui32UserVAddr;
-
+
IMG_UINT32 ui32RealByteSize;
} PVRSRV_BRIDGE_OUT_RELEASE_MMAP_DATA;
typedef struct PVRSRV_BRIDGE_IN_GET_MISC_INFO_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
PVRSRV_MISC_INFO sMiscInfo;
}PVRSRV_BRIDGE_IN_GET_MISC_INFO;
typedef struct PVRSRV_BRIDGE_IN_RELEASE_MISC_INFO_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
PVRSRV_MISC_INFO sMiscInfo;
}PVRSRV_BRIDGE_IN_RELEASE_MISC_INFO;
typedef struct PVRSRV_BRIDGE_IN_GET_FB_STATS_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
IMG_SIZE_T ui32Total;
IMG_SIZE_T ui32Available;
typedef struct PVRSRV_BRIDGE_IN_MAPPHYSTOUSERSPACE_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
#else
typedef struct PVRSRV_BRIDGE_IN_UNMAPPHYSTOUSERSPACE_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
#else
#if !defined (SUPPORT_SID_INTERFACE)
typedef struct PVRSRV_BRIDGE_IN_REGISTER_SIM_PROCESS_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
IMG_HANDLE hDevCookie;
IMG_PVOID pvProcess;
typedef struct PVRSRV_BRIDGE_OUT_REGISTER_SIM_PROCESS_TAG
{
- IMG_SYS_PHYADDR sRegsPhysBase;
- IMG_VOID *pvRegsBase;
+ IMG_SYS_PHYADDR sRegsPhysBase;
+ IMG_VOID *pvRegsBase;
IMG_PVOID pvProcess;
IMG_UINT32 ulNoOfEntries;
IMG_PVOID pvTblLinAddr;
typedef struct PVRSRV_BRIDGE_IN_UNREGISTER_SIM_PROCESS_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
IMG_HANDLE hDevCookie;
IMG_PVOID pvProcess;
- IMG_VOID *pvRegsBase;
+ IMG_VOID *pvRegsBase;
} PVRSRV_BRIDGE_IN_UNREGISTER_SIM_PROCESS;
typedef struct PVRSRV_BRIDGE_IN_PROCESS_SIMISR_EVENT_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
IMG_HANDLE hDevCookie;
IMG_UINT32 ui32StatusAndMask;
PVRSRV_ERROR eError;
} PVRSRV_BRIDGE_IN_PROCESS_SIMISR_EVENT;
-#endif
+#endif
typedef struct PVRSRV_BRIDGE_IN_INITSRV_DISCONNECT_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
IMG_BOOL bInitSuccesful;
} PVRSRV_BRIDGE_IN_INITSRV_DISCONNECT;
typedef struct PVRSRV_BRIDGE_IN_ALLOC_SHARED_SYS_MEM_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
IMG_UINT32 ui32Flags;
IMG_SIZE_T ui32Size;
}PVRSRV_BRIDGE_IN_ALLOC_SHARED_SYS_MEM;
IMG_SID hKernelMemInfo;
IMG_SID hMappingInfo;
#else
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo;
#endif
PVRSRV_CLIENT_MEM_INFO sClientMemInfo;
typedef struct PVRSRV_BRIDGE_IN_MAP_MEMINFO_MEM_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hKernelMemInfo;
#else
typedef struct PVRSRV_BRIDGE_IN_UNMAP_MEMINFO_MEM_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
PVRSRV_CLIENT_MEM_INFO sClientMemInfo;
}PVRSRV_BRIDGE_IN_UNMAP_MEMINFO_MEM;
typedef struct PVRSRV_BRIDGE_IN_EVENT_OBJECT_WAI_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hOSEventKM;
#else
typedef struct PVRSRV_BRIDGE_IN_DESTROY_SYNC_INFO_MOD_OBJ
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hKernelSyncInfoModObj;
#else
typedef struct PVRSRV_BRIDGE_IN_MODIFY_PENDING_SYNC_OPS_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hKernelSyncInfoModObj;
IMG_SID hKernelSyncInfo;
typedef struct PVRSRV_BRIDGE_IN_MODIFY_COMPLETE_SYNC_OPS_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hKernelSyncInfoModObj;
#else
{
PVRSRV_ERROR eError;
-
+
IMG_UINT32 ui32ReadOpsPending;
IMG_UINT32 ui32WriteOpsPending;
IMG_UINT32 ui32ReadOps2Pending;
typedef struct PVRSRV_BRIDGE_IN_SYNC_OPS_TAKE_TOKEN_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hKernelSyncInfo;
#else
typedef struct PVRSRV_BRIDGE_IN_SYNC_OPS_FLUSH_TO_TOKEN_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hKernelSyncInfo;
#else
typedef struct PVRSRV_BRIDGE_IN_SYNC_OPS_FLUSH_TO_MOD_OBJ_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hKernelSyncInfoModObj;
#else
typedef struct PVRSRV_BRIDGE_IN_SYNC_OPS_FLUSH_TO_DELTA_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hKernelSyncInfo;
#else
typedef struct PVRSRV_BRIDGE_IN_ALLOC_SYNC_INFO_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
typedef struct PVRSRV_BRIDGE_IN_FREE_SYNC_INFO_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hKernelSyncInfo;
}
#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
PVRSRV_ERROR IMG_CALLCONV PVRSRVAcquireDeviceDataKM(IMG_UINT32 uiDevIndex,
PVRSRV_DEVICE_TYPE eDeviceType,
IMG_HANDLE *phDevCookie);
-
+
IMG_IMPORT
PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateCommandQueueKM(IMG_SIZE_T ui32QueueSize,
PVRSRV_QUEUE_INFO **ppsQueueInfo);
PVRSRV_ERROR IMG_CALLCONV PVRSRVWrapExtMemoryKM(IMG_HANDLE hDevCookie,
PVRSRV_PER_PROCESS_DATA *psPerProc,
IMG_HANDLE hDevMemContext,
- IMG_SIZE_T ui32ByteSize,
+ IMG_SIZE_T ui32ByteSize,
IMG_SIZE_T ui32PageOffset,
IMG_BOOL bPhysContig,
IMG_SYS_PHYADDR *psSysAddr,
}
#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
IMG_BOOL PVRUnMapKMem(IMG_HANDLE hModule, IMG_HANDLE hMappingInfo, IMG_HANDLE hMHandle);
#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#if defined (__cplusplus)
}
#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
typedef struct _PVRSRV_KERNEL_MEM_INFO_
{
-
+
IMG_PVOID pvLinAddrKM;
-
+
IMG_DEV_VIRTADDR sDevVAddr;
-
+
IMG_UINT32 ui32Flags;
-
+
IMG_SIZE_T uAllocSize;
-
+
PVRSRV_MEMBLK sMemBlk;
-
+
IMG_PVOID pvSysBackupBuffer;
-
+
IMG_UINT32 ui32RefCount;
-
+
IMG_BOOL bPendingFree;
#if defined(SUPPORT_MEMINFO_IDS)
#if !defined(USE_CODE)
-
+
IMG_UINT64 ui64Stamp;
- #else
+ #else
IMG_UINT32 dummy1;
IMG_UINT32 dummy2;
- #endif
-#endif
-
+ #endif
+#endif
+
struct _PVRSRV_KERNEL_SYNC_INFO_ *psKernelSyncInfo;
PVRSRV_MEMTYPE memType;
-
+
struct {
-
+
IMG_BOOL bInUse;
-
+
IMG_HANDLE hDevCookieInt;
-
+
IMG_UINT32 ui32ShareIndex;
-
+
IMG_UINT32 ui32OrigReqAttribs;
IMG_UINT32 ui32OrigReqSize;
typedef struct _PVRSRV_KERNEL_SYNC_INFO_
{
-
+
PVRSRV_SYNC_DATA *psSyncData;
-
+
IMG_DEV_VIRTADDR sWriteOpsCompleteDevVAddr;
-
+
IMG_DEV_VIRTADDR sReadOpsCompleteDevVAddr;
IMG_DEV_VIRTADDR sReadOps2CompleteDevVAddr;
-
+
PVRSRV_KERNEL_MEM_INFO *psSyncDataMemInfoKM;
-
-
+
+
IMG_UINT32 ui32RefCount;
-
+
IMG_HANDLE hResItem;
-
+
IMG_UINT32 ui32UID;
} PVRSRV_KERNEL_SYNC_INFO;
typedef struct _PVRSRV_DEVICE_SYNC_OBJECT_
{
-
+
IMG_UINT32 ui32ReadOpsPendingVal;
IMG_DEV_VIRTADDR sReadOpsCompleteDevVAddr;
IMG_UINT32 ui32WriteOpsPendingVal;
typedef struct _PVRSRV_COMMAND
{
- IMG_SIZE_T uCmdSize;
- IMG_UINT32 ui32DevIndex;
- IMG_UINT32 CommandType;
- IMG_UINT32 ui32DstSyncCount;
- IMG_UINT32 ui32SrcSyncCount;
- PVRSRV_SYNC_OBJECT *psDstSync;
- PVRSRV_SYNC_OBJECT *psSrcSync;
- IMG_SIZE_T uDataSize;
- IMG_UINT32 ui32ProcessID;
- IMG_VOID *pvData;
+ IMG_SIZE_T uCmdSize;
+ IMG_UINT32 ui32DevIndex;
+ IMG_UINT32 CommandType;
+ IMG_UINT32 ui32DstSyncCount;
+ IMG_UINT32 ui32SrcSyncCount;
+ PVRSRV_SYNC_OBJECT *psDstSync;
+ PVRSRV_SYNC_OBJECT *psSrcSync;
+ IMG_SIZE_T uDataSize;
+ IMG_UINT32 ui32ProcessID;
+ IMG_VOID *pvData;
PFN_QUEUE_COMMAND_COMPLETE pfnCommandComplete;
IMG_HANDLE hCallbackData;
}PVRSRV_COMMAND, *PPVRSRV_COMMAND;
typedef struct _PVRSRV_QUEUE_INFO_
{
- IMG_VOID *pvLinQueueKM;
- IMG_VOID *pvLinQueueUM;
- volatile IMG_SIZE_T ui32ReadOffset;
- volatile IMG_SIZE_T ui32WriteOffset;
- IMG_UINT32 *pui32KickerAddrKM;
- IMG_UINT32 *pui32KickerAddrUM;
- IMG_SIZE_T ui32QueueSize;
+ IMG_VOID *pvLinQueueKM;
+ IMG_VOID *pvLinQueueUM;
+ volatile IMG_SIZE_T ui32ReadOffset;
+ volatile IMG_SIZE_T ui32WriteOffset;
+ IMG_UINT32 *pui32KickerAddrKM;
+ IMG_UINT32 *pui32KickerAddrUM;
+ IMG_SIZE_T ui32QueueSize;
- IMG_UINT32 ui32ProcessID;
+ IMG_UINT32 ui32ProcessID;
IMG_HANDLE hMemBlock[2];
- struct _PVRSRV_QUEUE_INFO_ *psNextKM;
+ struct _PVRSRV_QUEUE_INFO_ *psNextKM;
}PVRSRV_QUEUE_INFO;
typedef struct _PVRSRV_EVENTOBJECT_KM_
{
-
+
IMG_CHAR szName[EVENTOBJNAME_MAXLENGTH];
-
+
IMG_HANDLE hOSEventKM;
} PVRSRV_EVENTOBJECT_KM;
typedef struct _PVRSRV_MISC_INFO_KM_
{
- IMG_UINT32 ui32StateRequest;
- IMG_UINT32 ui32StatePresent;
-
+ IMG_UINT32 ui32StateRequest;
+ IMG_UINT32 ui32StatePresent;
+
IMG_VOID *pvSOCTimerRegisterKM;
IMG_VOID *pvSOCTimerRegisterUM;
IMG_HANDLE hSOCTimerRegisterOSMemHandle;
IMG_HANDLE hSOCTimerRegisterMappingInfo;
-
+
IMG_VOID *pvSOCClockGateRegs;
IMG_UINT32 ui32SOCClockGateRegsSize;
-
+
IMG_CHAR *pszMemoryStr;
IMG_UINT32 ui32MemoryStrLen;
-
+
PVRSRV_EVENTOBJECT_KM sGlobalEventObject;
IMG_HANDLE hOSGlobalEvent;
-
+
IMG_UINT32 aui32DDKVersion[4];
struct
{
-
+
IMG_BOOL bDeferOp;
-
+
PVRSRV_MISC_INFO_CPUCACHEOP_TYPE eCacheOpType;
PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo;
-
+
IMG_VOID *pvBaseVAddr;
-
+
IMG_UINT32 ui32Length;
} sCacheOpCtl;
#if defined (__cplusplus)
}
#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#define PVRSRV_BRIDGE_LAST_SGX_CMD (PVRSRV_BRIDGE_SGX_CMD_BASE+37)
-
+
typedef struct PVRSRV_BRIDGE_IN_GETPHYSPAGEADDR
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
IMG_HANDLE hDevMemHeap;
IMG_DEV_VIRTADDR sDevVAddr;
}PVRSRV_BRIDGE_IN_GETPHYSPAGEADDR;
-
+
typedef struct PVRSRV_BRIDGE_OUT_GETPHYSPAGEADDR
{
PVRSRV_ERROR eError;
IMG_CPU_PHYADDR CpuPAddr;
}PVRSRV_BRIDGE_OUT_GETPHYSPAGEADDR;
-
+
typedef struct PVRSRV_BRIDGE_IN_SGX_SET_TRANSFER_CONTEXT_PRIORITY_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
IMG_SID hHWTransferContext;
IMG_UINT32 ui32OffsetOfPriorityField;
}PVRSRV_BRIDGE_IN_SGX_SET_TRANSFER_CONTEXT_PRIORITY;
-
+
typedef struct PVRSRV_BRIDGE_IN_SGX_SET_RENDER_CONTEXT_PRIORITY_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
IMG_SID hHWRenderContext;
IMG_UINT32 ui32OffsetOfPriorityField;
}PVRSRV_BRIDGE_IN_SGX_SET_RENDER_CONTEXT_PRIORITY;
-
+
typedef struct PVRSRV_BRIDGE_IN_GETCLIENTINFO_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
#else
#endif
}PVRSRV_BRIDGE_IN_GETCLIENTINFO;
-
+
typedef struct PVRSRV_BRIDGE_OUT_GETINTERNALDEVINFO_TAG
{
SGX_INTERNAL_DEVINFO sSGXInternalDevInfo;
PVRSRV_ERROR eError;
}PVRSRV_BRIDGE_OUT_GETINTERNALDEVINFO;
-
+
typedef struct PVRSRV_BRIDGE_IN_GETINTERNALDEVINFO_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
#else
#endif
}PVRSRV_BRIDGE_IN_GETINTERNALDEVINFO;
-
+
typedef struct PVRSRV_BRIDGE_OUT_GETCLIENTINFO_TAG
{
SGX_CLIENT_INFO sClientInfo;
PVRSRV_ERROR eError;
}PVRSRV_BRIDGE_OUT_GETCLIENTINFO;
-
+
typedef struct PVRSRV_BRIDGE_IN_RELEASECLIENTINFO_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
#else
SGX_CLIENT_INFO sClientInfo;
}PVRSRV_BRIDGE_IN_RELEASECLIENTINFO;
-
+
typedef struct PVRSRV_BRIDGE_IN_ISPBREAKPOLL_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
#else
#endif
}PVRSRV_BRIDGE_IN_ISPBREAKPOLL;
-
+
typedef struct PVRSRV_BRIDGE_IN_DOKICK_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
#else
SGX_CCB_KICK sCCBKick;
}PVRSRV_BRIDGE_IN_DOKICK;
-
+
typedef struct PVRSRV_BRIDGE_IN_SGX_SCHEDULE_PROCESS_QUEUES_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
#else
#if defined(TRANSFER_QUEUE)
-
+
typedef struct PVRSRV_BRIDGE_IN_SUBMITTRANSFER_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
#else
}PVRSRV_BRIDGE_IN_SUBMITTRANSFER;
#if defined(SGX_FEATURE_2D_HARDWARE)
-
+
typedef struct PVRSRV_BRIDGE_IN_SUBMIT2D_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
#else
#endif
#endif
-
+
typedef struct PVRSRV_BRIDGE_IN_READREGDWORD_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
#else
IMG_PCHAR pszValue;
}PVRSRV_BRIDGE_IN_READREGDWORD;
-
+
typedef struct PVRSRV_BRIDGE_OUT_READREGDWORD_TAG
{
PVRSRV_ERROR eError;
typedef struct PVRSRV_BRIDGE_IN_SGXGETMISCINFO_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
#else
typedef struct PVRSRV_BRIDGE_IN_SGXINFO_FOR_SRVINIT_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
#else
typedef struct PVRSRV_BRIDGE_IN_SGXDEVINITPART2_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
#else
}PVRSRV_BRIDGE_OUT_SGXDEVINITPART2;
-
+
typedef struct PVRSRV_BRIDGE_IN_2DQUERYBLTSCOMPLETE_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
IMG_SID hKernSyncInfo;
typedef struct PVRSRV_BRIDGE_IN_SGXFINDSHAREDPBDESC_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
#else
typedef struct PVRSRV_BRIDGE_IN_SGXUNREFSHAREDPBDESC_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hSharedPBDesc;
#else
typedef struct PVRSRV_BRIDGE_IN_SGXADDSHAREDPBDESC_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
IMG_UINT32 ui32TotalPBSize;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
#ifdef PDUMP
typedef struct PVRSRV_BRIDGE_IN_PDUMP_BUFFER_ARRAY_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
SGX_KICKTA_DUMP_BUFFER *psBufferArray;
IMG_UINT32 ui32BufferArrayLength;
IMG_BOOL bDumpPolls;
typedef struct PVRSRV_BRIDGE_IN_PDUMP_3D_SIGNATURE_REGISTERS_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
IMG_SID hDevMemContext;
typedef struct PVRSRV_BRIDGE_IN_PDUMPCOUNTER_REGISTERS_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
#else
typedef struct PVRSRV_BRIDGE_IN_PDUMP_TA_SIGNATURE_REGISTERS_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
#else
typedef struct PVRSRV_BRIDGE_IN_PDUMP_HWPERFCB_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
IMG_SID hDevMemContext;
typedef struct PVRSRV_BRIDGE_IN_PDUMP_SAVEMEM
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
IMG_SID hDevMemContext;
typedef struct PVRSRV_BRIDGE_IN_SGX_REGISTER_HW_RENDER_CONTEXT_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
#else
typedef struct PVRSRV_BRIDGE_IN_SGX_UNREGISTER_HW_RENDER_CONTEXT_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
IMG_BOOL bForceCleanup;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
typedef struct PVRSRV_BRIDGE_IN_SGX_REGISTER_HW_TRANSFER_CONTEXT_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
#else
typedef struct PVRSRV_BRIDGE_IN_SGX_UNREGISTER_HW_TRANSFER_CONTEXT_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
IMG_BOOL bForceCleanup;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
typedef struct PVRSRV_BRIDGE_IN_SGX_FLUSH_HW_RENDER_TARGET_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
#else
IMG_DEV_VIRTADDR sHWRTDataSetDevVAddr;
}PVRSRV_BRIDGE_IN_SGX_FLUSH_HW_RENDER_TARGET;
-
+
#if defined(SGX_FEATURE_2D_HARDWARE)
typedef struct PVRSRV_BRIDGE_IN_SGX_REGISTER_HW_2D_CONTEXT_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
#else
typedef struct PVRSRV_BRIDGE_IN_SGX_UNREGISTER_HW_2D_CONTEXT_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
IMG_BOOL bForceCleanup;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
#endif
}PVRSRV_BRIDGE_IN_SGX_UNREGISTER_HW_2D_CONTEXT;
-#define SGX2D_MAX_BLT_CMD_SIZ 256
-#endif
+#define SGX2D_MAX_BLT_CMD_SIZ 256
+#endif
typedef struct PVRSRV_BRIDGE_IN_SGX_READ_HWPERF_CB_TAG
{
- IMG_UINT32 ui32BridgeFlags;
+ IMG_UINT32 ui32BridgeFlags;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hDevCookie;
#else
}
#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#define SGX_MP_MASTER_SELECT(x) (x + (SGX_REG_BANK_MASTER_INDEX * SGX_REG_BANK_SIZE))
#else
#define SGX_MP_CORE_SELECT(x,i) (x)
-#endif
+#endif
#endif
typedef struct _SGXMKIF_COMMAND_
{
- IMG_UINT32 ui32ServiceAddress;
- IMG_UINT32 ui32CacheControl;
- IMG_UINT32 ui32Data[6];
+ IMG_UINT32 ui32ServiceAddress;
+ IMG_UINT32 ui32CacheControl;
+ IMG_UINT32 ui32Data[6];
} SGXMKIF_COMMAND;
typedef struct _PVRSRV_SGX_KERNEL_CCB_
{
- SGXMKIF_COMMAND asCommands[256];
+ SGXMKIF_COMMAND asCommands[256];
} PVRSRV_SGX_KERNEL_CCB;
typedef struct _PVRSRV_SGX_CCB_CTL_
{
- IMG_UINT32 ui32WriteOffset;
- IMG_UINT32 ui32ReadOffset;
+ IMG_UINT32 ui32WriteOffset;
+ IMG_UINT32 ui32ReadOffset;
} PVRSRV_SGX_CCB_CTL;
IMG_UINT32 ui32Continue;
#endif
- volatile IMG_UINT32 ui32InitStatus;
- volatile IMG_UINT32 ui32PowerStatus;
- volatile IMG_UINT32 ui32CleanupStatus;
+ volatile IMG_UINT32 ui32InitStatus;
+ volatile IMG_UINT32 ui32PowerStatus;
+ volatile IMG_UINT32 ui32CleanupStatus;
#if defined(FIX_HW_BRN_28889)
- volatile IMG_UINT32 ui32InvalStatus;
+ volatile IMG_UINT32 ui32InvalStatus;
#endif
#if defined(SUPPORT_HW_RECOVERY)
- IMG_UINT32 ui32uKernelDetectedLockups;
- IMG_UINT32 ui32HostDetectedLockups;
- IMG_UINT32 ui32HWRecoverySampleRate;
-#endif
- IMG_UINT32 ui32uKernelTimerClock;
- IMG_UINT32 ui32ActivePowManSampleRate;
- IMG_UINT32 ui32InterruptFlags;
- IMG_UINT32 ui32InterruptClearFlags;
- IMG_UINT32 ui32BPSetClearSignal;
-
- IMG_UINT32 ui32NumActivePowerEvents;
-
- IMG_UINT32 ui32TimeWraps;
- IMG_UINT32 ui32HostClock;
- IMG_UINT32 ui32AssertFail;
+ IMG_UINT32 ui32uKernelDetectedLockups;
+ IMG_UINT32 ui32HostDetectedLockups;
+ IMG_UINT32 ui32HWRecoverySampleRate;
+#endif
+ IMG_UINT32 ui32uKernelTimerClock;
+ IMG_UINT32 ui32ActivePowManSampleRate;
+ IMG_UINT32 ui32InterruptFlags;
+ IMG_UINT32 ui32InterruptClearFlags;
+ IMG_UINT32 ui32BPSetClearSignal;
+
+ IMG_UINT32 ui32NumActivePowerEvents;
+
+ IMG_UINT32 ui32TimeWraps;
+ IMG_UINT32 ui32HostClock;
+ IMG_UINT32 ui32AssertFail;
#if defined(SGX_FEATURE_EXTENDED_PERF_COUNTERS)
- IMG_UINT32 aui32PerfGroup[PVRSRV_SGX_HWPERF_NUM_COUNTERS];
- IMG_UINT32 aui32PerfBit[PVRSRV_SGX_HWPERF_NUM_COUNTERS];
+ IMG_UINT32 aui32PerfGroup[PVRSRV_SGX_HWPERF_NUM_COUNTERS];
+ IMG_UINT32 aui32PerfBit[PVRSRV_SGX_HWPERF_NUM_COUNTERS];
#else
- IMG_UINT32 ui32PerfGroup;
-#endif
+ IMG_UINT32 ui32PerfGroup;
+#endif
#if defined(FIX_HW_BRN_31939)
IMG_UINT32 ui32BRN31939Mem;
#endif
- IMG_UINT32 ui32OpenCLDelayCount;
+ IMG_UINT32 ui32OpenCLDelayCount;
} SGXMKIF_HOST_CTL;
#define SGXMKIF_CMDTA_CTRLFLAGS_READY 0x00000001
typedef struct _SGXMKIF_CMDTA_SHARED_
{
IMG_UINT32 ui32CtrlFlags;
-
+
IMG_UINT32 ui32NumTAStatusVals;
IMG_UINT32 ui32Num3DStatusVals;
-
+
IMG_UINT32 ui32TATQSyncWriteOpsPendingVal;
IMG_DEV_VIRTADDR sTATQSyncWriteOpsCompleteDevVAddr;
IMG_UINT32 ui32TATQSyncReadOpsPendingVal;
IMG_DEV_VIRTADDR sTATQSyncReadOpsCompleteDevVAddr;
-
+
IMG_UINT32 ui323DTQSyncWriteOpsPendingVal;
IMG_DEV_VIRTADDR s3DTQSyncWriteOpsCompleteDevVAddr;
IMG_UINT32 ui323DTQSyncReadOpsPendingVal;
#if defined(SUPPORT_SGX_GENERALISED_SYNCOBJECTS)
-
+
IMG_UINT32 ui32NumTASrcSyncs;
PVRSRV_DEVICE_SYNC_OBJECT asTASrcSyncs[SGX_MAX_TA_SRC_SYNCS];
IMG_UINT32 ui32NumTADstSyncs;
IMG_UINT32 ui32Num3DSrcSyncs;
PVRSRV_DEVICE_SYNC_OBJECT as3DSrcSyncs[SGX_MAX_3D_SRC_SYNCS];
#else
-
+
IMG_UINT32 ui32NumSrcSyncs;
PVRSRV_DEVICE_SYNC_OBJECT asSrcSyncs[SGX_MAX_SRC_SYNCS];
#endif
-
+
PVRSRV_DEVICE_SYNC_OBJECT sTA3DDependency;
CTL_STATUS sCtlTAStatusInfo[SGX_MAX_TA_STATUS_VALS];
typedef struct _SGXMKIF_TRANSFERCMD_SHARED_
{
-
+
IMG_UINT32 ui32NumSrcSyncs;
PVRSRV_DEVICE_SYNC_OBJECT asSrcSyncs[SGX_MAX_SRC_SYNCS];
-
+
IMG_UINT32 ui32NumDstSyncs;
- PVRSRV_DEVICE_SYNC_OBJECT asDstSyncs[SGX_MAX_DST_SYNCS];
-
+ PVRSRV_DEVICE_SYNC_OBJECT asDstSyncs[SGX_MAX_DST_SYNCS];
+
IMG_UINT32 ui32TASyncWriteOpsPendingVal;
IMG_DEV_VIRTADDR sTASyncWriteOpsCompleteDevVAddr;
IMG_UINT32 ui32TASyncReadOpsPendingVal;
IMG_DEV_VIRTADDR sTASyncReadOpsCompleteDevVAddr;
-
+
IMG_UINT32 ui323DSyncWriteOpsPendingVal;
IMG_DEV_VIRTADDR s3DSyncWriteOpsCompleteDevVAddr;
IMG_UINT32 ui323DSyncReadOpsPendingVal;
#if defined(SGX_FEATURE_2D_HARDWARE)
typedef struct _SGXMKIF_2DCMD_SHARED_ {
-
+
IMG_UINT32 ui32NumSrcSync;
PVRSRV_DEVICE_SYNC_OBJECT sSrcSyncData[SGX_MAX_2D_SRC_SYNC_OPS];
-
+
PVRSRV_DEVICE_SYNC_OBJECT sDstSyncData;
-
+
PVRSRV_DEVICE_SYNC_OBJECT sTASyncData;
-
+
PVRSRV_DEVICE_SYNC_OBJECT s3DSyncData;
} SGXMKIF_2DCMD_SHARED, *PSGXMKIF_2DCMD_SHARED;
-#endif
+#endif
typedef struct _SGXMKIF_HWDEVICE_SYNC_LIST_
{
IMG_DEV_VIRTADDR sAccessDevAddr;
IMG_UINT32 ui32NumSyncObjects;
-
+
PVRSRV_DEVICE_SYNC_OBJECT asSyncData[1];
} SGXMKIF_HWDEVICE_SYNC_LIST, *PSGXMKIF_HWDEVICE_SYNC_LIST;
-#define PVRSRV_USSE_EDM_INIT_COMPLETE (1UL << 0)
+#define PVRSRV_USSE_EDM_INIT_COMPLETE (1UL << 0)
-#define PVRSRV_USSE_EDM_POWMAN_IDLE_COMPLETE (1UL << 2)
-#define PVRSRV_USSE_EDM_POWMAN_POWEROFF_COMPLETE (1UL << 3)
-#define PVRSRV_USSE_EDM_POWMAN_POWEROFF_RESTART_IMMEDIATE (1UL << 4)
-#define PVRSRV_USSE_EDM_POWMAN_NO_WORK (1UL << 5)
+#define PVRSRV_USSE_EDM_POWMAN_IDLE_COMPLETE (1UL << 2)
+#define PVRSRV_USSE_EDM_POWMAN_POWEROFF_COMPLETE (1UL << 3)
+#define PVRSRV_USSE_EDM_POWMAN_POWEROFF_RESTART_IMMEDIATE (1UL << 4)
+#define PVRSRV_USSE_EDM_POWMAN_NO_WORK (1UL << 5)
-#define PVRSRV_USSE_EDM_INTERRUPT_HWR (1UL << 0)
-#define PVRSRV_USSE_EDM_INTERRUPT_ACTIVE_POWER (1UL << 1)
+#define PVRSRV_USSE_EDM_INTERRUPT_HWR (1UL << 0)
+#define PVRSRV_USSE_EDM_INTERRUPT_ACTIVE_POWER (1UL << 1)
#define PVRSRV_USSE_EDM_INTERRUPT_IDLE (1UL << 2)
-#define PVRSRV_USSE_EDM_CLEANUPCMD_COMPLETE (1UL << 0)
+#define PVRSRV_USSE_EDM_CLEANUPCMD_COMPLETE (1UL << 0)
#if defined(FIX_HW_BRN_28889)
-#define PVRSRV_USSE_EDM_BIF_INVAL_COMPLETE (1UL << 0)
+#define PVRSRV_USSE_EDM_BIF_INVAL_COMPLETE (1UL << 0)
#endif
#define PVRSRV_USSE_MISCINFO_READY 0x1UL
-#define PVRSRV_USSE_MISCINFO_GET_STRUCT_SIZES 0x2UL
+#define PVRSRV_USSE_MISCINFO_GET_STRUCT_SIZES 0x2UL
#if defined(SUPPORT_SGX_EDM_MEMORY_DEBUG)
-#define PVRSRV_USSE_MISCINFO_MEMREAD 0x4UL
-#define PVRSRV_USSE_MISCINFO_MEMWRITE 0x8UL
+#define PVRSRV_USSE_MISCINFO_MEMREAD 0x4UL
+#define PVRSRV_USSE_MISCINFO_MEMWRITE 0x8UL
#if !defined(SGX_FEATURE_MULTIPLE_MEM_CONTEXTS)
-#define PVRSRV_USSE_MISCINFO_MEMREAD_FAIL 0x1UL << 31
+#define PVRSRV_USSE_MISCINFO_MEMREAD_FAIL 0x1UL << 31
#endif
#endif
#if defined(SUPPORT_SGX_EDM_MEMORY_DEBUG)
typedef struct _PVRSRV_SGX_MISCINFO_MEMACCESS
{
- IMG_DEV_VIRTADDR sDevVAddr;
- IMG_DEV_PHYADDR sPDDevPAddr;
+ IMG_DEV_VIRTADDR sDevVAddr;
+ IMG_DEV_PHYADDR sPDDevPAddr;
} PVRSRV_SGX_MISCINFO_MEMACCESS;
#endif
typedef struct _PVRSRV_SGX_MISCINFO_INFO
{
IMG_UINT32 ui32MiscInfoFlags;
- PVRSRV_SGX_MISCINFO_FEATURES sSGXFeatures;
- SGX_MISCINFO_STRUCT_SIZES sSGXStructSizes;
+ PVRSRV_SGX_MISCINFO_FEATURES sSGXFeatures;
+ SGX_MISCINFO_STRUCT_SIZES sSGXStructSizes;
#if defined(SUPPORT_SGX_EDM_MEMORY_DEBUG)
- PVRSRV_SGX_MISCINFO_MEMACCESS sSGXMemAccessSrc;
- PVRSRV_SGX_MISCINFO_MEMACCESS sSGXMemAccessDest;
+ PVRSRV_SGX_MISCINFO_MEMACCESS sSGXMemAccessSrc;
+ PVRSRV_SGX_MISCINFO_MEMACCESS sSGXMemAccessDest;
#endif
} PVRSRV_SGX_MISCINFO_INFO;
#ifdef PVRSRV_USSE_EDM_STATUS_DEBUG
#define SGXMK_TRACE_BUFFER_SIZE 512
-#endif
+#endif
-#define SGXMKIF_HWPERF_CB_SIZE 0x100
+#define SGXMKIF_HWPERF_CB_SIZE 0x100
typedef struct _SGXMKIF_HWPERF_CB_ENTRY_
{
IMG_UINT32 ui32Info;
IMG_UINT32 ui32TimeWraps;
IMG_UINT32 ui32Time;
-
+
IMG_UINT32 ui32Counters[SGX_FEATURE_MP_CORE_COUNT_3D][PVRSRV_SGX_HWPERF_NUM_COUNTERS];
IMG_UINT32 ui32MiscCounters[SGX_FEATURE_MP_CORE_COUNT_3D][PVRSRV_SGX_HWPERF_NUM_MISC_COUNTERS];
} SGXMKIF_HWPERF_CB_ENTRY;
} SGXMKIF_HWPERF_CB;
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
IMG_UINT32 ui32MasterClkGateStatusMask;
IMG_UINT32 ui32MasterClkGateStatus2Reg;
IMG_UINT32 ui32MasterClkGateStatus2Mask;
-#endif
+#endif
IMG_UINT32 ui32CacheControl;
struct _SGX_DEVICE_SYNC_LIST_ *psNext;
-
+
IMG_UINT32 ui32NumSyncObjects;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID ahSyncHandles[1];
IMG_HANDLE hKernelHWSyncListMemInfo;
#endif
-
+
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID *pahDstSyncHandles;
#else
#endif
IMG_BOOL bLastInScene;
-
+
IMG_UINT32 ui32CCBOffset;
#if defined(SUPPORT_SGX_GENERALISED_SYNCOBJECTS)
-
+
IMG_UINT32 ui32NumTASrcSyncs;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID ahTASrcKernelSyncInfo[SGX_MAX_TA_SRC_SYNCS];
IMG_HANDLE ah3DSrcKernelSyncInfo[SGX_MAX_3D_SRC_SYNCS];
#endif
#else
-
+
IMG_UINT32 ui32NumSrcSyncs;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID ahSrcKernelSyncInfo[SGX_MAX_SRC_SYNCS];
#endif
#endif
-
+
IMG_BOOL bTADependency;
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hTA3DSyncInfo;
typedef struct _SGX_CLIENT_INFO_
{
- IMG_UINT32 ui32ProcessID;
- IMG_VOID *pvProcess;
- PVRSRV_MISC_INFO sMiscInfo;
+ IMG_UINT32 ui32ProcessID;
+ IMG_VOID *pvProcess;
+ PVRSRV_MISC_INFO sMiscInfo;
IMG_UINT32 asDevData[SGX_MAX_DEV_DATA];
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID ahSrcSyncInfo[SGX_MAX_2D_SRC_SYNC_OPS];
-
+
IMG_SID hDstSyncInfo;
-
+
IMG_SID hTASyncInfo;
-
+
IMG_SID h3DSyncInfo;
#else
IMG_HANDLE ahSrcSyncInfo[SGX_MAX_2D_SRC_SYNC_OPS];
-
+
IMG_HANDLE hDstSyncInfo;
-
+
IMG_HANDLE hTASyncInfo;
-
+
IMG_HANDLE h3DSyncInfo;
#endif
#endif
IMG_HANDLE hDevMemContext;
} PVRSRV_2D_SGX_KICK, *PPVRSRV_2D_SGX_KICK;
-#endif
-#endif
+#endif
+#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
return 0;
}
-
+
psAcquireDevInfoOUT->eError =
PVRSRVAllocHandle(psPerProc->psHandleBase,
&psAcquireDevInfoOUT->hDevCookie,
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_CREATE_DEVMEMCONTEXT);
-
+
NEW_HANDLE_BATCH_OR_ERROR(psCreateDevMemContextOUT->eError, psPerProc, PVRSRV_MAX_CLIENT_HEAPS + 1)
psCreateDevMemContextOUT->eError =
return 0;
}
-
+
if(bCreated)
{
PVRSRVAllocHandleNR(psPerProc->psHandleBase,
if(abSharedDeviceMemHeap[i])
#endif
{
-
+
#if defined (SUPPORT_SID_INTERFACE)
PVRSRVAllocHandleNR(psPerProc->psHandleBase,
&hDevMemHeapExt,
#if defined(PVR_SECURE_HANDLES) || defined (SUPPORT_SID_INTERFACE)
else
{
-
+
if(bCreated)
{
#if defined (SUPPORT_SID_INTERFACE)
if(abSharedDeviceMemHeap[i])
#endif
{
-
+
#if defined (SUPPORT_SID_INTERFACE)
PVRSRVAllocHandleNR(psPerProc->psHandleBase,
&hDevMemHeapExt,
#if defined(PVR_SECURE_HANDLES) || defined (SUPPORT_SID_INTERFACE)
else
{
-
+
psGetDevMemHeapInfoOUT->eError =
PVRSRVFindHandle(psPerProc->psHandleBase,
&hDevMemHeapExt,
return 0;
}
-
+
bUseShareMemWorkaround = ((psAllocDeviceMemIN->ui32Attribs & PVRSRV_MEM_XPROC) != 0) ? IMG_TRUE : IMG_FALSE;
- ui32ShareIndex = 7654321;
+ ui32ShareIndex = 7654321;
if (bUseShareMemWorkaround)
{
-
-
+
+
psAllocDeviceMemOUT->eError =
BM_XProcWorkaroundFindNewBufferAndSetShareIndex(&ui32ShareIndex);
}
}
-
+
if(psAllocDeviceMemIN->pvPrivData)
{
if(!OSAccessOK(PVR_VERIFY_READ,
psAllocDeviceMemOUT->sClientMemInfo.ui32Flags = psMemInfo->ui32Flags;
psAllocDeviceMemOUT->sClientMemInfo.uAllocSize = psMemInfo->uAllocSize;
#if defined (SUPPORT_SID_INTERFACE)
-
+
#else
psAllocDeviceMemOUT->sClientMemInfo.hMappingInfo = psMemInfo->sMemBlk.hOSMemHandle;
#endif
if(psAllocDeviceMemIN->ui32Attribs & PVRSRV_MEM_NO_SYNCOBJ)
{
-
+
OSMemSet(&psAllocDeviceMemOUT->sClientSyncInfo,
0,
sizeof (PVRSRV_CLIENT_SYNC_INFO));
}
else
{
-
+
#if !defined(PVRSRV_DISABLE_UM_SYNCOBJ_MAPPINGS)
psAllocDeviceMemOUT->sClientSyncInfo.psSyncData =
return 0;
}
-#endif
+#endif
static IMG_INT
PVRSRVFreeDeviceMemBW(IMG_UINT32 ui32BridgeID,
ui32BridgeID == PVRSRV_GET_BRIDGE_ID(PVRSRV_BRIDGE_EXPORT_DEVICEMEM_2));
PVR_UNREFERENCED_PARAMETER(ui32BridgeID);
-
+
psExportDeviceMemOUT->eError =
PVRSRVLookupHandle(psPerProc->psHandleBase,
&hDevCookieInt,
return 0;
}
-
+
psExportDeviceMemOUT->eError =
PVRSRVLookupHandle(psPerProc->psHandleBase,
(IMG_PVOID *)&psKernelMemInfo,
return 0;
}
-
+
psExportDeviceMemOUT->eError =
PVRSRVFindHandle(KERNEL_HANDLE_BASE,
&psExportDeviceMemOUT->hMemInfo,
PVRSRV_HANDLE_TYPE_MEM_INFO);
if(psExportDeviceMemOUT->eError == PVRSRV_OK)
{
-
+
PVR_DPF((PVR_DBG_MESSAGE, "PVRSRVExportDeviceMemBW: allocation is already exported"));
return 0;
}
-
+
psExportDeviceMemOUT->eError = PVRSRVAllocHandle(KERNEL_HANDLE_BASE,
&psExportDeviceMemOUT->hMemInfo,
psKernelMemInfo,
return 0;
}
-
+
psKernelMemInfo->ui32Flags |= PVRSRV_MEM_EXPORTED;
return 0;
NEW_HANDLE_BATCH_OR_ERROR(psMapDevMemOUT->eError, psPerProc, 2)
-
+
psMapDevMemOUT->eError = PVRSRVLookupHandle(KERNEL_HANDLE_BASE,
(IMG_VOID**)&psSrcKernelMemInfo,
psMapDevMemIN->hKernelMemInfo,
return 0;
}
-
+
psMapDevMemOUT->eError = PVRSRVLookupHandle(psPerProc->psHandleBase,
&hDstDevMemHeap,
psMapDevMemIN->hDstDevMemHeap,
return 0;
}
-
+
if (psSrcKernelMemInfo->sShareMemWorkaround.bInUse)
{
PVR_DPF((PVR_DBG_MESSAGE, "using the mem wrap workaround."));
psSrcKernelMemInfo->sShareMemWorkaround.ui32OrigReqAttribs |=
psMapDevMemIN->ui32BridgeFlags;
-
+
psMapDevMemOUT->eError = BM_XProcWorkaroundSetShareIndex(psSrcKernelMemInfo->sShareMemWorkaround.ui32ShareIndex);
if(psMapDevMemOUT->eError != PVRSRV_OK)
{
0,
&psDstKernelMemInfo,
"" );
-
+
BM_XProcWorkaroundUnsetShareIndex(psSrcKernelMemInfo->sShareMemWorkaround.ui32ShareIndex);
if(psMapDevMemOUT->eError != PVRSRV_OK)
}
else
{
-
+
psMapDevMemOUT->eError = PVRSRVMapDeviceMemoryKM(psPerProc,
psSrcKernelMemInfo,
hDstDevMemHeap,
}
}
-
+
psDstKernelMemInfo->sShareMemWorkaround = psSrcKernelMemInfo->sShareMemWorkaround;
OSMemSet(&psMapDevMemOUT->sDstClientMemInfo,
psMapDevMemOUT->sDstClientMemInfo.ui32Flags = psDstKernelMemInfo->ui32Flags;
psMapDevMemOUT->sDstClientMemInfo.uAllocSize = psDstKernelMemInfo->uAllocSize;
#if defined (SUPPORT_SID_INTERFACE)
-
+
#else
psMapDevMemOUT->sDstClientMemInfo.hMappingInfo = psDstKernelMemInfo->sMemBlk.hOSMemHandle;
#endif
-
+
PVRSRVAllocHandleNR(psPerProc->psHandleBase,
&psMapDevMemOUT->sDstClientMemInfo.hKernelMemInfo,
psDstKernelMemInfo,
psMapDevMemOUT->sDstClientSyncInfo.hKernelSyncInfo = IMG_NULL;
#if defined (SUPPORT_SID_INTERFACE)
-
+
if (psDstKernelMemInfo->sMemBlk.hOSMemHandle != IMG_NULL)
{
PVRSRVAllocSubHandleNR(psPerProc->psHandleBase,
}
#endif
-
+
if(psDstKernelMemInfo->psKernelSyncInfo)
{
#if !defined(PVRSRV_DISABLE_UM_SYNCOBJ_MAPPINGS)
psDstKernelMemInfo->psKernelSyncInfo->sReadOps2CompleteDevVAddr;
#if defined (SUPPORT_SID_INTERFACE)
-
+
if (psDstKernelMemInfo->psKernelSyncInfo->psSyncDataMemInfoKM->sMemBlk.hOSMemHandle != IMG_NULL)
{
PVRSRVAllocSubHandleNR(psPerProc->psHandleBase,
#endif
psMapDevMemOUT->sDstClientMemInfo.psClientSyncInfo = &psMapDevMemOUT->sDstClientSyncInfo;
-
+
PVRSRVAllocSubHandleNR(psPerProc->psHandleBase,
&psMapDevMemOUT->sDstClientSyncInfo.hKernelSyncInfo,
psDstKernelMemInfo->psKernelSyncInfo,
NEW_HANDLE_BATCH_OR_ERROR(psMapDevClassMemOUT->eError, psPerProc, 2)
-
+
psMapDevClassMemOUT->eError =
PVRSRVLookupHandleAnyType(psPerProc->psHandleBase,
&hDeviceClassBufferInt,
return 0;
}
-
+
psMapDevClassMemOUT->eError =
PVRSRVLookupHandle(psPerProc->psHandleBase,
&hDevMemContextInt,
return 0;
}
-
+
switch(eHandleType)
{
#if defined(PVR_SECURE_HANDLES) || defined (SUPPORT_SID_INTERFACE)
psMapDevClassMemOUT->sClientSyncInfo.hKernelSyncInfo = IMG_NULL;
-
+
if(psMemInfo->psKernelSyncInfo)
{
#if !defined(PVRSRV_DISABLE_UM_SYNCOBJ_MAPPINGS)
#endif
psMapDevClassMemOUT->sClientMemInfo.psClientSyncInfo = &psMapDevClassMemOUT->sClientSyncInfo;
-
+
PVRSRVAllocSubHandleNR(psPerProc->psHandleBase,
&psMapDevClassMemOUT->sClientSyncInfo.hKernelSyncInfo,
psMemInfo->psKernelSyncInfo,
PVRSRV_BRIDGE_IN_WRAP_EXT_MEMORY *psWrapExtMemIN,
PVRSRV_BRIDGE_OUT_WRAP_EXT_MEMORY *psWrapExtMemOUT,
PVRSRV_PER_PROCESS_DATA *psPerProc);
-#else
+#else
static IMG_INT
PVRSRVWrapExtMemoryBW(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_WRAP_EXT_MEMORY *psWrapExtMemIN,
NEW_HANDLE_BATCH_OR_ERROR(psWrapExtMemOUT->eError, psPerProc, 2)
-
+
psWrapExtMemOUT->eError =
PVRSRVLookupHandle(psPerProc->psHandleBase, &hDevCookieInt,
psWrapExtMemIN->hDevCookie,
return 0;
}
-
+
psWrapExtMemOUT->eError =
PVRSRVLookupHandle(psPerProc->psHandleBase, &hDevMemContextInt,
psWrapExtMemIN->hDevMemContext,
ui32PageTableSize) != PVRSRV_OK)
{
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, ui32PageTableSize, (IMG_VOID *)psSysPAddr, 0);
-
+
return -EFAULT;
}
}
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP,
ui32PageTableSize,
(IMG_VOID *)psSysPAddr, 0);
-
+
}
if(psWrapExtMemOUT->eError != PVRSRV_OK)
psWrapExtMemOUT->sClientMemInfo.pvLinAddrKM =
psMemInfo->pvLinAddrKM;
-
+
psWrapExtMemOUT->sClientMemInfo.pvLinAddr = 0;
psWrapExtMemOUT->sClientMemInfo.sDevVAddr = psMemInfo->sDevVAddr;
psWrapExtMemOUT->sClientMemInfo.ui32Flags = psMemInfo->ui32Flags;
PVRSRV_HANDLE_ALLOC_FLAG_NONE);
#if defined (SUPPORT_SID_INTERFACE)
-
+
if (psMemInfo->sMemBlk.hOSMemHandle != IMG_NULL)
{
PVRSRVAllocSubHandleNR(psPerProc->psHandleBase,
}
#endif
-
+
#if !defined(PVRSRV_DISABLE_UM_SYNCOBJ_MAPPINGS)
psWrapExtMemOUT->sClientSyncInfo.psSyncData =
psMemInfo->psKernelSyncInfo->psSyncData;
psMemInfo->psKernelSyncInfo->sReadOps2CompleteDevVAddr;
#if defined (SUPPORT_SID_INTERFACE)
-
+
if (psMemInfo->psKernelSyncInfo->psSyncDataMemInfoKM->sMemBlk.hOSMemHandle != IMG_NULL)
{
PVRSRVAllocSubHandleNR(psPerProc->psHandleBase,
return 0;
}
-#endif
+#endif
static IMG_INT
PVRSRVUnwrapExtMemoryBW(IMG_UINT32 ui32BridgeID,
ui32Offset = offsetof(PVRSRV_SYNC_DATA, ui32WriteOpsComplete);
}
-
+
if (psPDumpSyncPolIN->bUseLastOpDumpVal)
{
if(psPDumpSyncPolIN->bIsRead)
return 0;
}
-#endif
+#endif
static IMG_INT
((psGetMiscInfoIN->sMiscInfo.ui32StateRequest & PVRSRV_MISC_INFO_DDKVERSION_PRESENT) != 0) &&
((psGetMiscInfoIN->sMiscInfo.ui32StateRequest & PVRSRV_MISC_INFO_FREEMEM_PRESENT) != 0))
{
-
+
psGetMiscInfoOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
return 0;
}
((psGetMiscInfoIN->sMiscInfo.ui32StateRequest & PVRSRV_MISC_INFO_DDKVERSION_PRESENT) != 0) ||
((psGetMiscInfoIN->sMiscInfo.ui32StateRequest & PVRSRV_MISC_INFO_FREEMEM_PRESENT) != 0))
{
-
+
#if defined (SUPPORT_SID_INTERFACE)
ASSIGN_AND_EXIT_ON_ERROR(psGetMiscInfoOUT->eError,
OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
"Output string buffer"));
psGetMiscInfoOUT->eError = PVRSRVGetMiscInfoKM(&sMiscInfo);
-
+
eError = CopyToUserWrapper(psPerProc, ui32BridgeID,
psGetMiscInfoIN->sMiscInfo.pszMemoryStr,
sMiscInfo.pszMemoryStr,
psGetMiscInfoOUT->eError = PVRSRVGetMiscInfoKM(&psGetMiscInfoOUT->sMiscInfo);
-
+
eError = CopyToUserWrapper(psPerProc, ui32BridgeID,
psGetMiscInfoIN->sMiscInfo.pszMemoryStr,
psGetMiscInfoOUT->sMiscInfo.pszMemoryStr,
psGetMiscInfoOUT->sMiscInfo.ui32MemoryStrLen);
#endif
-
+
#if defined (SUPPORT_SID_INTERFACE)
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP,
sMiscInfo.ui32MemoryStrLen,
(IMG_VOID *)psGetMiscInfoOUT->sMiscInfo.pszMemoryStr, 0);
#endif
-
+
psGetMiscInfoOUT->sMiscInfo.pszMemoryStr = psGetMiscInfoIN->sMiscInfo.pszMemoryStr;
if(eError != PVRSRV_OK)
{
-
+
PVR_DPF((PVR_DBG_ERROR, "PVRSRVGetMiscInfoBW Error copy to user"));
return -EFAULT;
}
#endif
}
-
+
if (psGetMiscInfoOUT->eError != PVRSRV_OK)
{
return 0;
}
-
+
#if defined (SUPPORT_SID_INTERFACE)
if (sMiscInfo.ui32StateRequest & PVRSRV_MISC_INFO_GLOBALEVENTOBJECT_PRESENT)
#else
if (psGetMiscInfoOUT->sMiscInfo.hSOCTimerRegisterOSMemHandle)
#endif
{
-
+
psGetMiscInfoOUT->eError = PVRSRVAllocHandle(psPerProc->psHandleBase,
&psGetMiscInfoOUT->sMiscInfo.hSOCTimerRegisterOSMemHandle,
#if defined (SUPPORT_SID_INTERFACE)
psGetMiscInfoOUT->sMiscInfo.hSOCTimerRegisterOSMemHandle = 0;
}
-
+
psGetMiscInfoOUT->sMiscInfo.ui32StateRequest = sMiscInfo.ui32StateRequest;
psGetMiscInfoOUT->sMiscInfo.ui32StatePresent = sMiscInfo.ui32StatePresent;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_CONNECT_SERVICES);
#if defined(PDUMP)
-
+
if ((psConnectServicesIN->ui32Flags & SRV_FLAGS_PERSIST) != 0)
{
psPerProc->bPDumpPersistent = IMG_TRUE;
}
#if defined(SUPPORT_PDUMP_MULTI_PROCESS)
-
+
if ((psConnectServicesIN->ui32Flags & SRV_FLAGS_PDUMP_ACTIVE) != 0)
{
psPerProc->bPDumpActive = IMG_TRUE;
}
-#endif
+#endif
#else
PVR_UNREFERENCED_PARAMETER(psConnectServicesIN);
#endif
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DISCONNECT_SERVICES);
-
+
psRetOUT->eError = PVRSRV_OK;
return 0;
#if defined(SUPPORT_PVRSRV_GET_DC_SYSTEM_BUFFER)
static IMG_INT
PVRSRVGetDCSystemBufferBW(IMG_UINT32 ui32BridgeID,
- PVRSRV_BRIDGE_IN_GET_DISPCLASS_SYSBUFFER *psGetDispClassSysBufferIN,
+ PVRSRV_BRIDGE_IN_GET_DISPCLASS_SYSBUFFER *psGetDispClassSysBufferIN,
PVRSRV_BRIDGE_OUT_GET_DISPCLASS_SYSBUFFER *psGetDispClassSysBufferOUT,
PVRSRV_PER_PROCESS_DATA *psPerProc)
{
return 0;
}
-
+
PVRSRVAllocSubHandleNR(psPerProc->psHandleBase,
&psGetDispClassSysBufferOUT->hBuffer,
hBufferInt,
return 0;
}
-
+
ui32SwapChainID = psCreateDispClassSwapChainIN->ui32SwapChainID;
psCreateDispClassSwapChainOUT->eError =
return 0;
}
-
+
psCreateDispClassSwapChainOUT->ui32SwapChainID = ui32SwapChainID;
PVRSRVAllocSubHandleNR(psPerProc->psHandleBase,
IMG_HANDLE hBufferExt;
#endif
-
+
#if defined (SUPPORT_SID_INTERFACE)
PVRSRVAllocSubHandleNR(psPerProc->psHandleBase,
&hBufferExt,
return 0;
}
-
+
PVRSRVAllocSubHandleNR(psPerProc->psHandleBase,
&psGetBufferClassBufferOUT->hBuffer,
hBufferInt,
return 0;
}
-
+
psMapMemInfoMemOUT->eError =
PVRSRVGetParentHandle(psPerProc->psHandleBase,
&hParent,
if(psKernelMemInfo->ui32Flags & PVRSRV_MEM_NO_SYNCOBJ)
{
-
+
OSMemSet(&psMapMemInfoMemOUT->sClientSyncInfo,
0,
sizeof (PVRSRV_CLIENT_SYNC_INFO));
}
else
{
-
+
#if !defined(PVRSRV_DISABLE_UM_SYNCOBJ_MAPPINGS)
psMapMemInfoMemOUT->sClientSyncInfo.psSyncData =
psKernelMemInfo->psKernelSyncInfo->psSyncData;
BridgeWrapperFunction pfFunction,
const IMG_CHAR *pszFunctionName)
{
- static IMG_UINT32 ui32PrevIndex = ~0UL;
+ static IMG_UINT32 ui32PrevIndex = ~0UL;
#if !defined(DEBUG)
PVR_UNREFERENCED_PARAMETER(pszIOCName);
#endif
#endif
#if defined(DEBUG_BRIDGE_KM_DISPATCH_TABLE)
-
+
PVR_DPF((PVR_DBG_WARNING, "%s: %d %s %s", __FUNCTION__, ui32Index, pszIOCName, pszFunctionName));
#endif
-
+
if (ui32Index >= BRIDGE_DISPATCH_TABLE_ENTRY_COUNT) {
PVR_DPF((PVR_DBG_ERROR, "Invalid parameters."));
return;
PVR_DPF((PVR_DBG_ERROR, "NOTE: Enabling DEBUG_BRIDGE_KM_DISPATCH_TABLE may help debug this issue."));
}
-
+
if((ui32PrevIndex != ~0UL) &&
((ui32Index >= ui32PrevIndex + DISPATCH_TABLE_GAP_THRESHOLD) ||
(ui32Index <= ui32PrevIndex)))
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_INITSRV_CONNECT);
PVR_UNREFERENCED_PARAMETER(psBridgeIn);
-
+
if((OSProcHasPrivSrvInit() == IMG_FALSE) || PVRSRVGetInitServerState(PVRSRV_INIT_SERVER_RUNNING) || PVRSRVGetInitServerState(PVRSRV_INIT_SERVER_RAN))
{
psRetOUT->eError = PVRSRV_ERROR_SRV_CONNECT_FAILED;
&psEventObjectCloseIN->sEventObject.szName,
EVENTOBJNAME_MAXLENGTH) != PVRSRV_OK)
{
-
+
return -EFAULT;
}
IMG_UINT32 ui32ReadOpsPending;
IMG_UINT32 ui32ReadOps2Pending;
-
+
if (!psKernelSyncInfo)
{
return PVRSRV_ERROR_INVALID_PARAMS;
}
-
+
ui32ReadOps2Pending - psKernelSyncInfo->psSyncData->ui32ReadOps2Complete))
{
#if defined(PDUMP) && !defined(SUPPORT_VGX)
-
+
PDumpComment("Poll for read ops complete to reach value (pdump: %u, actual snapshot: %u)",
psKernelSyncInfo->psSyncData->ui32LastReadOpDumpVal,
ui32ReadOpsPendingSnapShot);
offsetof(PVRSRV_SYNC_DATA, ui32ReadOpsComplete),
psKernelSyncInfo->psSyncData->ui32LastReadOpDumpVal,
0xFFFFFFFF,
- PDUMP_POLL_OPERATOR_EQUAL,
+ PDUMP_POLL_OPERATOR_EQUAL,
0,
MAKEUNIQUETAG(psKernelSyncInfo->psSyncDataMemInfoKM));
-
+
PDumpComment("Poll for write ops complete to reach value (pdump: %u, actual snapshot: %u)",
psKernelSyncInfo->psSyncData->ui32LastOpDumpVal,
ui32WriteOpsPendingSnapShot);
offsetof(PVRSRV_SYNC_DATA, ui32WriteOpsComplete),
psKernelSyncInfo->psSyncData->ui32LastOpDumpVal,
0xFFFFFFFF,
- PDUMP_POLL_OPERATOR_EQUAL,
+ PDUMP_POLL_OPERATOR_EQUAL,
0,
MAKEUNIQUETAG(psKernelSyncInfo->psSyncDataMemInfoKM));
-
+
#endif
return PVRSRV_OK;
return PVRSRV_ERROR_INVALID_PARAMS;
}
-
+
if((psModSyncOpInfo->ui32WriteOpsPendingSnapShot != psKernelSyncInfo->psSyncData->ui32WriteOpsComplete)
|| (psModSyncOpInfo->ui32ReadOpsPendingSnapShot != psKernelSyncInfo->psSyncData->ui32ReadOpsComplete))
{
return PVRSRV_ERROR_BAD_SYNC_STATE;
}
-
+
if(psModSyncOpInfo->ui32ModifyFlags & PVRSRV_MODIFYSYNCOPS_FLAGS_WO_INC)
{
psKernelSyncInfo->psSyncData->ui32WriteOpsComplete++;
}
-
+
if(psModSyncOpInfo->ui32ModifyFlags & PVRSRV_MODIFYSYNCOPS_FLAGS_RO_INC)
{
psKernelSyncInfo->psSyncData->ui32ReadOpsComplete++;
if (psModSyncOpInfo->psKernelSyncInfo)
{
-
+
LOOP_UNTIL_TIMEOUT(MAX_HW_TIME_US)
{
if (DoQuerySyncOpsSatisfied(psModSyncOpInfo->psKernelSyncInfo,
}
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(MODIFY_SYNC_OP_INFO), (IMG_VOID *)psModSyncOpInfo, 0);
+
-
-
+
PVRSRVScheduleDeviceCallbacks();
return PVRSRV_OK;
(IMG_VOID **)&psModSyncOpInfo, 0,
"ModSyncOpInfo (MODIFY_SYNC_OP_INFO)"));
- psModSyncOpInfo->psKernelSyncInfo = IMG_NULL;
+ psModSyncOpInfo->psKernelSyncInfo = IMG_NULL;
psCreateSyncInfoModObjOUT->eError = PVRSRVAllocHandle(psPerProc->psHandleBase,
&psCreateSyncInfoModObjOUT->hKernelSyncInfoModObj,
if(psModSyncOpInfo->psKernelSyncInfo != IMG_NULL)
{
-
+
psDestroySyncInfoModObjOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
return 0;
}
if(psModSyncOpInfo->psKernelSyncInfo)
{
-
+
psModifySyncOpsOUT->eError = PVRSRV_ERROR_RETRY;
PVR_DPF((PVR_DBG_VERBOSE, "PVRSRVModifyPendingSyncOpsBW: SyncInfo Modification object is not empty"));
return 0;
}
-
+
psModSyncOpInfo->psKernelSyncInfo = psKernelSyncInfo;
psModSyncOpInfo->ui32ModifyFlags = psModifySyncOpsIN->ui32ModifyFlags;
psModSyncOpInfo->ui32ReadOpsPendingSnapShot = psKernelSyncInfo->psSyncData->ui32ReadOpsPending;
psModSyncOpInfo->ui32WriteOpsPendingSnapShot = psKernelSyncInfo->psSyncData->ui32WriteOpsPending;
psModSyncOpInfo->ui32ReadOps2PendingSnapShot = psKernelSyncInfo->psSyncData->ui32ReadOps2Pending;
-
+
psModifySyncOpsOUT->ui32ReadOpsPending = psKernelSyncInfo->psSyncData->ui32ReadOpsPending;
psModifySyncOpsOUT->ui32WriteOpsPending = psKernelSyncInfo->psSyncData->ui32WriteOpsPending;
psKernelSyncInfo->psSyncData->ui32ReadOpsPending++;
}
-
+
psModifySyncOpsOUT->eError = ResManDissociateRes(psModSyncOpInfo->hResItem,
psPerProc->hResManContext);
if(psModSyncOpInfo->psKernelSyncInfo == IMG_NULL)
{
-
+
psModifySyncOpsOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
return 0;
}
psModSyncOpInfo->psKernelSyncInfo = IMG_NULL;
-
+
PVRSRVScheduleDeviceCallbacks();
return 0;
return 0;
}
-
+
psSyncOpsTakeTokenOUT->ui32ReadOpsPending = psKernelSyncInfo->psSyncData->ui32ReadOpsPending;
psSyncOpsTakeTokenOUT->ui32WriteOpsPending = psKernelSyncInfo->psSyncData->ui32WriteOpsPending;
if(psModSyncOpInfo->psKernelSyncInfo == IMG_NULL)
{
-
+
psSyncOpsFlushToModObjOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
return 0;
}
return 0;
}
-
+
ui32DeltaRead = psSyncInfo->psSyncData->ui32ReadOpsPending - psSyncInfo->psSyncData->ui32ReadOpsComplete;
ui32DeltaWrite = psSyncInfo->psSyncData->ui32WriteOpsPending - psSyncInfo->psSyncData->ui32WriteOpsComplete;
if (ui32DeltaRead <= psSyncOpsFlushToDeltaIN->ui32Delta && ui32DeltaWrite <= psSyncOpsFlushToDeltaIN->ui32Delta)
{
#if defined(PDUMP) && !defined(SUPPORT_VGX)
-
+
PDumpComment("Poll for read ops complete to delta (%u)",
psSyncOpsFlushToDeltaIN->ui32Delta);
psSyncOpsFlushToDeltaOUT->eError =
0,
MAKEUNIQUETAG(psSyncInfo->psSyncDataMemInfoKM));
-
+
PDumpComment("Poll for write ops complete to delta (%u)",
psSyncOpsFlushToDeltaIN->ui32Delta);
psSyncOpsFlushToDeltaOUT->eError =
0,
FreeSyncInfoCallback);
-
+
goto allocsyncinfo_commit;
-
+
allocsyncinfo_errorexit_freesyncinfo:
PVRSRVFreeSyncInfoKM(psSyncInfo);
allocsyncinfo_errorexit:
-
+
allocsyncinfo_commit:
psAllocSyncInfoOUT->eError = eError;
COMMIT_HANDLE_BATCH_OR_ERROR(eError, psPerProc);
SetDispatchTableEntry(PVRSRV_BRIDGE_MAP_DEV_MEMORY_2, PVRSRVMapDeviceMemoryBW);
SetDispatchTableEntry(PVRSRV_BRIDGE_EXPORT_DEVICEMEM_2, PVRSRVExportDeviceMemBW);
-
+
SetDispatchTableEntry(PVRSRV_BRIDGE_PROCESS_SIMISR_EVENT, DummyBW);
SetDispatchTableEntry(PVRSRV_BRIDGE_REGISTER_SIM_PROCESS, DummyBW);
SetDispatchTableEntry(PVRSRV_BRIDGE_UNREGISTER_SIM_PROCESS, DummyBW);
-
+
SetDispatchTableEntry(PVRSRV_BRIDGE_MAPPHYSTOUSERSPACE, DummyBW);
SetDispatchTableEntry(PVRSRV_BRIDGE_UNMAPPHYSTOUSERSPACE, DummyBW);
SetDispatchTableEntry(PVRSRV_BRIDGE_GETPHYSTOUSERSPACEMAP, DummyBW);
SetDispatchTableEntry(PVRSRV_BRIDGE_GET_FB_STATS, DummyBW);
-
+
SetDispatchTableEntry(PVRSRV_BRIDGE_GET_MISC_INFO, PVRSRVGetMiscInfoBW);
SetDispatchTableEntry(PVRSRV_BRIDGE_RELEASE_MISC_INFO, DummyBW);
-
+
#if defined (SUPPORT_OVERLAY_ROTATE_BLIT)
SetDispatchTableEntry(PVRSRV_BRIDGE_INIT_3D_OVL_BLT_RES, DummyBW);
SetDispatchTableEntry(PVRSRV_BRIDGE_DEINIT_3D_OVL_BLT_RES, DummyBW);
#endif
-
+
#if defined(PDUMP)
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_INIT, DummyBW);
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_MEMPOL, PDumpMemPolBW);
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_CYCLE_COUNT_REG_READ, PDumpCycleCountRegReadBW);
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_STARTINITPHASE, PDumpStartInitPhaseBW);
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_STOPINITPHASE, PDumpStopInitPhaseBW);
-#endif
-
+#endif
+
SetDispatchTableEntry(PVRSRV_BRIDGE_GET_OEMJTABLE, DummyBW);
-
+
SetDispatchTableEntry(PVRSRV_BRIDGE_ENUM_CLASS, PVRSRVEnumerateDCBW);
-
+
SetDispatchTableEntry(PVRSRV_BRIDGE_OPEN_DISPCLASS_DEVICE, PVRSRVOpenDCDeviceBW);
SetDispatchTableEntry(PVRSRV_BRIDGE_CLOSE_DISPCLASS_DEVICE, PVRSRVCloseDCDeviceBW);
SetDispatchTableEntry(PVRSRV_BRIDGE_ENUM_DISPCLASS_FORMATS, PVRSRVEnumDCFormatsBW);
SetDispatchTableEntry(PVRSRV_BRIDGE_SWAP_DISPCLASS_TO_BUFFER2, PVRSRVSwapToDCBuffer2BW);
SetDispatchTableEntry(PVRSRV_BRIDGE_SWAP_DISPCLASS_TO_SYSTEM, PVRSRVSwapToDCSystemBW);
SetDispatchTableEntry(PVRSRV_BRIDGE_GET_DISPCLASS_FRONT_BUFFER, PVRSRVGetDCFrontBufferBW);
-
+
SetDispatchTableEntry(PVRSRV_BRIDGE_OPEN_BUFFERCLASS_DEVICE, PVRSRVOpenBCDeviceBW);
SetDispatchTableEntry(PVRSRV_BRIDGE_CLOSE_BUFFERCLASS_DEVICE, PVRSRVCloseBCDeviceBW);
SetDispatchTableEntry(PVRSRV_BRIDGE_GET_BUFFERCLASS_INFO, PVRSRVGetBCInfoBW);
SetDispatchTableEntry(PVRSRV_BRIDGE_GET_BUFFERCLASS_BUFFER, PVRSRVGetBCBufferBW);
-
+
SetDispatchTableEntry(PVRSRV_BRIDGE_WRAP_EXT_MEMORY, PVRSRVWrapExtMemoryBW);
SetDispatchTableEntry(PVRSRV_BRIDGE_UNWRAP_EXT_MEMORY, PVRSRVUnwrapExtMemoryBW);
-
+
SetDispatchTableEntry(PVRSRV_BRIDGE_ALLOC_SHARED_SYS_MEM, PVRSRVAllocSharedSysMemoryBW);
SetDispatchTableEntry(PVRSRV_BRIDGE_FREE_SHARED_SYS_MEM, PVRSRVFreeSharedSysMemoryBW);
SetDispatchTableEntry(PVRSRV_BRIDGE_MAP_MEMINFO_MEM, PVRSRVMapMemInfoMemBW);
-
+
SetDispatchTableEntry(PVRSRV_BRIDGE_INITSRV_CONNECT, &PVRSRVInitSrvConnectBW);
SetDispatchTableEntry(PVRSRV_BRIDGE_INITSRV_DISCONNECT, &PVRSRVInitSrvDisconnectBW);
-
+
SetDispatchTableEntry(PVRSRV_BRIDGE_EVENT_OBJECT_WAIT, &PVRSRVEventObjectWaitBW);
SetDispatchTableEntry(PVRSRV_BRIDGE_EVENT_OBJECT_OPEN, &PVRSRVEventObjectOpenBW);
SetDispatchTableEntry(PVRSRV_BRIDGE_EVENT_OBJECT_CLOSE, &PVRSRVEventObjectCloseBW);
SetMSVDXDispatchTableEntry();
#endif
-
-
+
+
for(i=0;i<BRIDGE_DISPATCH_TABLE_ENTRY_COUNT;i++)
{
if(!g_BridgeDispatchTable[i].pfFunction)
}
else
{
-
+
switch(ui32BridgeID)
{
case PVRSRV_GET_BRIDGE_ID(PVRSRV_BRIDGE_CONNECT_SERVICES):
#if defined(__linux__)
{
-
+
SYS_DATA *psSysData;
SysAcquireData(&psSysData);
-
+
psBridgeIn = ((ENV_DATA *)psSysData->pvEnvSpecificData)->pvBridgeData;
psBridgeOut = (IMG_PVOID)((IMG_PBYTE)psBridgeIn + PVRSRV_MAX_BRIDGE_IN_SIZE);
-
- if((psBridgePackageKM->ui32InBufferSize > PVRSRV_MAX_BRIDGE_IN_SIZE) ||
+
+ if((psBridgePackageKM->ui32InBufferSize > PVRSRV_MAX_BRIDGE_IN_SIZE) ||
(psBridgePackageKM->ui32OutBufferSize > PVRSRV_MAX_BRIDGE_OUT_SIZE))
{
goto return_fault;
}
#if defined(__linux__)
-
+
if(CopyToUserWrapper(psPerProc,
ui32BridgeID,
psBridgePackageKM->pvParamOut,
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
IMG_VOID *pvSrc,
IMG_UINT32 ui32Size);
PVRSRV_ERROR
-CopyToUserWrapper(PVRSRV_PER_PROCESS_DATA *pProcData,
+CopyToUserWrapper(PVRSRV_PER_PROCESS_DATA *pProcData,
IMG_UINT32 ui32BridgeID,
IMG_VOID *pvDest,
IMG_VOID *pvSrc,
PVRSRVReleaseHandleBatch(psPerProc->psHandleBase);
}
}
-#else
+#else
#define NEW_HANDLE_BATCH_OR_ERROR(error, psPerProc, ui32BatchSize)
#define COMMIT_HANDLE_BATCH_OR_ERROR(error, psPerProc)
#define ReleaseHandleBatch(psPerProc)
-#endif
+#endif
IMG_INT
DummyBW(IMG_UINT32 ui32BridgeID,
typedef struct _PVRSRV_BRIDGE_DISPATCH_TABLE_ENTRY
{
- BridgeWrapperFunction pfFunction;
+ BridgeWrapperFunction pfFunction;
#if defined(DEBUG_BRIDGE_KM)
- const IMG_CHAR *pszIOCName;
- const IMG_CHAR *pszFunctionName;
- IMG_UINT32 ui32CallCount;
- IMG_UINT32 ui32CopyFromUserTotalBytes;
- IMG_UINT32 ui32CopyToUserTotalBytes;
+ const IMG_CHAR *pszIOCName;
+ const IMG_CHAR *pszFunctionName;
+ IMG_UINT32 ui32CallCount;
+ IMG_UINT32 ui32CopyFromUserTotalBytes;
+ IMG_UINT32 ui32CopyToUserTotalBytes;
#endif
}PVRSRV_BRIDGE_DISPATCH_TABLE_ENTRY;
const IMG_CHAR *pszFunctionName);
-
+
#define SetDispatchTableEntry(ui32Index, pfFunction) \
_SetDispatchTableEntry(PVRSRV_GET_BRIDGE_ID(ui32Index), #ui32Index, (BridgeWrapperFunction)pfFunction, #pfFunction)
}
#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
PVRSRV_HANDLE_TYPE eHandleType;
PVRSRV_ERROR eError;
-
+
eError = PVRSRVLookupHandleAnyType(psHandleBase, &hMHandleInt,
&eHandleType,
hMHandle);
{
PVRSRV_KERNEL_SYNC_INFO *psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *)hMHandleInt;
PVRSRV_KERNEL_MEM_INFO *psMemInfo = psSyncInfo->psSyncDataMemInfoKM;
-
+
*phOSMemHandle = psMemInfo->sMemBlk.hOSMemHandle;
break;
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
}
#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
PVR_ASSERT(psDevInfo->ui32ClientRefCount > 0);
-
+
if (psDevInfo->ui32ClientRefCount > 0)
{
psDevInfo->ui32ClientRefCount--;
}
-
+
psRetOUT->eError = PVRSRV_OK;
return 0;
&psSGXGetInternalDevInfoOUT->sSGXInternalDevInfo);
#endif
-
+
psSGXGetInternalDevInfoOUT->eError =
PVRSRVAllocHandle(psPerProc->psHandleBase,
&psSGXGetInternalDevInfoOUT->sSGXInternalDevInfo.hHostCtlKernelMemInfoHandle,
{
return 0;
}
-
+
if(psDoKickIN->sCCBKick.hTA3DSyncInfo != 0)
#else
if(psDoKickIN->sCCBKick.hTA3DSyncInfo != IMG_NULL)
}
#if defined(FIX_HW_BRN_31620)
-
+
psRetOUT->eError =
PVRSRVLookupHandle(psPerProc->psHandleBase,
&psDoKickIN->sCCBKick.hDevMemContext,
#if defined(SUPPORT_SGX_GENERALISED_SYNCOBJECTS)
-
+
if (psDoKickIN->sCCBKick.ui32NumTASrcSyncs > SGX_MAX_TA_SRC_SYNCS)
{
psRetOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
}
}
#else
-
+
if (psDoKickIN->sCCBKick.ui32NumSrcSyncs > SGX_MAX_SRC_SYNCS)
{
psRetOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
#endif
psDoKickIN->sCCBKick.as3DStatusUpdate[i].hKernelMemInfo,
PVRSRV_HANDLE_TYPE_MEM_INFO);
-
+
#if defined (SUPPORT_SID_INTERFACE)
sCCBKickKM.as3DStatusUpdate[i].sCtlStatus = psDoKickIN->sCCBKick.as3DStatusUpdate[i].sCtlStatus;
#endif
goto PVRSRV_BRIDGE_SGX_DOKICK_RETURN_RESULT;
}
-
+
psDoKickIN->sCCBKick.pahDstSyncHandles = phKernelSyncInfoHandles;
#endif
#if defined(NO_HARDWARE)
sCCBKickKM.ui32WriteOpsPendingVal = psDoKickIN->sCCBKick.ui32WriteOpsPendingVal;
#endif
-#endif
+#endif
psRetOUT->eError =
SGXDoKickKM(hDevCookieInt,
#if defined (SUPPORT_SID_INTERFACE)
ui32NumDstSyncs * sizeof(IMG_HANDLE),
(IMG_VOID *)phKernelSyncInfoHandles,
0);
-
+
}
return ret;
}
psKick = &psSubmitTransferIN->sKick;
#if defined(FIX_HW_BRN_31620)
-
+
psRetOUT->eError =
PVRSRVLookupHandle(psPerProc->psHandleBase,
&psKick->hDevMemContext,
}
psRetOUT->eError = SGXSetTransferContextPriorityKM(
- hDevCookieInt,
+ hDevCookieInt,
hTransferContextInt,
psSGXSetTransferContextPriorityIN->ui32Priority,
psSGXSetTransferContextPriorityIN->ui32OffsetOfPriorityField);
}
psRetOUT->eError = SGXSetRenderContextPriorityKM(
- hDevCookieInt,
+ hDevCookieInt,
hRenderContextInt,
psSGXSetRenderContextPriorityIN->ui32Priority,
psSGXSetRenderContextPriorityIN->ui32OffsetOfPriorityField);
psKick = &psSubmit2DIN->sKick;
#if defined(FIX_HW_BRN_31620)
-
+
psRetOUT->eError =
PVRSRVLookupHandle(psPerProc->psHandleBase,
&psKick->hDevMemContext,
sKickKM.hDstSyncInfo = IMG_NULL;
}
-
+
sKickKM.ui32SharedCmdCCBOffset = psKick->ui32SharedCmdCCBOffset;
sKickKM.ui32NumSrcSync = psKick->ui32NumSrcSync;
sKickKM.ui32PDumpFlags = psKick->ui32PDumpFlags;
return 0;
}
-#endif
-#endif
+#endif
+#endif
static IMG_INT
}
#if defined(SUPPORT_SGX_EDM_MEMORY_DEBUG)
-
+
if (psSGXGetMiscInfoIN->psMiscInfo->eRequest == SGX_MISC_INFO_REQUEST_MEMREAD)
{
psRetOUT->eError = PVRSRVLookupHandle(psPerProc->psHandleBase,
}
}
#endif
-
+
psDeviceNode = hDevCookieInt;
PVR_ASSERT(psDeviceNode != IMG_NULL);
if (psDeviceNode == IMG_NULL)
psDevInfo = psDeviceNode->pvDevice;
-
+
psRetOUT->eError = CopyFromUserWrapper(psPerProc,
ui32BridgeID,
&sMiscInfo,
}
}
-
+
psRetOUT->eError = CopyToUserWrapper(psPerProc,
ui32BridgeID,
psSGXGetMiscInfoIN->psMiscInfo,
ui32AllocatedSize,
psAllocated,
hAllocatedHandle);
-
+
return 0;
}
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SGX_DEVINITPART2);
-
+
psSGXDevInitPart2OUT->ui32KMBuildOptions = SGX_BUILD_OPTIONS;
if(!psPerProc->bInitProcess)
return 0;
}
-
+
eError = PVRSRVLookupHandle(psPerProc->psHandleBase,
&hDummy,
psSGXDevInitPart2IN->sInitInfo.hKernelCCBMemInfo,
{
bLookupFailed = IMG_TRUE;
}
-
+
eError = PVRSRVLookupHandle(psPerProc->psHandleBase,
&hDummy,
psSGXDevInitPart2IN->sInitInfo.hKernelClearClipWATPCMemInfo,
return 0;
}
-
+
eError = PVRSRVLookupAndReleaseHandle(psPerProc->psHandleBase,
#if defined (SUPPORT_SID_INTERFACE)
&asInitInfoKM.hKernelCCBMemInfo,
{
PVR_DPF((PVR_DBG_ERROR, "DevInitSGXPart2BW: A handle release failed"));
psSGXDevInitPart2OUT->eError = PVRSRV_ERROR_INIT2_PHASE_FAILED;
-
+
PVR_DBG_BREAK;
return 0;
}
-
+
#if defined (SUPPORT_SID_INTERFACE)
eError = PVRSRVDissociateDeviceMemKM(hDevCookieInt, asInitInfoKM.hKernelCCBMemInfo);
#else
}
#endif
-
+
#if defined (SUPPORT_SID_INTERFACE)
eError = PVRSRVDissociateDeviceMemKM(hDevCookieInt, asInitInfoKM.hKernelSGXMiscMemInfo);
#else
#if defined(SGX_FEATURE_VDM_CONTEXT_SWITCH) && defined(FIX_HW_BRN_31425)
eError = PVRSRVDissociateDeviceMemKM(hDevCookieInt, psSGXDevInitPart2IN->sInitInfo.hKernelVDMSnapShotBufferMemInfo);
bDissociateFailed |= (IMG_BOOL)(eError != PVRSRV_OK);
-
+
eError = PVRSRVDissociateDeviceMemKM(hDevCookieInt, psSGXDevInitPart2IN->sInitInfo.hKernelVDMCtrlStreamBufferMemInfo);
bDissociateFailed |= (IMG_BOOL)(eError != PVRSRV_OK);
#endif
}
}
-
+
if(bDissociateFailed)
{
#if defined (SUPPORT_SID_INTERFACE)
psSGXDevInitPart2OUT->eError = PVRSRV_ERROR_INIT2_PHASE_FAILED;
-
+
PVR_DBG_BREAK;
return 0;
}
return 0;
}
-#endif
+#endif
static IMG_INT
SGXFlushHWRenderTargetBW(IMG_UINT32 ui32BridgeID,
if(hSharedPBDesc == IMG_NULL)
{
psSGXFindSharedPBDescOUT->hSharedPBDescKernelMemInfoHandle = 0;
-
+
goto PVRSRV_BRIDGE_SGX_FINDSHAREDPBDESC_EXIT;
}
PVRSRV_HANDLE_TYPE_SHARED_PB_DESC,
PVRSRV_HANDLE_ALLOC_FLAG_NONE);
-
+
PVRSRVAllocSubHandleNR(psPerProc->psHandleBase,
&psSGXFindSharedPBDescOUT->hSharedPBDescKernelMemInfoHandle,
psSharedPBDescKernelMemInfo,
}
}
-
-
+
+
eError = PVRSRVReleaseHandle(psPerProc->psHandleBase,
psSGXAddSharedPBDescIN->hSharedPBDescKernelMemInfo,
PVRSRV_HANDLE_TYPE_SHARED_SYS_MEM_INFO);
PVR_ASSERT(eError == PVRSRV_OK);
-
+
eError = PVRSRVReleaseHandle(psPerProc->psHandleBase,
psSGXAddSharedPBDescIN->hHWPBDescKernelMemInfo,
PVRSRV_HANDLE_TYPE_MEM_INFO);
PVR_ASSERT(eError == PVRSRV_OK);
-
+
eError = PVRSRVReleaseHandle(psPerProc->psHandleBase,
psSGXAddSharedPBDescIN->hBlockKernelMemInfo,
PVRSRV_HANDLE_TYPE_SHARED_SYS_MEM_INFO);
PVR_ASSERT(eError == PVRSRV_OK);
-
+
eError = PVRSRVReleaseHandle(psPerProc->psHandleBase,
psSGXAddSharedPBDescIN->hHWBlockKernelMemInfo,
PVRSRV_HANDLE_TYPE_MEM_INFO);
for(i=0; i<ui32KernelMemInfoHandlesCount; i++)
{
-
+
eError = PVRSRVReleaseHandle(psPerProc->psHandleBase,
phKernelMemInfoHandles[i],
PVRSRV_HANDLE_TYPE_MEM_INFO);
if ((asHeapInfo[i].ui32HeapID != (IMG_UINT32)SGX_UNDEFINED_HEAP_ID) &&
(asHeapInfo[i].hDevMemHeap != IMG_NULL))
{
-
+
PVRSRVAllocHandleNR(psPerProc->psHandleBase,
&psHeapInfo->hDevMemHeap,
asHeapInfo[i].hDevMemHeap,
if (psHeapInfo->hDevMemHeap != IMG_NULL)
{
-
+
PVRSRVAllocHandleNR(psPerProc->psHandleBase,
&hDevMemHeapExt,
psHeapInfo->hDevMemHeap,
}
else
{
-
+
if (bDumpPolls)
{
ui32BufferArraySize,
(IMG_PVOID *)&psKickTADumpBuffer, 0,
"Array of Kick Tile Accelerator Dump Buffer") != PVRSRV_OK)
-#endif
+#endif
{
return -ENOMEM;
}
ui32BufferArraySize) != PVRSRV_OK)
{
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, ui32BufferArraySize, psKickTADumpBuffer, 0);
-
+
return -EFAULT;
}
#endif
#else
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, ui32BufferArraySize, psKickTADumpBuffer, 0);
#endif
-
+
return 0;
}
psDevInfo = (PVRSRV_SGXDEV_INFO*)psDeviceNode->pvDevice;
#if defined(SGX_FEATURE_MP) && defined(FIX_HW_BRN_27270)
-
+
ui32RegVal = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_MASTER_CORE);
OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_MASTER_CORE, (SGX_FEATURE_MP_CORE_COUNT - 1) << EUR_CR_MASTER_CORE_ENABLE_SHIFT);
#if defined(PDUMP)
return 0;
}
-
+
PVR_ASSERT(psDeviceNode->pfnMMUGetContextID != IMG_NULL)
ui32MMUContextID = psDeviceNode->pfnMMUGetContextID((IMG_HANDLE)psDeviceNode->sDevMemoryInfo.pBMKernelContext);
psDevInfo = (PVRSRV_SGXDEV_INFO*)psDeviceNode->pvDevice;
-
+
ui32RegVal = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_MASTER_CORE);
OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_MASTER_CORE, (SGX_FEATURE_MP_CORE_COUNT - 1) << EUR_CR_MASTER_CORE_ENABLE_SHIFT);
#if defined(PDUMP)
return 0;
}
-
+
PVR_ASSERT(psDeviceNode->pfnMMUGetContextID != IMG_NULL)
ui32MMUContextID = psDeviceNode->pfnMMUGetContextID(hDevMemContextInt);
PVR_UNREFERENCED_PARAMETER(psRetOUT);
PVR_UNREFERENCED_PARAMETER(psPerProc);
return 0;
-#endif
+#endif
#else
PVR_UNREFERENCED_PARAMETER(ui32BridgeID);
PVR_UNREFERENCED_PARAMETER(psPDumpHWPerfCBIN);
PVR_UNREFERENCED_PARAMETER(psRetOUT);
PVR_UNREFERENCED_PARAMETER(psPerProc);
return -EFAULT;
-#endif
+#endif
}
return 0;
}
-
+
PVR_ASSERT(psDeviceNode->pfnMMUGetContextID != IMG_NULL)
ui32MMUContextID = psDeviceNode->pfnMMUGetContextID(hDevMemContextInt);
return 0;
}
-#endif
-
+#endif
+
IMG_VOID SetSGXDispatchTableEntry(IMG_VOID)
{
SetDispatchTableEntry(PVRSRV_BRIDGE_SGX_PDUMP_SAVEMEM, SGXPDumpSaveMemBW);
#endif
}
+
-
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
}
#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
"AllocMemory (uSize=0x%x, uFlags=0x%x, align=0x%x)",
uSize, uFlags, uDevVAddrAlignment));
-
+
if(uFlags & PVRSRV_MEM_RAM_BACKED_ALLOCATION)
{
if(uFlags & PVRSRV_MEM_USER_SUPPLIED_DEVVADDR)
{
-
+
PVR_DPF ((PVR_DBG_ERROR, "AllocMemory: combination of DevVAddr management and RAM backing mode unsupported"));
return IMG_FALSE;
}
+
-
-
+
if(psBMHeap->ui32Attribs
& (PVRSRV_BACKINGSTORE_SYSMEM_NONCONTIG
|PVRSRV_BACKINGSTORE_LOCALMEM_CONTIG))
{
-
+
pArena = psBMHeap->pImportArena;
PVR_ASSERT(psBMHeap->sDevArena.psDeviceMemoryHeapInfo->ui32Attribs & PVRSRV_MEM_RAM_BACKED_ALLOCATION);
}
return IMG_FALSE;
}
-
+
if(uFlags & PVRSRV_MEM_NO_GPU_ADDR)
{
IMG_SIZE_T uImportSize = uSize;
}
}
-
+
pBuf->CpuPAddr.uiAddr = pMapping->CpuPAddr.uiAddr + uOffset;
if(uFlags & PVRSRV_MEM_ZERO)
{
if(uFlags & PVRSRV_MEM_USER_SUPPLIED_DEVVADDR)
{
-
+
PVR_ASSERT(psDevVAddr != IMG_NULL);
if (psDevVAddr == IMG_NULL)
return IMG_FALSE;
}
-
+
pBMContext->psDeviceNode->pfnMMUAlloc (psBMHeap->pMMUHeap,
uSize,
IMG_NULL,
uDevVAddrAlignment,
psDevVAddr);
-
+
pBuf->DevVAddr = *psDevVAddr;
}
else
{
IMG_BOOL bResult;
+
-
-
+
bResult = pBMContext->psDeviceNode->pfnMMUAlloc (psBMHeap->pMMUHeap,
uSize,
IMG_NULL,
}
}
-
+
if (OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
sizeof (struct _BM_MAPPING_),
(IMG_PVOID *)&pMapping, IMG_NULL,
return IMG_FALSE;
}
-
+
pBuf->CpuVAddr = IMG_NULL;
pBuf->hOSMemHandle = 0;
pBuf->CpuPAddr.uiAddr = 0;
-
+
pMapping->CpuVAddr = IMG_NULL;
pMapping->CpuPAddr.uiAddr = 0;
pMapping->DevVAddr = pBuf->DevVAddr;
pMapping->hOSMemHandle = 0;
}
-
+
pMapping->pArena = pArena;
-
+
pMapping->pBMHeap = psBMHeap;
pBuf->pMapping = pMapping;
-
+
PVR_DPF ((PVR_DBG_MESSAGE,
"AllocMemory: pMapping=%08x: DevV=%08X CpuV=%08x CpuP=%08X uSize=0x%x",
(IMG_UINTPTR_T)pMapping,
pBuf->CpuPAddr.uiAddr,
uSize));
-
+
PVR_ASSERT(((pBuf->DevVAddr.uiAddr) & (uDevVAddrAlignment - 1)) == 0);
return IMG_TRUE;
(IMG_UINTPTR_T)psBMHeap, uSize, ui32BaseOffset, bPhysContig, (IMG_UINTPTR_T)pvCPUVAddr, uFlags));
PVR_ASSERT((psAddr->uiAddr & (ui32PageSize - 1)) == 0);
-
+
PVR_ASSERT(((IMG_UINTPTR_T)pvCPUVAddr & (ui32PageSize - 1)) == 0);
uSize += ui32BaseOffset;
uSize = HOST_PAGEALIGN (uSize);
-
+
if (OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
sizeof(*pMapping),
(IMG_PVOID *)&pMapping, IMG_NULL,
}
}
-
+
bResult = DevMemoryAlloc(psBMHeap->pBMContext,
pMapping,
IMG_NULL,
goto fail_cleanup;
}
-
+
pBuf->CpuPAddr.uiAddr = pMapping->CpuPAddr.uiAddr + ui32BaseOffset;
if(!ui32BaseOffset)
{
}
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BM_MAPPING), pMapping, IMG_NULL);
-
+
return IMG_FALSE;
}
IMG_SIZE_T ui32CurrentOffset = 0;
IMG_CPU_PHYADDR CpuPAddr;
-
+
PVR_ASSERT(pBuf->hOSMemHandle);
while(ui32BytesRemaining > 0)
{
IMG_SIZE_T ui32BlockBytes = MIN(ui32BytesRemaining, HOST_PAGESIZE());
CpuPAddr = OSMemHandleToCpuPAddr(pBuf->hOSMemHandle, ui32CurrentOffset);
-
+
if(CpuPAddr.uiAddr & (HOST_PAGESIZE() -1))
{
ui32BlockBytes =
(IMG_UINTPTR_T)pBuf, pBuf->DevVAddr.uiAddr,
(IMG_UINTPTR_T)pBuf->CpuVAddr, pBuf->CpuPAddr.uiAddr));
-
+
pMapping = pBuf->pMapping;
psDeviceNode = pMapping->pBMHeap->pBMContext->psDeviceNode;
if(ui32Flags & PVRSRV_MEM_USER_SUPPLIED_DEVVADDR)
{
-
+
if ((pBuf->ui32ExportCount == 0) && (pBuf->ui32RefCount == 0))
{
-
+
if(ui32Flags & PVRSRV_MEM_RAM_BACKED_ALLOCATION)
{
-
+
PVR_DPF ((PVR_DBG_ERROR, "FreeBuf: combination of DevVAddr management and RAM backing mode unsupported"));
}
else
{
-
+
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BM_MAPPING), pMapping, IMG_NULL);
- pBuf->pMapping = IMG_NULL;
+ pBuf->pMapping = IMG_NULL;
}
}
}
else
{
-
+
if(pBuf->hOSMemHandle != pMapping->hOSMemHandle)
{
-
+
if ((pBuf->ui32ExportCount == 0) && (pBuf->ui32RefCount == 0))
{
-
+
OSReleaseSubMemHandle(pBuf->hOSMemHandle, ui32Flags);
}
}
if(ui32Flags & PVRSRV_MEM_RAM_BACKED_ALLOCATION)
{
-
-
+
+
if ((pBuf->ui32ExportCount == 0) && (pBuf->ui32RefCount == 0))
{
-
+
PVR_ASSERT(pBuf->ui32ExportCount == 0)
if ((pBuf->ui32ExportCount == 0) && (pBuf->ui32RefCount == 0))
{
-
+
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BM_MAPPING), pMapping, IMG_NULL);
- pBuf->pMapping = IMG_NULL;
+ pBuf->pMapping = IMG_NULL;
}
}
}
if ((pBuf->ui32ExportCount == 0) && (pBuf->ui32RefCount == 0))
{
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BM_BUF), pBuf, IMG_NULL);
-
+
}
}
*pbDestroyed = IMG_FALSE;
}
-
+
if (pBMContext == IMG_NULL)
{
if (pBMContext->ui32RefCount > 0)
{
-
+
return PVRSRV_OK;
}
-
+
eError = List_BM_HEAP_PVRSRV_ERROR_Any(pBMContext->psBMHeap, &BM_DestroyContext_AnyCb);
{
PVR_DPF ((PVR_DBG_ERROR, "BM_DestroyContext: List_BM_HEAP_PVRSRV_ERROR_Any failed"));
#if 0
-
-
-
-
+
+
+
+
PVR_DPF ((PVR_DBG_ERROR, "BM_DestroyContext: Cleaning up with ResManFreeSpecial"));
if(ResManFreeSpecial() != PVRSRV_OK)
{
PVR_DPF ((PVR_DBG_ERROR, "BM_DestroyContext: ResManFreeSpecial failed %d",eError));
}
-
+
#endif
return eError;
}
else
{
-
+
eError = ResManFreeResByPtr(pBMContext->hResItem, CLEANUP_WITH_POLL);
if(eError != PVRSRV_OK)
{
return eError;
}
-
+
if (pbDestroyed != IMG_NULL)
{
*pbDestroyed = IMG_TRUE;
PVRSRV_DEVICE_NODE *psDeviceNode;
psDeviceNode = va_arg(va, PVRSRV_DEVICE_NODE*);
-
+
if(psBMHeap->ui32Attribs
& (PVRSRV_BACKINGSTORE_SYSMEM_NONCONTIG
|PVRSRV_BACKINGSTORE_LOCALMEM_CONTIG))
return PVRSRV_ERROR_UNSUPPORTED_BACKING_STORE;
}
-
+
psDeviceNode->pfnMMUDelete(psBMHeap->pMMUHeap);
-
+
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BM_HEAP), psBMHeap, IMG_NULL);
-
+
return PVRSRV_OK;
}
PVR_UNREFERENCED_PARAMETER(ui32Param);
PVR_UNREFERENCED_PARAMETER(bDummy);
-
+
psDeviceNode = pBMContext->psDeviceNode;
-
+
eError = List_BM_HEAP_PVRSRV_ERROR_Any_va(pBMContext->psBMHeap,
&BM_DestroyContextCallBack_AnyVaCb,
{
return eError;
}
-
+
if (pBMContext->psMMUContext)
{
psDeviceNode->pfnMMUFinalise(pBMContext->psMMUContext);
}
-
+
if (pBMContext->pBufferHash)
{
if (pBMContext == psDeviceNode->sDevMemoryInfo.pBMKernelContext)
{
-
+
psDeviceNode->sDevMemoryInfo.pBMKernelContext = IMG_NULL;
}
else
{
if (pBMContext->ppsThis != IMG_NULL)
{
-
+
List_BM_CONTEXT_Remove(pBMContext);
}
}
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BM_CONTEXT), pBMContext, IMG_NULL);
-
+
return PVRSRV_OK;
}
hResManContext = va_arg(va, PRESMAN_CONTEXT);
if(ResManFindResourceByPtr(hResManContext, pBMContext->hResItem) == PVRSRV_OK)
{
-
+
pBMContext->ui32RefCount++;
return pBMContext;
}
case DEVICE_MEMORY_HEAP_SHARED:
case DEVICE_MEMORY_HEAP_SHARED_EXPORTED:
{
-
+
psDeviceNode->pfnMMUInsertHeap(pBMContext->psMMUContext, psBMHeap->pMMUHeap);
break;
}
*pbCreated = IMG_FALSE;
}
-
+
psDevMemoryInfo = &psDeviceNode->sDevMemoryInfo;
if (bKernelContext == IMG_FALSE)
}
}
-
+
if (OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
sizeof (struct _BM_CONTEXT_),
(IMG_PVOID *)&pBMContext, IMG_NULL,
}
OSMemSet(pBMContext, 0, sizeof (BM_CONTEXT));
-
+
pBMContext->psDeviceNode = psDeviceNode;
-
-
+
+
pBMContext->pBufferHash = HASH_Create(32);
if (pBMContext->pBufferHash==IMG_NULL)
{
if(bKernelContext)
{
-
+
PVR_ASSERT(psDevMemoryInfo->pBMKernelContext == IMG_NULL);
psDevMemoryInfo->pBMKernelContext = pBMContext;
}
else
{
-
+
PVR_ASSERT(psDevMemoryInfo->pBMKernelContext->psBMHeap);
-
+
pBMContext->psBMSharedHeap = psDevMemoryInfo->pBMKernelContext->psBMHeap;
-
+
List_BM_HEAP_ForEach_va(pBMContext->psBMSharedHeap,
psDeviceNode,
pBMContext);
-
+
List_BM_CONTEXT_Insert(&psDevMemoryInfo->pBMContext, pBMContext);
}
-
+
pBMContext->ui32RefCount++;
-
+
pBMContext->hResItem = ResManRegisterRes(hResManContext,
RESMAN_TYPE_DEVICEMEM_CONTEXT,
pBMContext,
psDevMemHeapInfo = va_arg(va, DEVICE_MEMORY_HEAP_INFO*);
if (psBMHeap->sDevArena.ui32HeapID == psDevMemHeapInfo->ui32HeapID)
{
-
+
return psBMHeap;
}
else
psDeviceNode = pBMContext->psDeviceNode;
-
-
+
+
PVR_ASSERT((psDevMemHeapInfo->ui32HeapSize & (psDevMemHeapInfo->ui32DataPageSize - 1)) == 0);
PVR_ASSERT(psDevMemHeapInfo->ui32HeapSize > 0);
-
+
psBMHeap->ui32XTileStride = psDevMemHeapInfo->ui32XTileStride;
#endif
-
+
psBMHeap->pBMContext = pBMContext;
psBMHeap->pMMUHeap = psDeviceNode->pfnMMUCreate (pBMContext->psMMUContext,
goto ErrorExit;
}
-
+
psBMHeap->pImportArena = RA_Create (psDevMemHeapInfo->pszBSName,
0, 0, IMG_NULL,
MAX(HOST_PAGESIZE(), psBMHeap->sDevArena.ui32DataPageSize),
if(psBMHeap->ui32Attribs & PVRSRV_BACKINGSTORE_LOCALMEM_CONTIG)
{
-
+
}
}
-
+
List_BM_HEAP_Insert(&pBMContext->psBMHeap, psBMHeap);
return (IMG_HANDLE)psBMHeap;
-
+
ErrorExit:
-
+
if (psBMHeap->pMMUHeap != IMG_NULL)
{
psDeviceNode->pfnMMUDelete (psBMHeap->pMMUHeap);
-
+
}
-
+
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BM_HEAP), psBMHeap, IMG_NULL);
-
+
return IMG_NULL;
}
if(psBMHeap)
{
-
+
if(psBMHeap->ui32Attribs
& (PVRSRV_BACKINGSTORE_SYSMEM_NONCONTIG
|PVRSRV_BACKINGSTORE_LOCALMEM_CONTIG))
return;
}
-
+
psDeviceNode->pfnMMUDelete (psBMHeap->pMMUHeap);
-
+
List_BM_HEAP_Remove(psBMHeap);
-
+
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BM_HEAP), psBMHeap, IMG_NULL);
-
+
}
else
{
uDevVAddrAlignment = 1;
}
-
+
if (OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
sizeof (BM_BUF),
(IMG_PVOID *)&pBuf, IMG_NULL,
}
OSMemSet(pBuf, 0, sizeof (BM_BUF));
-
+
if (AllocMemory(pBMContext,
psBMHeap,
psDevVAddr,
pBuf) != IMG_TRUE)
{
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof (BM_BUF), pBuf, IMG_NULL);
-
+
PVR_DPF((PVR_DBG_ERROR, "BM_Alloc: AllocMemory FAILED"));
return IMG_FALSE;
}
"BM_Alloc (uSize=0x%x, uFlags=0x%x)",
uSize, uFlags));
-
+
pBuf->ui32RefCount = 1;
*phBuf = (BM_HANDLE)pBuf;
*pui32Flags = uFlags | psBMHeap->ui32Attribs;
-
+
if(uFlags & PVRSRV_HAP_CACHETYPE_MASK)
{
*pui32Flags &= ~PVRSRV_HAP_CACHETYPE_MASK;
}
}
#endif
-
+
if (psSysAddr == IMG_NULL) {
PVR_DPF((PVR_DBG_ERROR, "Invalid parameter."));
return IMG_FALSE;
}
sHashAddress = psSysAddr[0];
-
+
sHashAddress.uiAddr += ui32Offset;
-
+
pBuf = (BM_BUF *)HASH_Retrieve(psBMContext->pBufferHash, sHashAddress.uiAddr);
if(pBuf)
{
IMG_SIZE_T ui32MappingSize = HOST_PAGEALIGN (ui32Size + ui32Offset);
-
+
if(pBuf->pMapping->uSize == ui32MappingSize && (pBuf->pMapping->eCpuMemoryOrigin == hm_wrapped ||
pBuf->pMapping->eCpuMemoryOrigin == hm_wrapped_virtaddr))
{
}
else
{
-
+
HASH_Remove(psBMContext->pBufferHash, (IMG_UINTPTR_T)sHashAddress.uiAddr);
- }
+ }
}
-
+
if (OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
sizeof (BM_BUF),
(IMG_PVOID *)&pBuf, IMG_NULL,
}
OSMemSet(pBuf, 0, sizeof (BM_BUF));
-
+
if (WrapMemory (psBMHeap, ui32Size, ui32Offset, bPhysContig, psSysAddr, pvCPUVAddr, uFlags, pBuf) != IMG_TRUE)
{
PVR_DPF((PVR_DBG_ERROR, "BM_Wrap: WrapMemory FAILED"));
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof (BM_BUF), pBuf, IMG_NULL);
-
+
return IMG_FALSE;
}
-
+
if(pBuf->pMapping->eCpuMemoryOrigin == hm_wrapped || pBuf->pMapping->eCpuMemoryOrigin == hm_wrapped_virtaddr)
{
-
+
PVR_ASSERT(SysSysPAddrToCpuPAddr(sHashAddress).uiAddr == pBuf->CpuPAddr.uiAddr);
if (!HASH_Insert (psBMContext->pBufferHash, sHashAddress.uiAddr, (IMG_UINTPTR_T)pBuf))
"BM_Wrap (uSize=0x%x, uFlags=0x%x, devVAddr=%08X)",
ui32Size, uFlags, pBuf->DevVAddr.uiAddr));
-
+
pBuf->ui32RefCount = 1;
*phBuf = (BM_HANDLE)pBuf;
if(pui32Flags)
{
-
+
*pui32Flags = (uFlags & ~PVRSRV_HAP_MAPTYPE_MASK) | PVRSRV_HAP_MULTI_PROCESS;
}
if(uFlags & PVRSRV_MEM_INTERLEAVED)
{
-
+
pMapping->uSize *= 2;
}
#ifdef PDUMP
if(uFlags & PVRSRV_MEM_DUMMY)
{
-
+
ui32PDumpSize = pMapping->pBMHeap->sDevArena.ui32DataPageSize;
}
#endif
-
+
if (!psDeviceNode->pfnMMUAlloc (pMapping->pBMHeap->pMMUHeap,
pMapping->uSize,
pActualSize,
#endif
#if defined(PDUMP)
-
+
PDUMPMALLOCPAGES(&psDeviceNode->sDevId,
pMapping->DevVAddr.uiAddr,
pMapping->CpuVAddr,
#if defined(SUPPORT_PDUMP_MULTI_PROCESS)
psDeviceNode->pfnMMUIsHeapShared(pMapping->pBMHeap->pMMUHeap),
#else
- IMG_FALSE,
-#endif
+ IMG_FALSE,
+#endif
(IMG_HANDLE)pMapping);
#endif
if (sDevPAddr.uiAddr != 0)
{
#ifdef PDUMP
-
+
if(pMapping->ui32Flags & PVRSRV_MEM_DUMMY)
{
-
+
ui32PSize = pMapping->pBMHeap->sDevArena.ui32DataPageSize;
}
else
{
ui32PSize = (IMG_UINT32)pMapping->uSize;
}
-
+
PDUMPFREEPAGES(pMapping->pBMHeap,
pMapping->DevVAddr,
ui32PSize,
static IMG_UINT32 gXProcWorkaroundShareIndex = XPROC_WORKAROUND_BAD_SHAREINDEX;
static IMG_UINT32 gXProcWorkaroundState = XPROC_WORKAROUND_UNKNOWN;
-
+
static struct {
IMG_UINT32 ui32RefCount;
IMG_UINT32 ui32AllocFlags;
PVRSRV_ERROR BM_XProcWorkaroundSetShareIndex(IMG_UINT32 ui32Index)
{
-
+
if (gXProcWorkaroundShareIndex != XPROC_WORKAROUND_BAD_SHAREINDEX)
PVRSRV_ERROR BM_XProcWorkaroundUnsetShareIndex(IMG_UINT32 ui32Index)
{
-
+
if (gXProcWorkaroundShareIndex == XPROC_WORKAROUND_BAD_SHAREINDEX)
PVRSRV_ERROR BM_XProcWorkaroundFindNewBufferAndSetShareIndex(IMG_UINT32 *pui32Index)
{
-
+
if (gXProcWorkaroundShareIndex != XPROC_WORKAROUND_BAD_SHAREINDEX)
ui32AllocFlags &= ~PVRSRV_HAP_MAPTYPE_MASK;
ui32AllocFlags |= PVRSRV_HAP_SINGLE_PROCESS;
-
+
if (OSAllocPages(ui32AllocFlags,
ui32Size,
ui32PageSize,
static PVRSRV_ERROR XProcWorkaroundHandleToSI(IMG_HANDLE hOSMemHandle, IMG_UINT32 *pui32SI)
{
-
+
IMG_UINT32 ui32SI;
IMG_BOOL bFound;
IMG_BOOL bErrorDups;
IMG_BOOL bResult;
IMG_SIZE_T uSize;
IMG_SIZE_T uPSize;
- IMG_SIZE_T uDevVAddrAlignment = 0;
+ IMG_SIZE_T uDevVAddrAlignment = 0;
PVR_DPF ((PVR_DBG_MESSAGE,
"BM_ImportMemory (pBMContext=0x%x, uRequestSize=0x%x, uFlags=0x%x, uAlign=0x%x)",
pMapping->pBMHeap = pBMHeap;
pMapping->ui32Flags = uFlags;
-
+
if (pActualSize)
{
*pActualSize = uSize;
}
-
+
if(pMapping->ui32Flags & PVRSRV_MEM_DUMMY)
{
uPSize = pBMHeap->sDevArena.ui32DataPageSize;
ui32Attribs |= PVRSRV_MEM_ION;
}
- bBadBackingStoreType = IMG_TRUE;
+ bBadBackingStoreType = IMG_TRUE;
if ((ui32Attribs & PVRSRV_BACKINGSTORE_SYSMEM_NONCONTIG) != 0)
{
PVR_DPF((PVR_DBG_ERROR, "Cannot use use this memory sharing workaround with allocations that might be suballocated"));
goto fail_mapping_alloc;
}
- uDevVAddrAlignment = 0;
-
+ uDevVAddrAlignment = 0;
+
if (pMapping->ui32Flags & PVRSRV_HAP_CACHETYPE_MASK)
{
ui32Attribs &= ~PVRSRV_HAP_CACHETYPE_MASK;
ui32Attribs |= (pMapping->ui32Flags & PVRSRV_HAP_CACHETYPE_MASK);
}
-
+
if (XProcWorkaroundAllocShareable(IMG_NULL,
ui32Attribs,
(IMG_UINT32)uPSize,
goto fail_mapping_alloc;
}
-
-
+
+
pMapping->eCpuMemoryOrigin = hm_env;
bBadBackingStoreType = IMG_FALSE;
PVR_DPF((PVR_DBG_ERROR, "Cannot use use this memory sharing workaround with allocations that might be suballocated"));
goto fail_mapping_alloc;
}
- uDevVAddrAlignment = 0;
-
+ uDevVAddrAlignment = 0;
+
if (pMapping->ui32Flags & PVRSRV_HAP_CACHETYPE_MASK)
{
ui32Attribs &= ~PVRSRV_HAP_CACHETYPE_MASK;
ui32Attribs |= (pMapping->ui32Flags & PVRSRV_HAP_CACHETYPE_MASK);
}
-
+
if (XProcWorkaroundAllocShareable(pBMHeap->pLocalDevMemArena,
ui32Attribs,
(IMG_UINT32)uPSize,
goto fail_mapping_alloc;
}
-
-
+
+
pMapping->eCpuMemoryOrigin = hm_env;
bBadBackingStoreType = IMG_FALSE;
}
else
-
+
if(pBMHeap->ui32Attribs & PVRSRV_BACKINGSTORE_SYSMEM_NONCONTIG)
{
IMG_UINT32 ui32Attribs = pBMHeap->ui32Attribs;
-
+
if (pMapping->ui32Flags & PVRSRV_HAP_CACHETYPE_MASK)
{
ui32Attribs &= ~PVRSRV_HAP_CACHETYPE_MASK;
goto fail_mapping_alloc;
}
-
+
pMapping->eCpuMemoryOrigin = hm_env;
}
else if(pBMHeap->ui32Attribs & PVRSRV_BACKINGSTORE_LOCALMEM_CONTIG)
IMG_SYS_PHYADDR sSysPAddr;
IMG_UINT32 ui32Attribs = pBMHeap->ui32Attribs;
-
+
PVR_ASSERT(pBMHeap->pLocalDevMemArena != IMG_NULL);
-
+
if (pMapping->ui32Flags & PVRSRV_HAP_CACHETYPE_MASK)
{
ui32Attribs &= ~PVRSRV_HAP_CACHETYPE_MASK;
goto fail_mapping_alloc;
}
-
+
pMapping->CpuPAddr = SysSysPAddrToCpuPAddr(sSysPAddr);
if(OSReservePhys(pMapping->CpuPAddr,
uPSize,
goto fail_dev_mem_alloc;
}
-
+
pMapping->eCpuMemoryOrigin = hm_contiguous;
}
else
goto fail_mapping_alloc;
}
-
+
if(!(uFlags & PVRSRV_MEM_NO_GPU_ADDR))
{
bResult = DevMemoryAlloc (pBMContext,
}
}
-
-
+
+
PVR_ASSERT (uDevVAddrAlignment>1?(pMapping->DevVAddr.uiAddr%uDevVAddrAlignment)==0:1);
*pBase = pMapping->DevVAddr.uiAddr;
fail_dev_mem_alloc:
if (pMapping && (pMapping->CpuVAddr || pMapping->hOSMemHandle))
{
-
+
if(pMapping->ui32Flags & PVRSRV_MEM_INTERLEAVED)
{
pMapping->uSize /= 2;
}
fail_mapping_alloc:
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BM_MAPPING), pMapping, IMG_NULL);
-
+
fail_exit:
return IMG_FALSE;
}
DevMemoryFree (psMapping);
}
-
+
if((psMapping->ui32Flags & PVRSRV_MEM_INTERLEAVED) != 0)
{
psMapping->uSize /= 2;
}
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BM_MAPPING), psMapping, IMG_NULL);
-
+
PVR_DPF((PVR_DBG_MESSAGE,
"..BM_FreeMemory (h=0x%x, base=0x%x)",
PVR_ASSERT (psMemInfo && psDevPAddr)
-
+
PVR_ASSERT((sDevVPageAddr.uiAddr & 0xFFF) == 0);
-
+
psDeviceNode = ((BM_BUF*)psMemInfo->sMemBlk.hBuffer)->pMapping->pBMHeap->pBMContext->psDeviceNode;
*psDevPAddr = psDeviceNode->pfnMMUGetPhysPageAddr(((BM_BUF*)psMemInfo->sMemBlk.hBuffer)->pMapping->pBMHeap->pMMUHeap,
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
typedef struct PVRSRV_DC_BUFFER_TAG
{
-
+
PVRSRV_DEVICECLASS_BUFFER sDeviceClassBuffer;
struct PVRSRV_DISPLAYCLASS_INFO_TAG *psDCInfo;
typedef struct PVRSRV_DC_SWAPCHAIN_REF_TAG
{
struct PVRSRV_DC_SWAPCHAIN_TAG *psSwapChain;
- IMG_HANDLE hResItem;
+ IMG_HANDLE hResItem;
} PVRSRV_DC_SWAPCHAIN_REF;
typedef struct PVRSRV_BC_BUFFER_TAG
{
-
+
PVRSRV_DEVICECLASS_BUFFER sDeviceClassBuffer;
struct PVRSRV_BUFFERCLASS_INFO_TAG *psBCInfo;
IMG_HANDLE hExtDevice;
PPVRSRV_BC_SRV2BUFFER_KMJTABLE psFuncTable;
IMG_HANDLE hDevMemContext;
-
+
IMG_UINT32 ui32BufferCount;
PVRSRV_BC_BUFFER *psBuffer;
IMG_UINT32 *pui32DevCount,
IMG_UINT32 *pui32DevID )
{
-
+
IMG_UINT ui32DevCount = 0;
SYS_DATA *psSysData;
SysAcquireData(&psSysData);
-
+
List_PVRSRV_DEVICE_NODE_ForEach_va(psSysData->psDeviceNodeList,
&PVRSRVEnumerateDCKM_ForEachVaCb,
&ui32DevCount,
PVRSRV_DEVICE_NODE *psDeviceNode;
SYS_DATA *psSysData;
-
+
SysAcquireData(&psSysData);
+
-
-
+
if(OSAllocMem( PVRSRV_OS_PAGEABLE_HEAP,
sizeof(*psDCInfo),
(IMG_VOID **)&psDCInfo, IMG_NULL,
}
OSMemSet (psDCInfo, 0, sizeof(*psDCInfo));
-
+
if(OSAllocMem( PVRSRV_OS_PAGEABLE_HEAP,
sizeof(PVRSRV_DC_SRV2DISP_KMJTABLE),
(IMG_VOID **)&psDCInfo->psFuncTable, IMG_NULL,
}
OSMemSet (psDCInfo->psFuncTable, 0, sizeof(PVRSRV_DC_SRV2DISP_KMJTABLE));
-
+
*psDCInfo->psFuncTable = *psFuncTable;
-
+
if(OSAllocMem( PVRSRV_OS_NON_PAGEABLE_HEAP,
sizeof(PVRSRV_DEVICE_NODE),
(IMG_VOID **)&psDeviceNode, IMG_NULL,
psDeviceNode->sDevId.eDeviceClass = PVRSRV_DEVICE_CLASS_DISPLAY;
psDeviceNode->psSysData = psSysData;
-
+
if (AllocateDeviceID(psSysData, &psDeviceNode->sDevId.ui32DeviceIndex) != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR,"PVRSRVRegisterBCDeviceKM: Failed to allocate Device ID"));
*pui32DeviceID = psDeviceNode->sDevId.ui32DeviceIndex;
}
-
+
SysRegisterExternalDevice(psDeviceNode);
-
+
List_PVRSRV_DEVICE_NODE_Insert(&psSysData->psDeviceNodeList, psDeviceNode);
return PVRSRV_OK;
}
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_DISPLAYCLASS_INFO), psDCInfo, IMG_NULL);
-
+
return PVRSRV_ERROR_OUT_OF_MEMORY;
}
SysAcquireData(&psSysData);
-
+
psDeviceNode = (PVRSRV_DEVICE_NODE*)
List_PVRSRV_DEVICE_NODE_Any_va(psSysData->psDeviceNodeList,
&MatchDeviceKM_AnyVaCb,
PVRSRV_DEVICE_CLASS_DISPLAY);
if (!psDeviceNode)
{
-
+
PVR_DPF((PVR_DBG_ERROR,"PVRSRVRemoveDCDeviceKM: requested device %d not present", ui32DevIndex));
return PVRSRV_ERROR_NO_DEVICENODE_FOUND;
}
-
+
psDCInfo = (PVRSRV_DISPLAYCLASS_INFO*)psDeviceNode->pvDevice;
-
+
if(psDCInfo->ui32RefCount == 0)
{
-
+
List_PVRSRV_DEVICE_NODE_Remove(psDeviceNode);
-
+
SysRemoveExternalDevice(psDeviceNode);
-
+
PVR_ASSERT(psDCInfo->ui32RefCount == 0);
(IMG_VOID)OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_DC_SRV2DISP_KMJTABLE), psDCInfo->psFuncTable, IMG_NULL);
psDCInfo->psFuncTable = IMG_NULL;
(IMG_VOID)OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_DISPLAYCLASS_INFO), psDCInfo, IMG_NULL);
-
+
(IMG_VOID)OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_DEVICE_NODE), psDeviceNode, IMG_NULL);
-
+
}
else
{
PVRSRV_BUFFERCLASS_INFO *psBCInfo = IMG_NULL;
PVRSRV_DEVICE_NODE *psDeviceNode;
SYS_DATA *psSysData;
-
+
SysAcquireData(&psSysData);
+
-
-
+
if(OSAllocMem( PVRSRV_OS_PAGEABLE_HEAP,
sizeof(*psBCInfo),
(IMG_VOID **)&psBCInfo, IMG_NULL,
}
OSMemSet (psBCInfo, 0, sizeof(*psBCInfo));
-
+
if(OSAllocMem( PVRSRV_OS_PAGEABLE_HEAP,
sizeof(PVRSRV_BC_SRV2BUFFER_KMJTABLE),
(IMG_VOID **)&psBCInfo->psFuncTable, IMG_NULL,
}
OSMemSet (psBCInfo->psFuncTable, 0, sizeof(PVRSRV_BC_SRV2BUFFER_KMJTABLE));
-
+
*psBCInfo->psFuncTable = *psFuncTable;
-
+
if(OSAllocMem( PVRSRV_OS_NON_PAGEABLE_HEAP,
sizeof(PVRSRV_DEVICE_NODE),
(IMG_VOID **)&psDeviceNode, IMG_NULL,
psDeviceNode->sDevId.eDeviceClass = PVRSRV_DEVICE_CLASS_BUFFER;
psDeviceNode->psSysData = psSysData;
-
+
if (AllocateDeviceID(psSysData, &psDeviceNode->sDevId.ui32DeviceIndex) != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR,"PVRSRVRegisterBCDeviceKM: Failed to allocate Device ID"));
*pui32DeviceID = psDeviceNode->sDevId.ui32DeviceIndex;
}
-
+
List_PVRSRV_DEVICE_NODE_Insert(&psSysData->psDeviceNodeList, psDeviceNode);
return PVRSRV_OK;
}
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_BUFFERCLASS_INFO), psBCInfo, IMG_NULL);
-
+
return PVRSRV_ERROR_OUT_OF_MEMORY;
}
SysAcquireData(&psSysData);
-
+
psDevNode = (PVRSRV_DEVICE_NODE*)
List_PVRSRV_DEVICE_NODE_Any_va(psSysData->psDeviceNodeList,
&MatchDeviceKM_AnyVaCb,
return PVRSRV_ERROR_NO_DEVICENODE_FOUND;
}
-
-
+
+
psBCInfo = (PVRSRV_BUFFERCLASS_INFO*)psDevNode->pvDevice;
-
+
if(psBCInfo->ui32RefCount == 0)
{
-
+
List_PVRSRV_DEVICE_NODE_Remove(psDevNode);
-
+
(IMG_VOID)FreeDeviceID(psSysData, ui32DevIndex);
-
-
+
+
(IMG_VOID)OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_BC_SRV2BUFFER_KMJTABLE), psBCInfo->psFuncTable, IMG_NULL);
psBCInfo->psFuncTable = IMG_NULL;
(IMG_VOID)OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_BUFFERCLASS_INFO), psBCInfo, IMG_NULL);
-
+
(IMG_VOID)OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_DEVICE_NODE), psDevNode, IMG_NULL);
-
+
}
else
{
psDCPerContextInfo = (PVRSRV_DISPLAYCLASS_PERCONTEXT_INFO *)hDeviceKM;
-
+
eError = ResManFreeResByPtr(psDCPerContextInfo->hResItem, CLEANUP_WITH_POLL);
return eError;
&psDCInfo->sSystemBuffer.sDeviceClassBuffer,
psDCInfo->sSystemBuffer.sDeviceClassBuffer.ui32MemMapRefCount));
#if 0
-
+
return PVRSRV_ERROR_STILL_MAPPED;
#endif
}
psDCInfo->ui32RefCount--;
if(psDCInfo->ui32RefCount == 0)
{
-
+
psDCInfo->psFuncTable->pfnCloseDCDevice(psDCInfo->hExtDevice);
PVRSRVKernelSyncInfoDecRef(psDCInfo->sSystemBuffer.sDeviceClassBuffer.psKernelSyncInfo, IMG_NULL);
}
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_DISPLAYCLASS_PERCONTEXT_INFO), psDCPerContextInfo, IMG_NULL);
-
+
return PVRSRV_OK;
}
SysAcquireData(&psSysData);
-
+
psDeviceNode = (PVRSRV_DEVICE_NODE*)
List_PVRSRV_DEVICE_NODE_Any_va(psSysData->psDeviceNodeList,
&MatchDeviceKM_AnyVaCb,
}
psDCInfo = (PVRSRV_DISPLAYCLASS_INFO*)psDeviceNode->pvDevice;
-
+
if(OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
psDeviceNode = (PVRSRV_DEVICE_NODE *)hDevCookie;
-
+
psDCInfo->hDevMemContext = (IMG_HANDLE)psDeviceNode->sDevMemoryInfo.pBMKernelContext;
-
+
eError = PVRSRVAllocSyncInfoKM(IMG_NULL,
(IMG_HANDLE)psDeviceNode->sDevMemoryInfo.pBMKernelContext,
&psDCInfo->sSystemBuffer.sDeviceClassBuffer.psKernelSyncInfo);
return eError;
}
-
+
eError = psDCInfo->psFuncTable->pfnOpenDCDevice(ui32DeviceID,
&psDCInfo->hExtDevice,
(PVRSRV_SYNC_DATA*)psDCInfo->sSystemBuffer.sDeviceClassBuffer.psKernelSyncInfo->psSyncDataMemInfoKM->pvLinAddrKM);
0,
&CloseDCDeviceCallBack);
-
+
*phDeviceKM = (IMG_HANDLE)psDCPerContextInfo;
return PVRSRV_OK;
psDCInfo = DCDeviceHandleToDCInfo(hDeviceKM);
-
+
return psDCInfo->psFuncTable->pfnEnumDCFormats(psDCInfo->hExtDevice, pui32Count, psFormat);
}
{
PVRSRV_DISPLAYCLASS_INFO *psDCInfo;
- if(!hDeviceKM || !pui32Count || !psFormat)
+ if(!hDeviceKM || !pui32Count || !psFormat)
{
PVR_DPF((PVR_DBG_ERROR,"PVRSRVEnumDCDimsKM: Invalid parameters"));
return PVRSRV_ERROR_INVALID_PARAMS;
psDCInfo = DCDeviceHandleToDCInfo(hDeviceKM);
-
+
return psDCInfo->psFuncTable->pfnEnumDCDims(psDCInfo->hExtDevice, psFormat, pui32Count, psDim);
}
psDCInfo = DCDeviceHandleToDCInfo(hDeviceKM);
-
+
eError = psDCInfo->psFuncTable->pfnGetDCSystemBuffer(psDCInfo->hExtDevice, &hExtBuffer);
if(eError != PVRSRV_OK)
{
return eError;
}
-
+
psDCInfo->sSystemBuffer.sDeviceClassBuffer.pfnGetBufferAddr = psDCInfo->psFuncTable->pfnGetBufferAddr;
psDCInfo->sSystemBuffer.sDeviceClassBuffer.hDevMemContext = psDCInfo->hDevMemContext;
psDCInfo->sSystemBuffer.sDeviceClassBuffer.hExtDevice = psDCInfo->hExtDevice;
psDCInfo->sSystemBuffer.psDCInfo = psDCInfo;
-
+
if (phBuffer)
{
*phBuffer = (IMG_HANDLE)&(psDCInfo->sSystemBuffer);
psDCInfo = DCDeviceHandleToDCInfo(hDeviceKM);
-
+
eError = psDCInfo->psFuncTable->pfnGetDCInfo(psDCInfo->hExtDevice, psDisplayInfo);
if (eError != PVRSRV_OK)
{
PVRSRV_DISPLAYCLASS_INFO *psDCInfo = psSwapChain->psDCInfo;
IMG_UINT32 i;
-
+
if( psDCInfo->psDCSwapChainShared )
{
if( psDCInfo->psDCSwapChainShared == psSwapChain )
{
psDCInfo->psDCSwapChainShared = psSwapChain->psNext;
}
- else
+ else
{
PVRSRV_DC_SWAPCHAIN *psCurrentSwapChain;
- psCurrentSwapChain = psDCInfo->psDCSwapChainShared;
+ psCurrentSwapChain = psDCInfo->psDCSwapChainShared;
while( psCurrentSwapChain->psNext )
{
- if( psCurrentSwapChain->psNext != psSwapChain )
+ if( psCurrentSwapChain->psNext != psSwapChain )
{
psCurrentSwapChain = psCurrentSwapChain->psNext;
continue;
}
psCurrentSwapChain->psNext = psSwapChain->psNext;
- break;
+ break;
}
}
}
-
+
PVRSRVDestroyCommandQueueKM(psSwapChain->psQueue);
-
+
eError = psDCInfo->psFuncTable->pfnDestroyDCSwapChain(psDCInfo->hExtDevice,
psSwapChain->hExtSwapChain);
return eError;
}
-
+
for(i=0; i<psSwapChain->ui32BufferCount; i++)
{
if(psSwapChain->asBuffer[i].sDeviceClassBuffer.psKernelSyncInfo)
#endif
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_DC_SWAPCHAIN), psSwapChain, IMG_NULL);
-
+
return eError;
}
&psSwapChainRef->psSwapChain->asBuffer[i].sDeviceClassBuffer,
psSwapChainRef->psSwapChain->asBuffer[i].sDeviceClassBuffer.ui32MemMapRefCount));
#if 0
-
+
return PVRSRV_ERROR_STILL_MAPPED;
#endif
}
}
- if(--psSwapChainRef->psSwapChain->ui32RefCount == 0)
+ if(--psSwapChainRef->psSwapChain->ui32RefCount == 0)
{
eError = DestroyDCSwapChain(psSwapChainRef->psSwapChain);
}
{
PVRSRV_DC_SWAPCHAIN *psCurrentSwapChain;
- for(psCurrentSwapChain = psDCInfo->psDCSwapChainShared;
- psCurrentSwapChain;
- psCurrentSwapChain = psCurrentSwapChain->psNext)
+ for(psCurrentSwapChain = psDCInfo->psDCSwapChainShared;
+ psCurrentSwapChain;
+ psCurrentSwapChain = psCurrentSwapChain->psNext)
{
if(psCurrentSwapChain->ui32SwapChainID == ui32SwapChainID)
return psCurrentSwapChain;
}
static PVRSRV_ERROR PVRSRVCreateDCSwapChainRefKM(PVRSRV_PER_PROCESS_DATA *psPerProc,
- PVRSRV_DC_SWAPCHAIN *psSwapChain,
+ PVRSRV_DC_SWAPCHAIN *psSwapChain,
PVRSRV_DC_SWAPCHAIN_REF **ppsSwapChainRef)
{
PVRSRV_DC_SWAPCHAIN_REF *psSwapChainRef = IMG_NULL;
-
+
if(OSAllocMem( PVRSRV_OS_PAGEABLE_HEAP,
sizeof(PVRSRV_DC_SWAPCHAIN_REF),
(IMG_VOID **)&psSwapChainRef, IMG_NULL,
}
OSMemSet (psSwapChainRef, 0, sizeof(PVRSRV_DC_SWAPCHAIN_REF));
-
+
psSwapChain->ui32RefCount++;
-
+
psSwapChainRef->psSwapChain = psSwapChain;
psSwapChainRef->hResItem = ResManRegisterRes(psPerProc->hResManContext,
RESMAN_TYPE_DISPLAYCLASS_SWAPCHAIN_REF,
if( ui32Flags & PVRSRV_CREATE_SWAPCHAIN_QUERY )
{
-
+
psSwapChain = PVRSRVFindSharedDCSwapChainKM(psDCInfo, *pui32SwapChainID );
- if( psSwapChain )
- {
-
- eError = PVRSRVCreateDCSwapChainRefKM(psPerProc,
- psSwapChain,
+ if( psSwapChain )
+ {
+
+ eError = PVRSRVCreateDCSwapChainRefKM(psPerProc,
+ psSwapChain,
&psSwapChainRef);
- if( eError != PVRSRV_OK )
+ if( eError != PVRSRV_OK )
{
PVR_DPF((PVR_DBG_ERROR,"PVRSRVCreateDCSwapChainKM: Couldn't create swap chain reference"));
return eError;
return PVRSRV_OK;
}
PVR_DPF((PVR_DBG_ERROR,"PVRSRVCreateDCSwapChainKM: No shared SwapChain found for query"));
- return PVRSRV_ERROR_FLIP_CHAIN_EXISTS;
+ return PVRSRV_ERROR_FLIP_CHAIN_EXISTS;
}
-
+
if(OSAllocMem( PVRSRV_OS_PAGEABLE_HEAP,
sizeof(PVRSRV_DC_SWAPCHAIN),
(IMG_VOID **)&psSwapChain, IMG_NULL,
}
OSMemSet (psSwapChain, 0, sizeof(PVRSRV_DC_SWAPCHAIN));
-
+
eError = PVRSRVCreateCommandQueueKM(1024, &psQueue);
if(eError != PVRSRV_OK)
{
goto ErrorExit;
}
-
+
psSwapChain->psQueue = psQueue;
-
+
for(i=0; i<ui32BufferCount; i++)
{
eError = PVRSRVAllocSyncInfoKM(IMG_NULL,
PVRSRVKernelSyncInfoIncRef(psSwapChain->asBuffer[i].sDeviceClassBuffer.psKernelSyncInfo, IMG_NULL);
-
+
psSwapChain->asBuffer[i].sDeviceClassBuffer.pfnGetBufferAddr = psDCInfo->psFuncTable->pfnGetBufferAddr;
psSwapChain->asBuffer[i].sDeviceClassBuffer.hDevMemContext = psDCInfo->hDevMemContext;
psSwapChain->asBuffer[i].sDeviceClassBuffer.hExtDevice = psDCInfo->hExtDevice;
-
+
psSwapChain->asBuffer[i].psDCInfo = psDCInfo;
psSwapChain->asBuffer[i].psSwapChain = psSwapChain;
-
+
apsSyncData[i] = (PVRSRV_SYNC_DATA*)psSwapChain->asBuffer[i].sDeviceClassBuffer.psKernelSyncInfo->psSyncDataMemInfoKM->pvLinAddrKM;
}
PVR_DPF((PVR_DBG_ERROR,"PVRSRVCreateDCSwapChainKM: Failed to get DC info"));
return eError;
}
-
+
psSwapChain->ui32MinSwapInterval = sDisplayInfo.ui32MinSwapInterval;
psSwapChain->ui32MaxSwapInterval = sDisplayInfo.ui32MaxSwapInterval;
-
+
eError = psDCInfo->psFuncTable->pfnCreateDCSwapChain(psDCInfo->hExtDevice,
ui32Flags,
psDstSurfAttrib,
goto ErrorExit;
}
-
- eError = PVRSRVCreateDCSwapChainRefKM(psPerProc,
- psSwapChain,
+
+ eError = PVRSRVCreateDCSwapChainRefKM(psPerProc,
+ psSwapChain,
&psSwapChainRef);
- if( eError != PVRSRV_OK )
+ if( eError != PVRSRV_OK )
{
PVR_DPF((PVR_DBG_ERROR,"PVRSRVCreateDCSwapChainKM: Couldn't create swap chain reference"));
PDUMPCOMMENT("Swapchain allocation failed.");
psSwapChain->ui32RefCount = 1;
psSwapChain->ui32Flags = ui32Flags;
-
+
if( ui32Flags & PVRSRV_CREATE_SWAPCHAIN_SHARED )
{
- if(! psDCInfo->psDCSwapChainShared )
+ if(! psDCInfo->psDCSwapChainShared )
{
psDCInfo->psDCSwapChainShared = psSwapChain;
- }
- else
- {
+ }
+ else
+ {
PVRSRV_DC_SWAPCHAIN *psOldHead = psDCInfo->psDCSwapChainShared;
psDCInfo->psDCSwapChainShared = psSwapChain;
psSwapChain->psNext = psOldHead;
}
}
-
+
*pui32SwapChainID = psSwapChain->ui32SwapChainID;
-
+
*phSwapChainRef= (IMG_HANDLE)psSwapChainRef;
return eError;
if(psSwapChain)
{
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_DC_SWAPCHAIN), psSwapChain, IMG_NULL);
-
+
}
return eError;
psDCInfo = DCDeviceHandleToDCInfo(hDeviceKM);
psSwapChain = ((PVRSRV_DC_SWAPCHAIN_REF*)hSwapChainRef)->psSwapChain;
-
+
eError = psDCInfo->psFuncTable->pfnGetDCBuffers(psDCInfo->hExtDevice,
psSwapChain->hExtSwapChain,
pui32BufferCount,
PVR_ASSERT(*pui32BufferCount <= PVRSRV_MAX_DC_SWAPCHAIN_BUFFERS);
-
+
for(i=0; i<*pui32BufferCount; i++)
psBuffer = (PVRSRV_DC_BUFFER*)hBuffer;
psDCInfo = DCDeviceHandleToDCInfo(hDeviceKM);
-
+
if(ui32SwapInterval < psBuffer->psSwapChain->ui32MinSwapInterval ||
ui32SwapInterval > psBuffer->psSwapChain->ui32MaxSwapInterval)
{
{
psDCInfo->psFuncTable->pfnQuerySwapCommandID(psDCInfo->hExtDevice,
psBuffer->psSwapChain->hExtSwapChain,
- psBuffer->sDeviceClassBuffer.hExtBuffer,
- hPrivateTag,
+ psBuffer->sDeviceClassBuffer.hExtBuffer,
+ hPrivateTag,
&ui16SwapCommandID,
&bAddReferenceToLast);
-
+
}
#endif
-
+
psQueue = psBuffer->psSwapChain->psQueue;
-
+
apsSrcSync[0] = psBuffer->sDeviceClassBuffer.psKernelSyncInfo;
-
+
if(bAddReferenceToLast && psBuffer->psSwapChain->psLastFlipBuffer &&
psBuffer != psBuffer->psSwapChain->psLastFlipBuffer)
{
apsSrcSync[1] = psBuffer->psSwapChain->psLastFlipBuffer->sDeviceClassBuffer.psKernelSyncInfo;
-
+
ui32NumSrcSyncs++;
}
-
+
eError = PVRSRVInsertCommandKM (psQueue,
&psCommand,
psDCInfo->ui32DeviceID,
goto Exit;
}
-
+
psFlipCmd = (DISPLAYCLASS_FLIP_COMMAND*)psCommand->pvData;
-
+
psFlipCmd->hExtDevice = psDCInfo->hExtDevice;
-
+
psFlipCmd->hExtSwapChain = psBuffer->psSwapChain->hExtSwapChain;
-
+
psFlipCmd->hExtBuffer = psBuffer->sDeviceClassBuffer.hExtBuffer;
-
+
psFlipCmd->hPrivateTag = hPrivateTag;
-
+
psFlipCmd->ui32ClipRectCount = ui32ClipRectCount;
-
- psFlipCmd->psClipRect = (IMG_RECT*)((IMG_UINT8*)psFlipCmd + sizeof(DISPLAYCLASS_FLIP_COMMAND));
-
+
+ psFlipCmd->psClipRect = (IMG_RECT*)((IMG_UINT8*)psFlipCmd + sizeof(DISPLAYCLASS_FLIP_COMMAND));
+
for(i=0; i<ui32ClipRectCount; i++)
{
psFlipCmd->psClipRect[i] = psClipRect[i];
}
-
+
psFlipCmd->ui32SwapInterval = ui32SwapInterval;
SysAcquireData(&psSysData);
goto Exit;
}
+
-
- eError = OSScheduleMISR(psSysData);
+ eError = OSScheduleMISR(psSysData);
if (eError != PVRSRV_OK)
{
goto Exit;
}
-
+
psBuffer->psSwapChain->psLastFlipBuffer = psBuffer;
psDCInfo->psDCSwapChainCur = psBuffer->psSwapChain;
psCallbackData->pvPrivData = pvPrivData;
psCallbackData->ui32PrivDataLength = ui32PrivDataLength;
+
if(OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
sizeof(IMG_VOID *) * ui32NumMemSyncInfos,
(IMG_VOID **)&ppvMemInfos, IMG_NULL,
ui32NumCompiledSyncInfos = ui32NumMemSyncInfos + ui32NumUniqueSyncInfos;
+
if(OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
sizeof(PVRSRV_KERNEL_SYNC_INFO *) * ui32NumCompiledSyncInfos,
(IMG_VOID **)&ppsCompiledSyncInfos, IMG_NULL,
psFlipCmd->ppsMemInfos = (PDC_MEM_INFO *)ppvMemInfos;
psFlipCmd->ui32NumMemInfos = ui32NumMemSyncInfos;
-
- psFlipCmd->hUnused = IMG_NULL;
-
SysAcquireData(&psSysData);
psSwapChainRef = (PVRSRV_DC_SWAPCHAIN_REF*)hSwapChainRef;
psSwapChain = psSwapChainRef->psSwapChain;
-
+
psQueue = psSwapChain->psQueue;
#if defined(SUPPORT_CUSTOM_SWAP_OPERATIONS)
{
psDCInfo->psFuncTable->pfnQuerySwapCommandID(psDCInfo->hExtDevice,
psSwapChain->hExtSwapChain,
- psDCInfo->sSystemBuffer.sDeviceClassBuffer.hExtBuffer,
- 0,
+ psDCInfo->sSystemBuffer.sDeviceClassBuffer.hExtBuffer,
+ 0,
&ui16SwapCommandID,
&bAddReferenceToLast);
-
+
}
#endif
-
+
apsSrcSync[0] = psDCInfo->sSystemBuffer.sDeviceClassBuffer.psKernelSyncInfo;
-
+
if(bAddReferenceToLast && psSwapChain->psLastFlipBuffer)
{
-
+
if (apsSrcSync[0] != psSwapChain->psLastFlipBuffer->sDeviceClassBuffer.psKernelSyncInfo)
{
apsSrcSync[1] = psSwapChain->psLastFlipBuffer->sDeviceClassBuffer.psKernelSyncInfo;
-
+
ui32NumSrcSyncs++;
}
}
-
+
eError = PVRSRVInsertCommandKM (psQueue,
&psCommand,
psDCInfo->ui32DeviceID,
goto Exit;
}
-
+
psFlipCmd = (DISPLAYCLASS_FLIP_COMMAND*)psCommand->pvData;
-
+
psFlipCmd->hExtDevice = psDCInfo->hExtDevice;
-
+
psFlipCmd->hExtSwapChain = psSwapChain->hExtSwapChain;
-
+
psFlipCmd->hExtBuffer = psDCInfo->sSystemBuffer.sDeviceClassBuffer.hExtBuffer;
-
+
psFlipCmd->hPrivateTag = IMG_NULL;
-
+
psFlipCmd->ui32ClipRectCount = 0;
psFlipCmd->ui32SwapInterval = 1;
-
+
eError = PVRSRVSubmitCommandKM (psQueue, psCommand);
if (eError != PVRSRV_OK)
{
goto Exit;
}
-
+
SysAcquireData(&psSysData);
eError = OSScheduleMISR(psSysData);
goto Exit;
}
-
+
psSwapChain->psLastFlipBuffer = &psDCInfo->sSystemBuffer;
psDCInfo->psDCSwapChainCur = psSwapChain;
{
return eError;
}
-#endif
+#endif
psDCInfo = DCDeviceHandleToDCInfo(hDeviceKM);
psSwapChain = psDCInfo->psDCSwapChainCur;
SysAcquireData(&psSysData);
-
+
psDevNode = (PVRSRV_DEVICE_NODE*)
List_PVRSRV_DEVICE_NODE_Any_va(psSysData->psDeviceNodeList,
&MatchDeviceKM_AnyVaCb,
return PVRSRV_ERROR_NO_DEVICENODE_FOUND;
}
-
+
psDevNode->pvISRData = (IMG_VOID*) pvISRHandlerData;
-
+
psDevNode->pfnDeviceISR = pfnISRHandler;
return PVRSRV_OK;
psBCPerContextInfo = (PVRSRV_BUFFERCLASS_PERCONTEXT_INFO *)hDeviceKM;
-
+
eError = ResManFreeResByPtr(psBCPerContextInfo->hResItem, CLEANUP_WITH_POLL);
return eError;
if(psBCInfo->ui32RefCount > 0)
{
// reference count may be not increased if buffer count is zero
- psBCInfo->ui32RefCount--;
+ psBCInfo->ui32RefCount--;
}
if(psBCInfo->ui32RefCount == 0)
{
-
+
psBCInfo->psFuncTable->pfnCloseBCDevice(psBCInfo->ui32DeviceID, psBCInfo->hExtDevice);
-
+
for(i=0; i<psBCInfo->ui32BufferCount; i++)
{
if(psBCInfo->psBuffer[i].sDeviceClassBuffer.psKernelSyncInfo)
}
}
-
+
if(psBCInfo->psBuffer)
{
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_BC_BUFFER) * psBCInfo->ui32BufferCount, psBCInfo->psBuffer, IMG_NULL);
}
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_BUFFERCLASS_PERCONTEXT_INFO), psBCPerContextInfo, IMG_NULL);
-
+
return PVRSRV_OK;
}
SysAcquireData(&psSysData);
-
+
psDeviceNode = (PVRSRV_DEVICE_NODE*)
List_PVRSRV_DEVICE_NODE_Any_va(psSysData->psDeviceNodeList,
&MatchDeviceKM_AnyVaCb,
}
psBCInfo = (PVRSRV_BUFFERCLASS_INFO*)psDeviceNode->pvDevice;
-
+
if(OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
psDeviceNode = (PVRSRV_DEVICE_NODE *)hDevCookie;
-
+
psBCInfo->hDevMemContext = (IMG_HANDLE)psDeviceNode->sDevMemoryInfo.pBMKernelContext;
-
+
eError = psBCInfo->psFuncTable->pfnOpenBCDevice(ui32DeviceID, &psBCInfo->hExtDevice);
if(eError != PVRSRV_OK)
{
return eError;
}
-
+
eError = psBCInfo->psFuncTable->pfnGetBCInfo(psBCInfo->hExtDevice, &sBufferInfo);
if(eError != PVRSRV_OK)
{
return eError;
}
-
+
psBCInfo->ui32BufferCount = sBufferInfo.ui32BufferCount;
if(sBufferInfo.ui32BufferCount == 0)
// reference count is not increased if buffer count is zero
psBCInfo->ui32RefCount = 0;
}
-
+
eError = OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
sizeof(PVRSRV_BC_BUFFER) * sBufferInfo.ui32BufferCount,
(IMG_VOID **)&psBCInfo->psBuffer,
for(i=0; i<psBCInfo->ui32BufferCount; i++)
{
-
+
eError = PVRSRVAllocSyncInfoKM(IMG_NULL,
psBCInfo->hDevMemContext,
&psBCInfo->psBuffer[i].sDeviceClassBuffer.psKernelSyncInfo);
}
PVRSRVKernelSyncInfoIncRef(psBCInfo->psBuffer[i].sDeviceClassBuffer.psKernelSyncInfo, IMG_NULL);
-
-
+
+
eError = psBCInfo->psFuncTable->pfnGetBCBuffer(psBCInfo->hExtDevice,
goto ErrorExit;
}
-
+
psBCInfo->psBuffer[i].sDeviceClassBuffer.pfnGetBufferAddr = psBCInfo->psFuncTable->pfnGetBufferAddr;
psBCInfo->psBuffer[i].sDeviceClassBuffer.hDevMemContext = psBCInfo->hDevMemContext;
psBCInfo->psBuffer[i].sDeviceClassBuffer.hExtDevice = psBCInfo->hExtDevice;
0,
&CloseBCDeviceCallBack);
-
+
*phDeviceKM = (IMG_HANDLE)psBCPerContextInfo;
return PVRSRV_OK;
}
}
-
+
if(psBCInfo->psBuffer)
{
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_BC_BUFFER), psBCInfo->psBuffer, IMG_NULL);
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
PVRSRV_ERROR AllocateDeviceID(SYS_DATA *psSysData, IMG_UINT32 *pui32DevID);
PVRSRV_ERROR FreeDeviceID(SYS_DATA *psSysData, IMG_UINT32 ui32DevID);
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
typedef struct _RESMAN_MAP_DEVICE_MEM_DATA_
{
-
+
PVRSRV_KERNEL_MEM_INFO *psMemInfo;
-
+
PVRSRV_KERNEL_MEM_INFO *psSrcMemInfo;
} RESMAN_MAP_DEVICE_MEM_DATA;
psDeviceNode = (PVRSRV_DEVICE_NODE *)hDevCookie;
-
+
ui32HeapCount = psDeviceNode->sDevMemoryInfo.ui32HeapCount;
psDeviceMemoryHeap = psDeviceNode->sDevMemoryInfo.psDeviceMemoryHeap;
-
+
PVR_ASSERT(ui32HeapCount <= PVRSRV_MAX_CLIENT_HEAPS);
-
+
for(i=0; i<ui32HeapCount; i++)
{
-
+
psHeapInfo[i].ui32HeapID = psDeviceMemoryHeap[i].ui32HeapID;
psHeapInfo[i].hDevMemHeap = psDeviceMemoryHeap[i].hDevMemHeap;
psHeapInfo[i].sDevVAddrBase = psDeviceMemoryHeap[i].sDevVAddrBase;
psDeviceNode = (PVRSRV_DEVICE_NODE *)hDevCookie;
-
+
ui32HeapCount = psDeviceNode->sDevMemoryInfo.ui32HeapCount;
psDeviceMemoryHeap = psDeviceNode->sDevMemoryInfo.psDeviceMemoryHeap;
-
+
PVR_ASSERT(ui32HeapCount <= PVRSRV_MAX_CLIENT_HEAPS);
-
+
hDevMemContext = BM_CreateContext(psDeviceNode,
&sPDDevPAddr,
return PVRSRV_ERROR_OUT_OF_MEMORY;
}
-
+
for(i=0; i<ui32HeapCount; i++)
{
switch(psDeviceMemoryHeap[i].DevMemHeapType)
{
case DEVICE_MEMORY_HEAP_SHARED_EXPORTED:
{
-
+
psHeapInfo[ui32ClientHeapCount].ui32HeapID = psDeviceMemoryHeap[i].ui32HeapID;
psHeapInfo[ui32ClientHeapCount].hDevMemHeap = psDeviceMemoryHeap[i].hDevMemHeap;
psHeapInfo[ui32ClientHeapCount].sDevVAddrBase = psDeviceMemoryHeap[i].sDevVAddrBase;
hDevMemHeap = IMG_NULL;
}
-
+
psHeapInfo[ui32ClientHeapCount].ui32HeapID = psDeviceMemoryHeap[i].ui32HeapID;
psHeapInfo[ui32ClientHeapCount].hDevMemHeap = hDevMemHeap;
psHeapInfo[ui32ClientHeapCount].sDevVAddrBase = psDeviceMemoryHeap[i].sDevVAddrBase;
}
}
-
+
*pui32ClientHeapCount = ui32ClientHeapCount;
*phDevMemContext = hDevMemContext;
psDeviceNode = (PVRSRV_DEVICE_NODE *)hDevCookie;
-
+
ui32HeapCount = psDeviceNode->sDevMemoryInfo.ui32HeapCount;
psDeviceMemoryHeap = psDeviceNode->sDevMemoryInfo.psDeviceMemoryHeap;
-
+
PVR_ASSERT(ui32HeapCount <= PVRSRV_MAX_CLIENT_HEAPS);
-
+
for(i=0; i<ui32HeapCount; i++)
{
switch(psDeviceMemoryHeap[i].DevMemHeapType)
{
case DEVICE_MEMORY_HEAP_SHARED_EXPORTED:
{
-
+
psHeapInfo[ui32ClientHeapCount].ui32HeapID = psDeviceMemoryHeap[i].ui32HeapID;
psHeapInfo[ui32ClientHeapCount].hDevMemHeap = psDeviceMemoryHeap[i].hDevMemHeap;
psHeapInfo[ui32ClientHeapCount].sDevVAddrBase = psDeviceMemoryHeap[i].sDevVAddrBase;
{
hDevMemHeap = BM_CreateHeap(hDevMemContext,
&psDeviceMemoryHeap[i]);
-
+
if (hDevMemHeap == IMG_NULL)
{
return PVRSRV_ERROR_OUT_OF_MEMORY;
hDevMemHeap = IMG_NULL;
}
-
+
psHeapInfo[ui32ClientHeapCount].ui32HeapID = psDeviceMemoryHeap[i].ui32HeapID;
psHeapInfo[ui32ClientHeapCount].hDevMemHeap = hDevMemHeap;
psHeapInfo[ui32ClientHeapCount].sDevVAddrBase = psDeviceMemoryHeap[i].sDevVAddrBase;
}
}
-
+
*pui32ClientHeapCount = ui32ClientHeapCount;
return PVRSRV_OK;
{
PVRSRV_KERNEL_MEM_INFO *psMemInfo;
BM_HANDLE hBuffer;
-
+
PVRSRV_MEMBLK *psMemBlock;
IMG_BOOL bBMError;
psMemBlock = &(psMemInfo->sMemBlk);
-
+
psMemInfo->ui32Flags = ui32Flags | PVRSRV_MEM_RAM_BACKED_ALLOCATION;
bBMError = BM_Alloc (hDevMemHeap,
{
PVR_DPF((PVR_DBG_ERROR,"AllocDeviceMem: BM_Alloc Failed"));
OSFreeMem(PVRSRV_PAGEABLE_SELECT, sizeof(PVRSRV_KERNEL_MEM_INFO), psMemInfo, IMG_NULL);
-
+
return PVRSRV_ERROR_OUT_OF_MEMORY;
}
-
+
psMemBlock->sDevVirtAddr = BM_HandleToDevVaddr(hBuffer);
psMemBlock->hOSMemHandle = BM_HandleToOSMemHandle(hBuffer);
-
+
psMemBlock->hBuffer = (IMG_HANDLE)hBuffer;
-
+
psMemInfo->pvLinAddrKM = BM_HandleToCpuVaddr(hBuffer);
psMemInfo->uAllocSize = ui32Size;
-
+
psMemInfo->pvSysBackupBuffer = IMG_NULL;
-
+
*ppsMemInfo = psMemInfo;
-
+
return (PVRSRV_OK);
}
hBuffer = psMemInfo->sMemBlk.hBuffer;
-
+
switch(eCallbackOrigin)
{
case PVRSRV_FREE_CALLBACK_ORIGIN_ALLOCATOR:
break;
}
-
+
if (psMemInfo->pvSysBackupBuffer &&
eCallbackOrigin == PVRSRV_FREE_CALLBACK_ORIGIN_ALLOCATOR)
{
-
+
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, psMemInfo->uAllocSize, psMemInfo->pvSysBackupBuffer, IMG_NULL);
psMemInfo->pvSysBackupBuffer = IMG_NULL;
}
if (psMemInfo->ui32RefCount == 0)
OSFreeMem(PVRSRV_PAGEABLE_SELECT, sizeof(PVRSRV_KERNEL_MEM_INFO), psMemInfo, IMG_NULL);
-
+
return(PVRSRV_OK);
}
hBuffer = psMemInfo->sMemBlk.hBuffer;
-
+
BM_Free(hBuffer, psMemInfo->ui32Flags);
if(psMemInfo->pvSysBackupBuffer)
{
-
+
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, psMemInfo->uAllocSize, psMemInfo->pvSysBackupBuffer, IMG_NULL);
psMemInfo->pvSysBackupBuffer = IMG_NULL;
}
OSFreeMem(PVRSRV_PAGEABLE_SELECT, sizeof(PVRSRV_KERNEL_MEM_INFO), psMemInfo, IMG_NULL);
-
+
return(PVRSRV_OK);
}
psKernelSyncInfo->ui32RefCount = 0;
-
+
pBMContext = (BM_CONTEXT*)hDevMemContext;
psDevMemoryInfo = &pBMContext->psDeviceNode->sDevMemoryInfo;
-
+
hSyncDevMemHeap = psDevMemoryInfo->psDeviceMemoryHeap[psDevMemoryInfo->ui32SyncHeapID].hDevMemHeap;
-
+
eError = AllocDeviceMem(hDevCookie,
PVR_DPF((PVR_DBG_ERROR,"PVRSRVAllocSyncInfoKM: Failed to alloc memory"));
OSFreeMem(PVRSRV_PAGEABLE_SELECT, sizeof(PVRSRV_KERNEL_SYNC_INFO), psKernelSyncInfo, IMG_NULL);
-
+
return PVRSRV_ERROR_OUT_OF_MEMORY;
}
-
+
psKernelSyncInfo->psSyncData = psKernelSyncInfo->psSyncDataMemInfoKM->pvLinAddrKM;
psSyncData = psKernelSyncInfo->psSyncData;
psKernelSyncInfo->sReadOps2CompleteDevVAddr.uiAddr = psKernelSyncInfo->psSyncDataMemInfoKM->sDevVAddr.uiAddr + offsetof(PVRSRV_SYNC_DATA, ui32ReadOps2Complete);
psKernelSyncInfo->ui32UID = g_ui32SyncUID++;
-
+
psKernelSyncInfo->psSyncDataMemInfoKM->psKernelSyncInfo = IMG_NULL;
-
+
*ppsKernelSyncInfo = psKernelSyncInfo;
return PVRSRV_OK;
if (psKernelSyncInfo->ui32RefCount != 0)
{
PVR_DPF((PVR_DBG_ERROR, "oops: sync info ref count not zero at destruction"));
-
- return PVRSRV_ERROR_OUT_OF_MEMORY;
+
+ return PVRSRV_ERROR_OUT_OF_MEMORY;
}
eError = FreeDeviceMem(psKernelSyncInfo->psSyncDataMemInfoKM);
psKernelSyncInfo->psSyncDataMemInfoKM = IMG_NULL;
psKernelSyncInfo->psSyncData = IMG_NULL;
(IMG_VOID)OSFreeMem(PVRSRV_PAGEABLE_SELECT, sizeof(PVRSRV_KERNEL_SYNC_INFO), psKernelSyncInfo, IMG_NULL);
-
+
return eError;
}
{
IMG_HANDLE hOSWrapMem = psMemInfo->sMemBlk.hOSWrapMem;
-
+
if(psMemInfo->sMemBlk.psIntSysPAddr)
{
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(IMG_SYS_PHYADDR), psMemInfo->sMemBlk.psIntSysPAddr, IMG_NULL);
ui32Tries--;
-
+
if (psSysData->psGlobalEventObject)
{
IMG_HANDLE hOSEventKM;
return PVRSRV_ERROR_INVALID_PARAMS;
}
-
+
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR, "FlushClientOps: Read ops pending timeout"));
- PVR_DBG_BREAK;
+ PVR_DBG_BREAK;
return eError;
}
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR, "FlushClientOps: Write ops pending timeout"));
- PVR_DBG_BREAK;
+ PVR_DBG_BREAK;
}
return eError;
}
-#endif
+#endif
IMG_EXPORT
PVRSRV_ERROR FreeMemCallBackCommon(PVRSRV_KERNEL_MEM_INFO *psMemInfo,
PVR_UNREFERENCED_PARAMETER(ui32Param);
-
+
PVRSRVKernelMemInfoDecRef(psMemInfo);
-
+
if (psMemInfo->ui32RefCount == 0)
{
if((psMemInfo->ui32Flags & PVRSRV_MEM_EXPORTED) != 0)
#endif
switch(psMemInfo->memType)
{
-
+
case PVRSRV_MEMTYPE_WRAPPED:
freeWrapped(psMemInfo);
case PVRSRV_MEMTYPE_DEVICE:
}
}
-
+
if (eError == PVRSRV_OK)
{
eError = FreeDeviceMem2(psMemInfo, eCallbackOrigin);
IMG_BOOL bDummy)
{
PVRSRV_KERNEL_MEM_INFO *psMemInfo = (PVRSRV_KERNEL_MEM_INFO *)pvParam;
-
+
PVR_UNREFERENCED_PARAMETER(bDummy);
return FreeMemCallBackCommon(psMemInfo, ui32Param,
}
else
{
-
+
eError = FreeDeviceMemCallBack(psMemInfo, 0, CLEANUP_WITH_POLL);
}
return PVRSRV_ERROR_INVALID_PARAMS;
}
-
+
if (ui32Flags & PVRSRV_HAP_CACHETYPE_MASK)
{
-
+
if (((ui32Size % HOST_PAGESIZE()) != 0) ||
((ui32Alignment % HOST_PAGESIZE()) != 0))
{
}
else
{
-
+
psBMHeap = (BM_HEAP*)hDevMemHeap;
PVRSRVKernelSyncInfoIncRef(psMemInfo->psKernelSyncInfo, psMemInfo);
}
-
+
*ppsMemInfo = psMemInfo;
if (ui32Flags & PVRSRV_MEM_NO_RESMAN)
}
else
{
-
+
psMemInfo->sMemBlk.hResItem = ResManRegisterRes(psPerProc->hResManContext,
RESMAN_TYPE_DEVICEMEM_ALLOCATION,
psMemInfo,
&FreeDeviceMemCallBack);
if (psMemInfo->sMemBlk.hResItem == IMG_NULL)
{
-
+
eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto free_mainalloc;
}
}
-
+
PVRSRVKernelMemInfoIncRef(psMemInfo);
psMemInfo->memType = PVRSRV_MEMTYPE_DEVICE;
-
+
return (PVRSRV_OK);
free_mainalloc:
IMG_SIZE_T *pui32Free,
IMG_SIZE_T *pui32LargestBlock)
{
-
+
PVR_UNREFERENCED_PARAMETER(ui32Flags);
PVR_UNREFERENCED_PARAMETER(pui32Total);
IMG_BOOL bDummy)
{
PVRSRV_KERNEL_MEM_INFO *psMemInfo = (PVRSRV_KERNEL_MEM_INFO *)pvParam;
-
+
PVR_UNREFERENCED_PARAMETER(bDummy);
return FreeMemCallBackCommon(psMemInfo, ui32Param,
if(pvLinAddr)
{
-
+
uPageOffset = (IMG_UINTPTR_T)pvLinAddr & (ui32HostPageSize - 1);
-
+
uPageCount = HOST_PAGEALIGN(uByteSize + uPageOffset) / ui32HostPageSize;
pvPageAlignedCPUVAddr = (IMG_VOID *)((IMG_UINTPTR_T)pvLinAddr - uPageOffset);
-
+
if(OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
uPageCount * sizeof(IMG_SYS_PHYADDR),
(IMG_VOID **)&psIntSysPAddr, IMG_NULL,
goto ErrorExitPhase1;
}
-
+
psExtSysPAddr = psIntSysPAddr;
-
+
bPhysContig = IMG_FALSE;
}
else
{
-
+
}
-
+
psDevMemoryInfo = &((BM_CONTEXT*)hDevMemContext)->psDeviceNode->sDevMemoryInfo;
psDeviceMemoryHeap = psDevMemoryInfo->psDeviceMemoryHeap;
for(i=0; i<PVRSRV_MAX_CLIENT_HEAPS; i++)
{
if(psDeviceMemoryHeap[i].DevMemHeapType == DEVICE_MEMORY_HEAP_PERCONTEXT)
{
-
+
if (psDeviceMemoryHeap[i].ui32HeapSize > 0)
{
hDevMemHeap = BM_CreateHeap(hDevMemContext, &psDeviceMemoryHeap[i]);
goto ErrorExitPhase3;
}
-
+
psMemBlock->sDevVirtAddr = BM_HandleToDevVaddr(hBuffer);
psMemBlock->hOSMemHandle = BM_HandleToOSMemHandle(hBuffer);
psMemBlock->hOSWrapMem = hOSWrapMem;
psMemBlock->psIntSysPAddr = psIntSysPAddr;
-
+
psMemBlock->hBuffer = (IMG_HANDLE)hBuffer;
-
+
psMemInfo->pvLinAddrKM = BM_HandleToCpuVaddr(hBuffer);
psMemInfo->sDevVAddr = psMemBlock->sDevVirtAddr;
psMemInfo->uAllocSize = uByteSize;
-
+
psMemInfo->pvSysBackupBuffer = IMG_NULL;
-
+
psBMHeap = (BM_HEAP*)hDevMemHeap;
psMemInfo->memType = PVRSRV_MEMTYPE_WRAPPED;
-
+
psMemInfo->sMemBlk.hResItem = ResManRegisterRes(psPerProc->hResManContext,
RESMAN_TYPE_DEVICEMEM_WRAP,
psMemInfo,
0,
&UnwrapExtMemoryCallBack);
-
+
*ppsMemInfo = psMemInfo;
return PVRSRV_OK;
-
+
ErrorExitPhase4:
if(psMemInfo)
{
FreeDeviceMem(psMemInfo);
-
+
psMemInfo = IMG_NULL;
if(psMemInfo)
{
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_KERNEL_MEM_INFO), psMemInfo, IMG_NULL);
-
+
}
ErrorExitPhase2:
if(psIntSysPAddr)
{
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, uPageCount * sizeof(IMG_SYS_PHYADDR), psIntSysPAddr, IMG_NULL);
-
+
}
return eError;
return eError;
}
-
+
eError = FreeMemCallBackCommon(psMapData->psSrcMemInfo, 0,
PVRSRV_FREE_CALLBACK_ORIGIN_IMPORTER);
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(RESMAN_MAP_DEVICE_MEM_DATA), psMapData, IMG_NULL);
-
+
return eError;
}
IMG_VOID *pvPageAlignedCPUVAddr;
RESMAN_MAP_DEVICE_MEM_DATA *psMapData = IMG_NULL;
-
+
if(!psSrcMemInfo || !hDstDevMemHeap || !ppsDstMemInfo)
{
PVR_DPF((PVR_DBG_ERROR,"PVRSRVMapDeviceMemoryKM: invalid parameters"));
return PVRSRV_ERROR_INVALID_PARAMS;
}
-
+
*ppsDstMemInfo = IMG_NULL;
uPageOffset = psSrcMemInfo->sDevVAddr.uiAddr & (ui32HostPageSize - 1);
uPageCount = HOST_PAGEALIGN(psSrcMemInfo->uAllocSize + uPageOffset) / ui32HostPageSize;
pvPageAlignedCPUVAddr = (IMG_VOID *)((IMG_UINTPTR_T)psSrcMemInfo->pvLinAddrKM - uPageOffset);
-
+
psBuf = psSrcMemInfo->sMemBlk.hBuffer;
-
+
psDeviceNode = psBuf->pMapping->pBMHeap->pBMContext->psDeviceNode;
-
+
sDevVAddr.uiAddr = psSrcMemInfo->sDevVAddr.uiAddr - IMG_CAST_TO_DEVVADDR_UINT(uPageOffset);
for(i=0; i<uPageCount; i++)
{
BM_GetPhysPageAddr(psSrcMemInfo, sDevVAddr, &sDevPAddr);
-
+
psSysPAddr[i] = SysDevPAddrToSysPAddr (psDeviceNode->sDevId.eDeviceType, sDevPAddr);
-
+
sDevVAddr.uiAddr += IMG_CAST_TO_DEVVADDR_UINT(ui32HostPageSize);
}
-
+
if(OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
sizeof(RESMAN_MAP_DEVICE_MEM_DATA),
(IMG_VOID **)&psMapData, IMG_NULL,
goto ErrorExit;
}
-
+
psMemBlock->sDevVirtAddr = BM_HandleToDevVaddr(hBuffer);
psMemBlock->hOSMemHandle = BM_HandleToOSMemHandle(hBuffer);
-
+
psMemBlock->hBuffer = (IMG_HANDLE)hBuffer;
-
+
psMemBlock->psIntSysPAddr = psSysPAddr;
-
+
psMemInfo->pvLinAddrKM = psSrcMemInfo->pvLinAddrKM;
-
+
psMemInfo->sDevVAddr = psMemBlock->sDevVirtAddr;
psMemInfo->uAllocSize = psSrcMemInfo->uAllocSize;
psMemInfo->psKernelSyncInfo = psSrcMemInfo->psKernelSyncInfo;
-
+
if(psMemInfo->psKernelSyncInfo)
{
PVRSRVKernelSyncInfoIncRef(psMemInfo->psKernelSyncInfo, psMemInfo);
}
-
+
psMemInfo->pvSysBackupBuffer = IMG_NULL;
PVRSRVKernelMemInfoIncRef(psSrcMemInfo);
-
+
BM_Export(psSrcMemInfo->sMemBlk.hBuffer);
psMemInfo->memType = PVRSRV_MEMTYPE_MAPPED;
-
+
psMapData->psMemInfo = psMemInfo;
psMapData->psSrcMemInfo = psSrcMemInfo;
-
+
psMemInfo->sMemBlk.hResItem = ResManRegisterRes(psPerProc->hResManContext,
RESMAN_TYPE_DEVICEMEM_MAPPING,
psMapData,
return PVRSRV_OK;
-
+
ErrorExit:
if(psSysPAddr)
{
-
+
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(IMG_SYS_PHYADDR), psSysPAddr, IMG_NULL);
-
+
}
if(psMemInfo)
{
-
+
OSFreeMem(PVRSRV_PAGEABLE_SELECT, sizeof(PVRSRV_KERNEL_MEM_INFO), psMemInfo, IMG_NULL);
-
+
}
if(psMapData)
{
-
+
OSFreeMem(PVRSRV_PAGEABLE_SELECT, sizeof(RESMAN_MAP_DEVICE_MEM_DATA), psMapData, IMG_NULL);
-
+
}
return eError;
return PVRSRV_ERROR_INVALID_PARAMS;
}
-
+
if(OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
sizeof(PVRSRV_DC_MAPINFO),
(IMG_VOID **)&psDCMapInfo, IMG_NULL,
psDeviceClassBuffer = (PVRSRV_DEVICECLASS_BUFFER*)hDeviceClassBuffer;
-
+
goto ErrorExitPhase1;
}
-
+
psBMContext = (BM_CONTEXT*)psDeviceClassBuffer->hDevMemContext;
psDeviceNode = psBMContext->psDeviceNode;
psDevMemoryInfo = &psDeviceNode->sDevMemoryInfo;
{
if(psDeviceMemoryHeap[i].DevMemHeapType == DEVICE_MEMORY_HEAP_PERCONTEXT)
{
-
+
if (psDeviceMemoryHeap[i].ui32HeapSize > 0)
{
hDevMemHeap = BM_CreateHeap(hDevMemContext, &psDeviceMemoryHeap[i]);
goto ErrorExitPhase1;
}
-
+
ui32Offset = ((IMG_UINTPTR_T)pvCPUVAddr) & (ui32PageSize - 1);
pvPageAlignedCPUVAddr = (IMG_VOID *)((IMG_UINTPTR_T)pvCPUVAddr - ui32Offset);
if (!bBMError)
{
PVR_DPF((PVR_DBG_ERROR,"PVRSRVMapDeviceClassMemoryKM: BM_Wrap Failed"));
-
+
eError = PVRSRV_ERROR_BAD_MAPPING;
goto ErrorExitPhase2;
}
-
+
psMemBlock->sDevVirtAddr = BM_HandleToDevVaddr(hBuffer);
psMemBlock->hOSMemHandle = BM_HandleToOSMemHandle(hBuffer);
-
+
psMemBlock->hBuffer = (IMG_HANDLE)hBuffer;
-
+
psMemInfo->pvLinAddrKM = BM_HandleToCpuVaddr(hBuffer);
-
+
psMemInfo->sDevVAddr = psMemBlock->sDevVirtAddr;
psMemInfo->uAllocSize = uByteSize;
psMemInfo->psKernelSyncInfo = psDeviceClassBuffer->psKernelSyncInfo;
-
+
psMemInfo->pvSysBackupBuffer = IMG_NULL;
-
+
psDCMapInfo->psMemInfo = psMemInfo;
psDCMapInfo->psDeviceClassBuffer = psDeviceClassBuffer;
if(psDCMapInfo->ui32TilingStride > 0)
{
-
+
eError = psDeviceNode->pfnAllocMemTilingRange(psDeviceNode,
psMemInfo,
psDCMapInfo->ui32TilingStride,
}
#endif
-
+
psMemInfo->sMemBlk.hResItem = ResManRegisterRes(psPerProc->hResManContext,
RESMAN_TYPE_DEVICECLASSMEM_MAPPING,
psDCMapInfo,
psMemInfo->memType = PVRSRV_MEMTYPE_DEVICECLASS;
-
+
*ppsMemInfo = psMemInfo;
#if defined(SUPPORT_PDUMP_MULTI_PROCESS)
if(psMemInfo)
{
FreeDeviceMem(psMemInfo);
-
+
psMemInfo = IMG_NULL;
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
struct sHandle
{
-
+
PVRSRV_HANDLE_TYPE eType;
-
+
IMG_VOID *pvData;
-
+
IMG_UINT32 ui32NextIndexPlusOne;
-
+
enum ePVRSRVInternalHandleFlag eInternalFlag;
-
+
PVRSRV_HANDLE_ALLOC_FLAG eFlag;
-
+
IMG_UINT32 ui32Index;
-
+
struct sHandleList sChildren;
-
+
struct sHandleList sSiblings;
};
struct sHandleIndex
{
-
+
struct sHandle *psHandle;
-
+
IMG_HANDLE hBlockAlloc;
-
+
IMG_UINT32 ui32FreeHandBlockCount;
};
struct _PVRSRV_HANDLE_BASE_
{
-
+
IMG_HANDLE hBaseBlockAlloc;
-
+
IMG_HANDLE hArrayBlockAlloc;
-
+
struct sHandleIndex *psHandleArray;
-
+
HASH_TABLE *psHashTab;
-
+
IMG_UINT32 ui32FreeHandCount;
-
+
IMG_UINT32 ui32FirstFreeIndex;
-
+
IMG_UINT32 ui32MaxIndexPlusOne;
-
+
IMG_UINT32 ui32TotalHandCount;
-
+
IMG_UINT32 ui32LastFreeIndexPlusOne;
-
+
IMG_UINT32 ui32HandBatchSize;
-
+
IMG_UINT32 ui32TotalHandCountPreBatch;
-
+
IMG_UINT32 ui32FirstBatchIndexPlusOne;
-
+
IMG_UINT32 ui32BatchHandAllocFailures;
-
+
IMG_BOOL bPurgingEnabled;
};
HAND_KEY_DATA = 0,
HAND_KEY_TYPE,
HAND_KEY_PARENT,
- HAND_KEY_LEN
+ HAND_KEY_LEN
};
PVRSRV_HANDLE_BASE *gpsKernelHandleBase = IMG_NULL;
}
return IMG_FALSE;
}
-#endif
+#endif
#ifdef INLINE_IS_PRAGMA
#pragma inline(ParentHandle)
#endif
static INLINE
IMG_VOID HandleListInsertBefore(PVRSRV_HANDLE_BASE *psBase, IMG_UINT32 ui32InsIndex, struct sHandleList *psIns, IMG_SIZE_T uiParentOffset, IMG_UINT32 ui32EntryIndex, struct sHandleList *psEntry, IMG_SIZE_T uiEntryOffset, IMG_UINT32 ui32ParentIndex)
{
-
+
struct sHandleList *psPrevIns = LIST_PTR_FROM_INDEX_AND_OFFSET(psBase, psIns->ui32Prev, ui32ParentIndex, uiParentOffset, uiEntryOffset);
PVR_ASSERT(psEntry->hParent == IMG_NULL)
{
if (!HandleListIsEmpty(ui32EntryIndex, psEntry))
{
-
+
struct sHandleList *psPrev = LIST_PTR_FROM_INDEX_AND_OFFSET(psBase, psEntry->ui32Prev, HANDLE_TO_INDEX(psEntry->hParent), uiParentOffset, uiEntryOffset);
struct sHandleList *psNext = LIST_PTR_FROM_INDEX_AND_OFFSET(psBase, psEntry->ui32Next, HANDLE_TO_INDEX(psEntry->hParent), uiParentOffset, uiEntryOffset);
-
+
PVR_ASSERT(psEntry->hParent != IMG_NULL)
psPrev->ui32Next = psEntry->ui32Next;
PVR_ASSERT(psHead->hParent != IMG_NULL)
-
+
for(ui32Index = psHead->ui32Next; ui32Index != ui32Parent; )
{
struct sHandle *psHandle = INDEX_TO_HANDLE_STRUCT_PTR(psBase, ui32Index);
-
+
struct sHandleList *psEntry = LIST_PTR_FROM_INDEX_AND_OFFSET(psBase, ui32Index, ui32Parent, uiParentOffset, uiEntryOffset);
PVRSRV_ERROR eError;
PVR_ASSERT(psEntry->hParent == psHead->hParent)
-
+
ui32Index = psEntry->ui32Next;
eError = (*pfnIterFunc)(psBase, psHandle);
IMG_UINT32 ui32Index = HANDLE_TO_INDEX(hHandle);
struct sHandle *psHandle;
-
+
if (!INDEX_IS_VALID(psBase, ui32Index))
{
PVR_DPF((PVR_DBG_ERROR, "GetHandleStructure: Handle index out of range (%u >= %u)", ui32Index, psBase->ui32TotalHandCount));
return PVRSRV_ERROR_HANDLE_NOT_ALLOCATED;
}
-
+
if (eType != PVRSRV_HANDLE_TYPE_NONE && eType != psHandle->eType)
{
PVR_DPF((PVR_DBG_ERROR, "GetHandleStructure: Handle type mismatch (%d != %d)", eType, psHandle->eType));
return PVRSRV_ERROR_HANDLE_TYPE_MISMATCH;
}
-
+
*ppsHandle = psHandle;
return PVRSRV_OK;
if (ui32NewCount != 0)
{
-
+
eError = OSAllocMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
HANDLE_ARRAY_SIZE(ui32NewCount) * sizeof(struct sHandleIndex),
(IMG_VOID **)&psNewArray,
}
}
-
+
for(ui32Index = ui32NewCount; ui32Index < ui32OldCount; ui32Index += HANDLE_BLOCK_SIZE)
{
struct sHandleIndex *psIndex = INDEX_TO_INDEX_STRUCT_PTR(psOldArray, ui32Index);
}
}
-
+
for(ui32Index = ui32OldCount; ui32Index < ui32NewCount; ui32Index += HANDLE_BLOCK_SIZE)
{
-
+
struct sHandleIndex *psIndex = INDEX_TO_INDEX_STRUCT_PTR(psNewArray, ui32Index);
eError = OSAllocMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
}
#ifdef DEBUG_MAX_HANDLE_COUNT
-
+
if (ui32NewCount > DEBUG_MAX_HANDLE_COUNT)
{
PVR_DPF((PVR_DBG_ERROR, "ReallocHandleArray: Max handle count (%u) reached", DEBUG_MAX_HANDLE_COUNT));
if (psOldArray != IMG_NULL)
{
-
+
eError = OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP,
HANDLE_ARRAY_SIZE(ui32OldCount) * sizeof(struct sHandleIndex),
psOldArray,
if (ui32NewCount > ui32OldCount)
{
-
+
PVR_ASSERT(psBase->ui32FreeHandCount + (ui32NewCount - ui32OldCount) > psBase->ui32FreeHandCount)
-
+
psBase->ui32FreeHandCount += (ui32NewCount - ui32OldCount);
-
+
if (psBase->ui32FirstFreeIndex == 0)
{
PVR_ASSERT(psBase->ui32LastFreeIndexPlusOne == 0)
PVR_ASSERT(ui32NewCount == 0 || psBase->ui32FirstFreeIndex <= ui32NewCount)
PVR_ASSERT(psBase->ui32FreeHandCount - (ui32OldCount - ui32NewCount) < psBase->ui32FreeHandCount)
-
+
psBase->ui32FreeHandCount -= (ui32OldCount - ui32NewCount);
if (ui32NewCount == 0)
if (psNewArray != IMG_NULL)
{
-
+
for(ui32Index = ui32OldCount; ui32Index < ui32NewCount; ui32Index += HANDLE_BLOCK_SIZE)
{
struct sHandleIndex *psIndex = INDEX_TO_INDEX_STRUCT_PTR(psNewArray, ui32Index);
}
}
-
+
eError = OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP,
HANDLE_ARRAY_SIZE(ui32NewCount) * sizeof(struct sHandleIndex),
psNewArray,
IMG_UINT32 ui32Index = HANDLE_PTR_TO_INDEX(psHandle);
PVRSRV_ERROR eError;
-
+
InitKey(aKey, psBase, psHandle->pvData, psHandle->eType, ParentIfPrivate(psHandle));
if (!TEST_ALLOC_FLAG(psHandle, PVRSRV_HANDLE_ALLOC_FLAG_MULTI) && !BATCHED_HANDLE_PARTIALLY_FREE(psHandle))
PVR_UNREFERENCED_PARAMETER(hHandle);
}
-
+
UnlinkFromParent(psBase, psHandle);
-
+
eError = IterateOverChildren(psBase, psHandle, FreeHandle);
if (eError != PVRSRV_OK)
{
return eError;
}
-
+
psHandle->eType = PVRSRV_HANDLE_TYPE_NONE;
if (BATCHED_HANDLE(psHandle) && !BATCHED_HANDLE_PARTIALLY_FREE(psHandle))
{
-
+
SET_BATCHED_HANDLE_PARTIALLY_FREE(psHandle);
-
+
return PVRSRV_OK;
}
-
+
if (!psBase->bPurgingEnabled)
{
if (psBase->ui32FreeHandCount == 0)
}
else
{
-
+
PVR_ASSERT(psBase->ui32LastFreeIndexPlusOne != 0)
PVR_ASSERT(INDEX_TO_HANDLE_STRUCT_PTR(psBase, psBase->ui32LastFreeIndexPlusOne - 1)->ui32NextIndexPlusOne == 0)
INDEX_TO_HANDLE_STRUCT_PTR(psBase, psBase->ui32LastFreeIndexPlusOne - 1)->ui32NextIndexPlusOne = ui32Index + 1;
PVR_ASSERT(psHandle->ui32NextIndexPlusOne == 0)
-
+
psBase->ui32LastFreeIndexPlusOne = ui32Index + 1;
}
break;
}
-
+
if (psBase->ui32FreeHandCount == psBase->ui32TotalHandCount)
{
break;
PVRSRVReleaseHandleBatch(psBase);
}
-
+
eError = FreeAllHandles(psBase);
if (eError != PVRSRV_OK)
{
return eError;
}
-
+
eError = FreeHandleArray(psBase);
if (eError != PVRSRV_OK)
{
if (psBase->psHashTab != IMG_NULL)
{
-
+
HASH_Delete(psBase->psHashTab);
}
PVR_ASSERT(ui32Delta != 0)
-
+
if (ui32NewTotalHandCount > psBase->ui32MaxIndexPlusOne || ui32NewTotalHandCount <= psBase->ui32TotalHandCount)
{
ui32NewTotalHandCount = psBase->ui32MaxIndexPlusOne;
PVR_ASSERT(ui32DeltaAdjusted >= ui32Delta)
-
+
eError = ReallocHandleArray(psBase, ui32NewTotalHandCount);
if (eError != PVRSRV_OK)
{
HAND_KEY aKey;
PVRSRV_ERROR eError;
-
+
PVR_ASSERT(eType != PVRSRV_HANDLE_TYPE_NONE)
PVR_ASSERT(psBase != IMG_NULL)
PVR_ASSERT(psBase->psHashTab != IMG_NULL)
if (!TEST_FLAG(eFlag, PVRSRV_HANDLE_ALLOC_FLAG_MULTI))
{
-
+
PVR_ASSERT(FindHandle(psBase, pvData, eType, hParent) == IMG_NULL)
}
if (psBase->ui32FreeHandCount == 0 && HANDLES_BATCHED(psBase))
{
- PVR_DPF((PVR_DBG_WARNING, "AllocHandle: Handle batch size (%u) was too small, allocating additional space", psBase->ui32HandBatchSize));
+ PVR_DPF((PVR_DBG_WARNING, "AllocHandle: Handle batch size (%u) was too small, allocating additional space", psBase->ui32HandBatchSize));
}
-
+
eError = EnsureFreeHandles(psBase, 1);
if (eError != PVRSRV_OK)
{
if (!psBase->bPurgingEnabled)
{
-
+
ui32NewIndex = psBase->ui32FirstFreeIndex;
-
+
psNewHandle = INDEX_TO_HANDLE_STRUCT_PTR(psBase, ui32NewIndex);
}
else
{
IMG_UINT32 ui32BlockedIndex;
-
-
+
+
PVR_ASSERT((psBase->ui32FirstFreeIndex % HANDLE_BLOCK_SIZE) == 0)
for (ui32BlockedIndex = ROUND_DOWN_TO_MULTIPLE_OF_BLOCK_SIZE(psBase->ui32FirstFreeIndex); ui32BlockedIndex < psBase->ui32TotalHandCount; ui32BlockedIndex += HANDLE_BLOCK_SIZE)
return PVRSRV_ERROR_INVALID_PARAMS;
}
-
+
hHandle = INDEX_TO_HANDLE(ui32NewIndex);
-
+
if (!TEST_FLAG(eFlag, PVRSRV_HANDLE_ALLOC_FLAG_MULTI))
{
-
+
InitKey(aKey, psBase, pvData, eType, hParent);
-
+
if (!HASH_Insert_Extended(psBase->psHashTab, aKey, (IMG_UINTPTR_T)hHandle))
{
PVR_DPF((PVR_DBG_ERROR, "AllocHandle: Couldn't add handle to hash table"));
INDEX_TO_FREE_HAND_BLOCK_COUNT(psBase, ui32NewIndex)--;
-
+
if (!psBase->bPurgingEnabled)
{
-
+
if (psBase->ui32FreeHandCount == 0)
{
PVR_ASSERT(psBase->ui32FirstFreeIndex == ui32NewIndex)
}
else
{
-
+
psBase->ui32FirstFreeIndex = (psNewHandle->ui32NextIndexPlusOne == 0) ?
ui32NewIndex + 1 :
psNewHandle->ui32NextIndexPlusOne - 1;
}
}
-
+
PVR_ASSERT(psNewHandle->ui32Index == ui32NewIndex)
-
+
psNewHandle->eType = eType;
psNewHandle->pvData = pvData;
psNewHandle->eInternalFlag = INTERNAL_HANDLE_FLAG_NONE;
if (HANDLES_BATCHED(psBase))
{
-
+
psNewHandle->ui32NextIndexPlusOne = psBase->ui32FirstBatchIndexPlusOne;
psBase->ui32FirstBatchIndexPlusOne = ui32NewIndex + 1;
-
+
SET_BATCHED_HANDLE(psNewHandle);
}
else
psNewHandle->ui32NextIndexPlusOne = 0;
}
-
+
*phHandle = hHandle;
return PVRSRV_OK;
if (HANDLES_BATCHED(psBase))
{
-
+
psBase->ui32BatchHandAllocFailures++;
}
-
+
PVR_ASSERT(eType != PVRSRV_HANDLE_TYPE_NONE)
if (!TEST_FLAG(eFlag, PVRSRV_HANDLE_ALLOC_FLAG_MULTI))
{
-
+
hHandle = FindHandle(psBase, pvData, eType, IMG_NULL);
#if defined (SUPPORT_SID_INTERFACE)
if (hHandle != 0)
return eError;
}
-
+
if (TEST_FLAG(psHandle->eFlag & eFlag, PVRSRV_HANDLE_ALLOC_FLAG_SHARED))
{
*phHandle = hHandle;
eError = PVRSRV_OK;
goto exit_ok;
}
-
+
#if defined (SUPPORT_SID_INTERFACE)
PVR_DBG_BREAK
#endif
}
eError = AllocHandle(psBase, phHandle, pvData, eType, eFlag, IMG_NULL);
-
+
exit_ok:
if (HANDLES_BATCHED(psBase) && (eError == PVRSRV_OK))
{
if (HANDLES_BATCHED(psBase))
{
-
+
psBase->ui32BatchHandAllocFailures++;
}
-
+
PVR_ASSERT(eType != PVRSRV_HANDLE_TYPE_NONE)
hParentKey = TEST_FLAG(eFlag, PVRSRV_HANDLE_ALLOC_FLAG_PRIVATE) ?
hParent : IMG_NULL;
-
+
eError = GetHandleStructure(psBase, &psPHand, hParent, PVRSRV_HANDLE_TYPE_NONE);
if (eError != PVRSRV_OK)
{
if (!TEST_FLAG(eFlag, PVRSRV_HANDLE_ALLOC_FLAG_MULTI))
{
-
+
hHandle = FindHandle(psBase, pvData, eType, hParentKey);
#if defined (SUPPORT_SID_INTERFACE)
if (hHandle != 0)
PVR_ASSERT(hParentKey != IMG_NULL && ParentHandle(HANDLE_TO_HANDLE_STRUCT_PTR(psBase, hHandle)) == hParent)
-
+
if (TEST_FLAG(psCHandle->eFlag & eFlag, PVRSRV_HANDLE_ALLOC_FLAG_SHARED) && ParentHandle(HANDLE_TO_HANDLE_STRUCT_PTR(psBase, hHandle)) == hParent)
{
*phHandle = hHandle;
return eError;
}
-
+
psPHand = HANDLE_TO_HANDLE_STRUCT_PTR(psBase, hParent);
psCHand = HANDLE_TO_HANDLE_STRUCT_PTR(psBase, hHandle);
PVR_ASSERT(eType != PVRSRV_HANDLE_TYPE_NONE)
-
+
#if defined (SUPPORT_SID_INTERFACE)
hHandle = (IMG_SID) FindHandle(psBase, pvData, eType, IMG_NULL);
#else
return eError;
}
-
+
for (psPHand = psCHand; ParentHandle(psPHand) != hAncestor; )
{
eError = GetHandleStructure(psBase, &psPHand, ParentHandle(psPHand), PVRSRV_HANDLE_TYPE_NONE);
psBase->ui32HandBatchSize = ui32BatchSize;
-
+
psBase->ui32TotalHandCountPreBatch = psBase->ui32TotalHandCount;
PVR_ASSERT(psBase->ui32BatchHandAllocFailures == 0)
}
bCommitBatch = IMG_FALSE;
}
-
+
PVR_ASSERT(psBase->ui32BatchHandAllocFailures == 0 || !bCommit)
ui32IndexPlusOne = psBase->ui32FirstBatchIndexPlusOne;
{
PVRSRV_ERROR eError;
-
+
if (!BATCHED_HANDLE_PARTIALLY_FREE(psHandle))
{
-
- SET_UNBATCHED_HANDLE(psHandle);
+
+ SET_UNBATCHED_HANDLE(psHandle);
}
eError = FreeHandle(psBase, psHandle);
}
else
{
-
+
SET_UNBATCHED_HANDLE(psHandle);
}
return PVRSRV_ERROR_INVALID_PARAMS;
}
-
+
if (ui32MaxHandle == 0 || ui32MaxHandle > DEFAULT_MAX_HANDLE)
{
PVR_DPF((PVR_DBG_ERROR, "PVRSRVSetMaxHandle: Limit must be between %u and %u, inclusive", 0, DEFAULT_MAX_HANDLE));
return PVRSRV_ERROR_INVALID_PARAMS;
}
-
+
if (psBase->ui32TotalHandCount != 0)
{
PVR_DPF((PVR_DBG_ERROR, "PVRSRVSetMaxHandle: Limit cannot be set because handles have already been allocated"));
ui32MaxHandleRounded = ROUND_DOWN_TO_MULTIPLE_OF_BLOCK_SIZE(ui32MaxHandle);
-
+
if (ui32MaxHandleRounded != 0 && ui32MaxHandleRounded < psBase->ui32MaxIndexPlusOne)
{
psBase->ui32MaxIndexPlusOne = ui32MaxHandleRounded;
return PVRSRV_OK;
}
-
+
if (psBase->ui32TotalHandCount != 0)
{
PVR_DPF((PVR_DBG_ERROR, "PVRSRVEnableHandlePurging: Handles have already been allocated"));
}
ui32NewHandCount = BLOCK_INDEX_TO_INDEX(ui32BlockIndex);
-
+
if (ui32NewHandCount <= (psBase->ui32TotalHandCount/2))
{
PVRSRV_ERROR eError;
-
+
eError = ReallocHandleArray(psBase, ui32NewHandCount);
if (eError != PVRSRV_OK)
}
OSMemSet(psBase, 0, sizeof(*psBase));
-
+
psBase->psHashTab = HASH_Create_Extended(HANDLE_HASH_TAB_INIT_SIZE, sizeof(HAND_KEY), HASH_Func_Default, HASH_Key_Comp_Default);
if (psBase->psHashTab == IMG_NULL)
{
return eError;
}
#else
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
struct _BUCKET_
{
-
+
struct _BUCKET_ *pNext;
-
+
IMG_UINTPTR_T v;
-
- IMG_UINTPTR_T k[];
+
+ IMG_UINTPTR_T k[];
};
typedef struct _BUCKET_ BUCKET;
struct _HASH_TABLE_
{
-
+
BUCKET **ppBucketTable;
-
+
IMG_UINT32 uSize;
-
+
IMG_UINT32 uCount;
-
+
IMG_UINT32 uMinimumSize;
-
+
IMG_UINT32 uKeySize;
-
+
HASH_FUNC *pfnHashFunc;
-
+
HASH_KEY_COMP *pfnKeyComp;
};
return PVRSRV_ERROR_INVALID_PARAMS;
}
- uIndex = KEY_TO_INDEX(pHash, pBucket->k, uSize);
+ uIndex = KEY_TO_INDEX(pHash, pBucket->k, uSize);
pBucket->pNext = ppBucketTable[uIndex];
ppBucketTable[uIndex] = pBucket;
}
OSFreeMem (PVRSRV_PAGEABLE_SELECT, sizeof(BUCKET *)*pHash->uSize, pHash->ppBucketTable, IMG_NULL);
-
+
pHash->ppBucketTable = ppNewTable;
pHash->uSize = uNewSize;
}
if (pHash->ppBucketTable == IMG_NULL)
{
OSFreeMem(PVRSRV_PAGEABLE_SELECT, sizeof(HASH_TABLE), pHash, IMG_NULL);
-
+
return IMG_NULL;
}
OSFreeMem(PVRSRV_PAGEABLE_SELECT, sizeof(BUCKET *)*pHash->uSize, pHash->ppBucketTable, IMG_NULL);
pHash->ppBucketTable = IMG_NULL;
OSFreeMem(PVRSRV_PAGEABLE_SELECT, sizeof(HASH_TABLE), pHash, IMG_NULL);
-
+
}
}
}
pBucket->v = v;
-
+
OSMemCopy(pBucket->k, pKey, pHash->uKeySize);
if (_ChainInsert (pHash, pBucket, pHash->ppBucketTable, pHash->uSize) != PVRSRV_OK)
{
pHash->uCount++;
-
+
if (pHash->uCount << 1 > pHash->uSize)
{
-
+
_Resize (pHash, pHash->uSize << 1);
}
for (ppBucket = &(pHash->ppBucketTable[uIndex]); *ppBucket != IMG_NULL; ppBucket = &((*ppBucket)->pNext))
{
-
+
if (KEY_COMPARE(pHash, (*ppBucket)->k, pKey))
{
BUCKET *pBucket = *ppBucket;
(*ppBucket) = pBucket->pNext;
OSFreeMem(PVRSRV_PAGEABLE_SELECT, sizeof(BUCKET) + pHash->uKeySize, pBucket, IMG_NULL);
-
+
pHash->uCount--;
-
+
if (pHash->uSize > (pHash->uCount << 2) &&
pHash->uSize > pHash->uMinimumSize)
{
-
+
_Resize (pHash,
PRIVATE_MAX (pHash->uSize >> 1,
for (ppBucket = &(pHash->ppBucketTable[uIndex]); *ppBucket != IMG_NULL; ppBucket = &((*ppBucket)->pNext))
{
-
+
if (KEY_COMPARE(pHash, (*ppBucket)->k, pKey))
{
BUCKET *pBucket = *ppBucket;
{
PVRSRV_ERROR eError;
BUCKET *pNextBucket = pBucket->pNext;
-
+
eError = pfnCallback((IMG_UINTPTR_T) ((IMG_VOID *) *(pBucket->k)), (IMG_UINTPTR_T) pBucket->v);
-
+
if (eError != PVRSRV_OK)
return eError;
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
}
else
{
-
+
eDevClass = PVRSRV_DEVICE_CLASS_FORCE_I32;
}
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
sizeof(PVRSRV_KERNEL_MEM_INFO),
psKernelMemInfo,
IMG_NULL);
-
+
return PVRSRV_OK;
}
return PVRSRV_ERROR_OUT_OF_MEMORY;
}
-
+
psKernelMemInfo->sMemBlk.hResItem =
ResManRegisterRes(psPerProc->hResManContext,
RESMAN_TYPE_SHARED_MEM_INFO,
*ppsKernelMemInfo = psKernelMemInfo;
- return PVRSRV_OK;
+ return PVRSRV_OK;
}
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#define STOP_ON_ERROR 0
+
-
-
+
return IMG_TRUE;
}
-
+
IMG_VOID OSCheckMemDebug(IMG_PVOID pvCpuVAddr, IMG_SIZE_T uSize, const IMG_CHAR *pszFileName, const IMG_UINT32 uLine)
{
OSMEM_DEBUG_INFO const *psInfo = (OSMEM_DEBUG_INFO *)((IMG_UINT32)pvCpuVAddr - TEST_BUFFER_PADDING_STATUS);
-
+
if (pvCpuVAddr == IMG_NULL)
{
PVR_DPF((PVR_DBG_ERROR, "Pointer 0x%X : null pointer"
while (STOP_ON_ERROR);
}
-
+
if (((IMG_UINT32)pvCpuVAddr&3) != 0)
{
PVR_DPF((PVR_DBG_ERROR, "Pointer 0x%X : invalid alignment"
while (STOP_ON_ERROR);
}
-
+
if (!MemCheck((IMG_PVOID)psInfo->sGuardRegionBefore, 0xB1, sizeof(psInfo->sGuardRegionBefore)))
{
PVR_DPF((PVR_DBG_ERROR, "Pointer 0x%X : guard region before overwritten"
while (STOP_ON_ERROR);
}
-
+
if (uSize != psInfo->uSize)
{
PVR_DPF((PVR_DBG_WARNING, "Pointer 0x%X : supplied size was different to stored size (0x%X != 0x%X)"
while (STOP_ON_ERROR);
}
-
+
if ((0x01234567 ^ psInfo->uSizeParityCheck) != psInfo->uSize)
{
PVR_DPF((PVR_DBG_WARNING, "Pointer 0x%X : stored size parity error (0x%X != 0x%X)"
}
else
{
-
+
uSize = psInfo->uSize;
}
-
+
if (uSize)
{
if (!MemCheck((IMG_VOID*)((IMG_UINT32)pvCpuVAddr + uSize), 0xB2, TEST_BUFFER_PADDING_AFTER))
}
}
-
+
if (psInfo->eValid != isAllocated)
{
PVR_DPF((PVR_DBG_ERROR, "Pointer 0x%X : not allocated (freed? %d)"
{
IMG_SIZE_T i = 0;
- for (; i < 128; i++)
+ for (; i < 128; i++)
{
*pDest = *pSrc;
if (*pSrc == '\0') break;
return eError;
}
-
+
OSMemSet((IMG_CHAR *)(*ppvCpuVAddr) + TEST_BUFFER_PADDING_STATUS, 0xBB, ui32Size);
OSMemSet((IMG_CHAR *)(*ppvCpuVAddr) + ui32Size + TEST_BUFFER_PADDING_STATUS, 0xB2, TEST_BUFFER_PADDING_AFTER);
-
+
psInfo = (OSMEM_DEBUG_INFO *)(*ppvCpuVAddr);
OSMemSet(psInfo->sGuardRegionBefore, 0xB1, sizeof(psInfo->sGuardRegionBefore));
psInfo->uSize = ui32Size;
psInfo->uSizeParityCheck = 0x01234567 ^ ui32Size;
-
+
*ppvCpuVAddr = (IMG_PVOID) ((IMG_UINT32)*ppvCpuVAddr)+TEST_BUFFER_PADDING_STATUS;
#ifdef PVRSRV_LOG_MEMORY_ALLOCS
-
+
PVR_TRACE(("Allocated pointer (after debug info): 0x%X from %s:%d", *ppvCpuVAddr, pszFilename, ui32Line));
#endif
{
OSMEM_DEBUG_INFO *psInfo;
-
+
OSCheckMemDebug(pvCpuVAddr, ui32Size, pszFilename, ui32Line);
+
+ OSMemSet(pvCpuVAddr, 0xBF, ui32Size + TEST_BUFFER_PADDING_AFTER);
- OSMemSet(pvCpuVAddr, 0xBF, ui32Size + TEST_BUFFER_PADDING_AFTER);
-
-
+
psInfo = (OSMEM_DEBUG_INFO *)((IMG_UINT32) pvCpuVAddr - TEST_BUFFER_PADDING_STATUS);
-
+
psInfo->uSize = 0;
psInfo->uSizeParityCheck = 0;
psInfo->eValid = isFree;
}
#endif
-#endif
+#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#define PVRSRV_TIMER_COUNT(X) asTimers[X].ui32Count
-Temporal_Data asTimers[PVRSRV_NUM_TIMERS];
+Temporal_Data asTimers[PVRSRV_NUM_TIMERS];
IMG_UINT32 PVRSRVTimeNow(IMG_VOID)
return (0xffffffff-*pui32TimerRegister);
-#else
+#else
return 0;
-#endif
+#endif
}
#if defined(__sh__)
-
-
-
-
+
+
+
+
*TCR_2 = TIMER_DIVISOR;
-
+
*TCOR_2 = *TCNT_2 = (IMG_UINT)0xffffffff;
-
+
*TST_REG |= (IMG_UINT8)0x04;
pui32TimerRegister = (IMG_UINT32 *)TCNT_2;
- #else
+ #else
pui32TimerRegister = 0;
- #endif
+ #endif
}
}
}
#if 0
-
+
PVR_DPF((PVR_DBG_ERROR," Timer(%u): Total = %u",PVRSRV_TIMER_EXAMPLE_1, PVRSRV_TIMER_TOTAL_IN_TICKS(PVRSRV_TIMER_EXAMPLE_1)));
PVR_DPF((PVR_DBG_ERROR," Timer(%u): Time = %ums",PVRSRV_TIMER_EXAMPLE_1, PVRSRV_TIMER_TOTAL_IN_MS(PVRSRV_TIMER_EXAMPLE_1)));
PVR_DPF((PVR_DBG_ERROR," Timer(%u): Count = %u",PVRSRV_TIMER_EXAMPLE_1, PVRSRV_TIMER_COUNT(PVRSRV_TIMER_EXAMPLE_1)));
#endif
}
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
if(psPerProc == IMG_NULL)
{
-
+
return IMG_FALSE;
}
return psPerProc->bPDumpPersistent;
PVRSRV_PER_PROCESS_DATA* psPerProc = PVRSRVFindPerProcessData();
if(psPerProc == IMG_NULL)
{
-
+
return IMG_TRUE;
}
return psPerProc->bPDumpActive;
}
-#endif
+#endif
#if defined(PDUMP_DEBUG_OUTFILES)
static INLINE
PVRSRV_PER_PROCESS_DATA* psPerProc = PVRSRVFindPerProcessData();
if(psPerProc == IMG_NULL)
{
-
+
return 0;
}
return psPerProc->ui32PID;
}
-#endif
+#endif
static IMG_VOID *GetTempBuffer(IMG_VOID)
{
-
+
if (gpvTempBuffer == IMG_NULL)
{
PVRSRV_ERROR eError = OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
IMG_VOID PDumpInitCommon(IMG_VOID)
{
-
+
(IMG_VOID) GetTempBuffer();
-
+
PDumpInit();
}
IMG_VOID PDumpDeInitCommon(IMG_VOID)
{
-
+
FreeTempBuffer();
-
+
PDumpDeInit();
}
}
PVRSRV_ERROR PDumpRegPolWithFlagsKM(IMG_CHAR *pszPDumpRegName,
- IMG_UINT32 ui32RegAddr,
- IMG_UINT32 ui32RegValue,
+ IMG_UINT32 ui32RegAddr,
+ IMG_UINT32 ui32RegValue,
IMG_UINT32 ui32Mask,
IMG_UINT32 ui32Flags,
PDUMP_POLL_OPERATOR eOperator)
{
-
+
#define POLL_DELAY 1000U
#define POLL_COUNT_LONG (2000000000U / POLL_DELAY)
#define POLL_COUNT_SHORT (1000000U / POLL_DELAY)
PDUMP_DBG(("PDumpRegPolWithFlagsKM"));
if ( _PDumpIsPersistent() )
{
-
+
return PVRSRV_OK;
}
PDUMP_GET_SCRIPT_STRING();
#if defined(SUPPORT_PDUMP_MULTI_PROCESS)
-
+
ui32Flags |= ( _PDumpIsPersistent() || bShared ) ? PDUMP_FLAGS_PERSISTENT : 0;
#else
PVR_UNREFERENCED_PARAMETER(bShared);
ui32Flags |= ( _PDumpIsPersistent() ) ? PDUMP_FLAGS_PERSISTENT : 0;
#endif
-
+
#if !defined(LINUX)
PVR_ASSERT(((IMG_UINTPTR_T)pvLinAddr & HOST_PAGEMASK) == 0);
#endif
PVR_ASSERT(((IMG_UINT32) ui32DevVAddr & HOST_PAGEMASK) == 0);
PVR_ASSERT(((IMG_UINT32) ui32NumBytes & HOST_PAGEMASK) == 0);
-
+
eErr = PDumpOSBufprintf(hScript, ui32MaxLen, "-- MALLOC :%s:VA_%08X 0x%08X %u\r\n",
psDevID->pszPDumpDevName, ui32DevVAddr, ui32NumBytes, ui32PageSize);
}
PDumpOSWriteString2(hScript, ui32Flags);
-
+
pui8LinAddr = (IMG_PUINT8) pvLinAddr;
ui32Offset = 0;
ui32NumPages = ui32NumBytes / ui32PageSize;
while (ui32NumPages)
- {
+ {
ui32NumPages--;
+
-
-
-
-
+
+
+
PDumpOSCPUVAddrToDevPAddr(psDevID->eDeviceType,
hOSMemHandle,
ui32Offset,
ui32PageSize,
&sDevPAddr);
ui32Page = (IMG_UINT32)(sDevPAddr.uiAddr / ui32PageSize);
-
+
pui8LinAddr += ui32PageSize;
ui32Offset += ui32PageSize;
PVR_ASSERT(((IMG_UINTPTR_T)pvLinAddr & (ui32PTSize - 1)) == 0);
ui32Flags |= PDUMP_FLAGS_CONTINUOUS;
ui32Flags |= ( _PDumpIsPersistent() ) ? PDUMP_FLAGS_PERSISTENT : 0;
-
-
+
+
eErr = PDumpOSBufprintf(hScript,
ui32MaxLen,
}
PDumpOSWriteString2(hScript, ui32Flags);
+
-
-
-
-
-
+
+
+
+
PDumpOSCPUVAddrToDevPAddr(psDevId->eDeviceType,
- hOSMemHandle,
+ hOSMemHandle,
ui32Offset,
(IMG_PUINT8) pvLinAddr,
ui32PTSize,
psDeviceNode = psBMHeap->pBMContext->psDeviceNode;
ui32Flags |= ( _PDumpIsPersistent() ) ? PDUMP_FLAGS_PERSISTENT : 0;
+
-
- eErr = PDumpOSBufprintf(hScript, ui32MaxLen, "-- FREE :%s:VA_%08X\r\n",
+ eErr = PDumpOSBufprintf(hScript, ui32MaxLen, "-- FREE :%s:VA_%08X\r\n",
psDeviceNode->sDevId.pszPDumpDevName, sDevVAddr.uiAddr);
if(eErr != PVRSRV_OK)
{
}
#if defined(SUPPORT_PDUMP_MULTI_PROCESS)
-
+
{
PVRSRV_DEVICE_NODE *psDeviceNode = psBMHeap->pBMContext->psDeviceNode;
-
+
if( psDeviceNode->pfnMMUIsHeapShared(psBMHeap->pMMUHeap) )
{
ui32Flags |= PDUMP_FLAGS_PERSISTENT;
#endif
PDumpOSWriteString2(hScript, ui32Flags);
-
+
ui32NumPages = ui32NumBytes / ui32PageSize;
for (ui32PageCounter = 0; ui32PageCounter < ui32NumPages; ui32PageCounter++)
}
else
{
-
+
}
sDevVAddr.uiAddr += ui32PageSize;
ui32Flags |= PDUMP_FLAGS_CONTINUOUS;
ui32Flags |= ( _PDumpIsPersistent() ) ? PDUMP_FLAGS_PERSISTENT : 0;
+
+ PVR_ASSERT(((IMG_UINTPTR_T)pvLinAddr & (ui32PTSize-1UL)) == 0);
- PVR_ASSERT(((IMG_UINTPTR_T)pvLinAddr & (ui32PTSize-1UL)) == 0);
-
-
+
eErr = PDumpOSBufprintf(hScript, ui32MaxLen, "-- FREE :%s:PAGE_TABLE\r\n", psDevID->pszPDumpDevName);
if(eErr != PVRSRV_OK)
}
PDumpOSWriteString2(hScript, ui32Flags);
+
-
-
-
-
-
+
+
+
+
PDumpOSCPUVAddrToDevPAddr(psDevID->eDeviceType,
- hOSMemHandle,
+ hOSMemHandle,
0,
(IMG_PUINT8) pvLinAddr,
ui32PTSize,
PVRSRV_ERROR eErr;
IMG_CHAR *pszRegString;
PDUMP_GET_SCRIPT_STRING()
-
+
if(psMMUAttrib->pszPDRegRegion != IMG_NULL)
- {
+ {
pszRegString = psMMUAttrib->pszPDRegRegion;
}
else
pszRegString = psMMUAttrib->sDevId.pszPDumpRegName;
}
-
+
#if defined(SGX_FEATURE_36BIT_MMU)
eErr = PDumpOSBufprintf(hScript, ui32MaxLen,
return eErr;
}
PDumpOSWriteString2(hScript, ui32Flags);
- eErr = PDumpOSBufprintf(hScript, ui32MaxLen, "SHR :%s:$1 :%s:$1 0x4\r\n",
+ eErr = PDumpOSBufprintf(hScript, ui32MaxLen, "SHR :%s:$1 :%s:$1 0x4\r\n",
psMMUAttrib->sDevId.pszPDumpDevName,
psMMUAttrib->sDevId.pszPDumpDevName);
if(eErr != PVRSRV_OK)
return PVRSRV_OK;
}
-PVRSRV_ERROR PDumpPDReg (PDUMP_MMU_ATTRIB *psMMUAttrib,
+PVRSRV_ERROR PDumpPDReg (PDUMP_MMU_ATTRIB *psMMUAttrib,
IMG_UINT32 ui32Reg,
IMG_UINT32 ui32Data,
IMG_HANDLE hUniqueTag)
if ( _PDumpIsPersistent() )
{
-
+
return PVRSRV_OK;
}
-
+
PVR_ASSERT((ui32Offset + sizeof(IMG_UINT32)) <= psMemInfo->uAllocSize);
psMMUAttrib = ((BM_BUF*)psMemInfo->sMemBlk.hBuffer)->pMapping->pBMHeap->psMMUAttrib;
-
+
eErr = PDumpOSBufprintf(hScript,
ui32MaxLen,
pui8LinAddr = psMemInfo->pvLinAddrKM;
-
+
pui8LinAddr += ui32Offset;
-
+
PDumpOSCPUVAddrToPhysPages(psMemInfo->sMemBlk.hOSMemHandle,
psMMUAttrib->ui32DataPageMask,
&ui32PageOffset);
-
+
sDevVPageAddr.uiAddr = psMemInfo->sDevVAddr.uiAddr + ui32Offset - ui32PageOffset;
PVR_ASSERT((sDevVPageAddr.uiAddr & psMMUAttrib->ui32DataPageMask) == 0);
-
+
BM_GetPhysPageAddr(psMemInfo, sDevVPageAddr, &sDevPAddr);
-
+
sDevPAddr.uiAddr += ui32PageOffset;
eErr = PDumpOSBufprintf(hScript,
IMG_UINT32 ui32DataPageSize;
PDUMP_GET_SCRIPT_AND_FILE_STRING();
-
-
+
+
if (ui32Bytes == 0 || PDumpOSIsSuspended())
{
return PVRSRV_OK;
}
psMMUAttrib = ((BM_BUF*)psMemInfo->sMemBlk.hBuffer)->pMapping->pBMHeap->psMMUAttrib;
-
-
+
+
PVR_ASSERT((ui32Offset + ui32Bytes) <= psMemInfo->uAllocSize);
}
#if defined(SUPPORT_PDUMP_MULTI_PROCESS)
-
+
{
BM_HEAP *pHeap = ((BM_BUF*)psMemInfo->sMemBlk.hBuffer)->pMapping->pBMHeap;
PVRSRV_DEVICE_NODE *psDeviceNode = pHeap->pBMContext->psDeviceNode;
-
+
if( psDeviceNode->pfnMMUIsHeapShared(pHeap->pMMUHeap) )
{
ui32Flags |= PDUMP_FLAGS_PERSISTENT;
}
#endif
-
+
if(pvAltLinAddr)
{
pui8DataLinAddr = pvAltLinAddr;
pui8LinAddr = (IMG_UINT8 *)psMemInfo->pvLinAddrKM;
sDevVAddr = psMemInfo->sDevVAddr;
-
+
sDevVAddr.uiAddr += ui32Offset;
pui8LinAddr += ui32Offset;
ui32ParamOutPos = PDumpOSGetStreamOffset(PDUMP_STREAM_PARAM2);
-
+
if(!PDumpOSWriteString(PDumpOSGetStream(PDUMP_STREAM_PARAM2),
pui8DataLinAddr,
return eErr;
}
-
+
eErr = PDumpOSBufprintf(hScript,
ui32MaxLenScript,
}
PDumpOSWriteString2(hScript, ui32Flags);
-
+
PDumpOSCPUVAddrToPhysPages(psMemInfo->sMemBlk.hOSMemHandle,
while(ui32NumPages)
{
ui32NumPages--;
-
-
+
+
sDevVPageAddr.uiAddr = sDevVAddr.uiAddr - ui32PageByteOffset;
if (ui32DataPageSize <= PDUMP_TEMP_BUFFER_SIZE)
{
-
+
PVR_ASSERT((sDevVPageAddr.uiAddr & psMMUAttrib->ui32DataPageMask) == 0);
}
-
+
BM_GetPhysPageAddr(psMemInfo, sDevVPageAddr, &sDevPAddr);
-
+
sDevPAddr.uiAddr += ui32PageByteOffset;
-
+
if (ui32PageByteOffset + ui32Bytes > ui32DataPageSize)
{
-
+
ui32BlockBytes = ui32DataPageSize - ui32PageByteOffset;
}
else
{
-
+
ui32BlockBytes = ui32Bytes;
}
}
PDumpOSWriteString2(hScript, ui32Flags);
-
+
#if defined(SGX_FEATURE_VARIABLE_MMU_PAGE_SIZE)
-
+
ui32PageByteOffset = (ui32PageByteOffset + ui32BlockBytes) % ui32DataPageSize;
#else
-
+
ui32PageByteOffset = 0;
#endif
-
- ui32Bytes -= ui32BlockBytes;
-
+
+ ui32Bytes -= ui32BlockBytes;
+
sDevVAddr.uiAddr += ui32BlockBytes;
-
+
pui8LinAddr += ui32BlockBytes;
-
+
ui32ParamOutPos += ui32BlockBytes;
}
IMG_HANDLE hUniqueTag2)
{
PDUMP_MMU_ATTRIB sMMUAttrib;
-
-
+
+
sMMUAttrib = *psMMUAttrib;
sMMUAttrib.ui32PTSize = (IMG_UINT32)HOST_PAGESIZE();
return PDumpMemPTEntriesKM( &sMMUAttrib,
IMG_CPU_PHYADDR sCpuPAddr;
IMG_UINT32 ui32Offset;
IMG_UINT32 ui32ParamOutPos;
- IMG_UINT32 ui32PageMask;
+ IMG_UINT32 ui32PageMask;
PDUMP_GET_SCRIPT_AND_FILE_STRING();
ui32Flags |= ( _PDumpIsPersistent() ) ? PDUMP_FLAGS_PERSISTENT : 0;
if (bInitialisePages)
{
-
+
if (!PDumpOSWriteString(PDumpOSGetStream(PDUMP_STREAM_PARAM2),
}
}
-
+
ui32PageMask = psMMUAttrib->ui32PTSize - 1;
+
-
-
+
ui32PageOffset = (IMG_UINT32)((IMG_UINTPTR_T)pvLinAddr & (psMMUAttrib->ui32PTSize - 1));
ui32NumPages = (ui32PageOffset + ui32Bytes + psMMUAttrib->ui32PTSize - 1) / psMMUAttrib->ui32PTSize;
pui8LinAddr = (IMG_UINT8*) pvLinAddr;
while (ui32NumPages)
{
ui32NumPages--;
-
+
sCpuPAddr = OSMapLinToCPUPhys(hOSMemHandle, pui8LinAddr);
sDevPAddr = SysCpuPAddrToDevPAddr(psMMUAttrib->sDevId.eDeviceType, sCpuPAddr);
-
+
if (ui32PageOffset + ui32Bytes > psMMUAttrib->ui32PTSize)
{
-
+
ui32BlockBytes = psMMUAttrib->ui32PTSize - ui32PageOffset;
}
else
{
-
+
ui32BlockBytes = ui32Bytes;
}
+
-
-
+
if (bInitialisePages)
{
eErr = PDumpOSBufprintf(hScript,
{
for (ui32Offset = 0; ui32Offset < ui32BlockBytes; ui32Offset += sizeof(IMG_UINT32))
{
- IMG_UINT32 ui32PTE = *((IMG_UINT32 *)(IMG_UINTPTR_T)(pui8LinAddr + ui32Offset));
+ IMG_UINT32 ui32PTE = *((IMG_UINT32 *)(IMG_UINTPTR_T)(pui8LinAddr + ui32Offset));
if ((ui32PTE & psMMUAttrib->ui32PDEMask) != 0)
{
-
+
#if defined(SGX_FEATURE_36BIT_MMU)
eErr = PDumpOSBufprintf(hScript,
ui32MaxLenScript,
}
}
+
-
-
+
ui32PageOffset = 0;
-
+
ui32Bytes -= ui32BlockBytes;
-
+
pui8LinAddr += ui32BlockBytes;
-
+
ui32ParamOutPos += ui32BlockBytes;
}
IMG_UINT32 ui32Flags = PDUMP_FLAGS_CONTINUOUS;
IMG_UINT32 ui32ParamOutPos;
PDUMP_MMU_ATTRIB *psMMUAttrib;
- IMG_UINT32 ui32PageMask;
+ IMG_UINT32 ui32PageMask;
PDUMP_GET_SCRIPT_AND_FILE_STRING();
ui32ParamOutPos = PDumpOSGetStreamOffset(PDUMP_STREAM_PARAM2);
-
+
if(!PDumpOSWriteString(PDumpOSGetStream(PDUMP_STREAM_PARAM2),
(IMG_UINT8 *)&sPDDevPAddr,
sizeof(IMG_DEV_PHYADDR),
return eErr;
}
-
+
eErr = PDumpOSBufprintf(hScript,
ui32MaxLenScript,
"-- LDB :%s:PA_0x%08X%08X:0x%08X 0x%08X 0x%08X %s\r\n",
}
PDumpOSWriteString2(hScript, ui32Flags);
-
+
sDevVAddr = psMemInfo->sDevVAddr;
ui32PageByteOffset = sDevVAddr.uiAddr & ui32PageMask;
PVRSRV_ERROR PDumpCommentKM(IMG_CHAR *pszComment, IMG_UINT32 ui32Flags)
{
PVRSRV_ERROR eErr;
- IMG_CHAR pszCommentPrefix[] = "-- ";
+ IMG_CHAR pszCommentPrefix[] = "-- ";
#if defined(PDUMP_DEBUG_OUTFILES)
IMG_CHAR pszTemp[256];
#endif
PDUMP_GET_SCRIPT_STRING();
PDUMP_DBG(("PDumpCommentKM"));
#if defined(PDUMP_DEBUG_OUTFILES)
-
+
ui32Flags |= ( _PDumpIsPersistent() ) ? PDUMP_FLAGS_PERSISTENT : 0;
#endif
-
+
PDumpOSVerifyLineEnding(pszComment, ui32MaxLen);
-
+
ui32LenCommentPrefix = PDumpOSBuflen(pszCommentPrefix, sizeof(pszCommentPrefix));
-
-
+
+
if (!PDumpOSWriteString(PDumpOSGetStream(PDUMP_STREAM_SCRIPT2),
(IMG_UINT8*)pszCommentPrefix,
ui32LenCommentPrefix,
}
#if defined(PDUMP_DEBUG_OUTFILES)
-
+
eErr = PDumpOSSprintf(pszTemp, 256, "%d-%d %s",
_PDumpGetPID(),
g_ui32EveryLineCounter,
pszComment);
-
+
eErr = PDumpOSBufprintf(hScript, ui32MaxLen, "%s",
pszTemp);
#else
PDUMP_va_list ap;
PDUMP_GET_MSG_STRING();
-
+
PDUMP_va_start(ap, pszFormat);
eErr = PDumpOSVSprintf(pszMsg, ui32MaxLen, pszFormat, ap);
PDUMP_va_end(ap);
PDUMP_va_list ap;
PDUMP_GET_MSG_STRING();
-
+
PDUMP_va_start(ap, pszFormat);
eErr = PDumpOSVSprintf(pszMsg, ui32MaxLen, pszFormat, ap);
PDUMP_va_end(ap);
IMG_UINT32 ui32MsgLen;
PDUMP_GET_MSG_STRING();
-
+
eErr = PDumpOSSprintf(pszMsg, ui32MaxLen, "%s", pszString);
if(eErr != PVRSRV_OK)
{
return eErr;
}
-
+
PDumpOSVerifyLineEnding(pszMsg, ui32MaxLen);
ui32MsgLen = PDumpOSBuflen(pszMsg, ui32MaxLen);
PDumpCommentWithFlags(ui32PDumpFlags, "\r\n-- Dump bitmap of render\r\n");
-
+
ui32MMUContextID = psDeviceNode->pfnMMUGetContextID( hDevMemContext );
eErr = PDumpOSBufprintf(hScript,
{
IMG_BOOL bFrameDumped;
-
+
(IMG_VOID) PDumpSetFrameKM(ui32CurrentFrame + 1);
bFrameDumped = PDumpIsCaptureFrameKM();
}
PDumpRegisterRange(psDevId,
- pszFileName,
- pui32Registers,
- ui32NumRegisters,
- &ui32FileOffset,
- sizeof(IMG_UINT32),
+ pszFileName,
+ pui32Registers,
+ ui32NumRegisters,
+ &ui32FileOffset,
+ sizeof(IMG_UINT32),
ui32Flags);
return PVRSRV_OK;
}
PDUMP_GET_SCRIPT_STRING();
eErr = PDumpOSBufprintf(hScript, ui32MaxLen, "RDW :%s:0x%X\r\n",
- pszPDumpRegName,
+ pszPDumpRegName,
ui32RegOffset);
if(eErr != PVRSRV_OK)
{
{
PVRSRV_ERROR eErr;
PDUMP_GET_SCRIPT_STRING();
-
+
eErr = PDumpOSBufprintf(hScript,
ui32MaxLen,
"SAB :%s:v%x:0x%08X 0x%08X 0x%08X %s.bin\r\n",
PVRSRV_ERROR eErr;
PDUMP_GET_SCRIPT_STRING();
- eErr = PDumpOSBufprintf(hScript, ui32MaxLen, "RDW :%s:0x%X\r\n",
+ eErr = PDumpOSBufprintf(hScript, ui32MaxLen, "RDW :%s:0x%X\r\n",
psDevId->pszPDumpRegName,
ui32RegOffset);
if(eErr != PVRSRV_OK)
IMG_DEV_VIRTADDR sDevVAddr;
IMG_DEV_PHYADDR sDevPAddr;
IMG_DEV_VIRTADDR sDevVPageAddr;
-
+
PDUMP_MMU_ATTRIB *psMMUAttrib;
PDUMP_GET_SCRIPT_STRING();
psMMUAttrib = ((BM_BUF*)psROffMemInfo->sMemBlk.hBuffer)->pMapping->pBMHeap->psMMUAttrib;
-
+
PVR_ASSERT((ui32ROffOffset + sizeof(IMG_UINT32)) <= psROffMemInfo->uAllocSize);
pui8LinAddr = psROffMemInfo->pvLinAddrKM;
sDevVAddr = psROffMemInfo->sDevVAddr;
-
+
pui8LinAddr += ui32ROffOffset;
sDevVAddr.uiAddr += ui32ROffOffset;
-
+
PDumpOSCPUVAddrToPhysPages(psROffMemInfo->sMemBlk.hOSMemHandle,
psMMUAttrib->ui32DataPageMask,
&ui32PageOffset);
-
+
sDevVPageAddr.uiAddr = sDevVAddr.uiAddr - ui32PageOffset;
PVR_ASSERT((sDevVPageAddr.uiAddr & 0xFFF) == 0);
-
+
BM_GetPhysPageAddr(psROffMemInfo, sDevVPageAddr, &sDevPAddr);
-
+
sDevPAddr.uiAddr += ui32PageOffset;
eErr = PDumpOSBufprintf(hScript,
if (psMemInfo->pvLinAddrKM != IMG_NULL && pvAltLinAddrUM == IMG_NULL)
{
-
+
return PDumpMemKM(IMG_NULL,
psMemInfo,
ui32Offset,
pvAddrKM = GetTempBuffer();
-
+
PVR_ASSERT(pvAddrUM != IMG_NULL && pvAddrKM != IMG_NULL);
if (pvAddrUM == IMG_NULL || pvAddrKM == IMG_NULL)
{
if (eError != PVRSRV_OK)
{
-
+
if (ui32BytesDumped != 0)
{
PVR_DPF((PVR_DBG_ERROR, "PDumpMemUM: PDumpMemKM failed (%d)", eError));
{
IMG_UINT32 i;
-
+
for(i=0; i<MAX_PDUMP_MMU_CONTEXTS; i++)
{
if((gui16MMUContextUsage & (1U << i)) == 0)
{
-
+
gui16MMUContextUsage |= 1U << i;
*pui32MMUContextID = i;
return PVRSRV_OK;
{
if(ui32MMUContextID < MAX_PDUMP_MMU_CONTEXTS)
{
-
+
gui16MMUContextUsage &= ~(1U << ui32MMUContextID);
return PVRSRV_OK;
}
IMG_UINT32 *pui32MMUContextID,
IMG_UINT32 ui32MMUType,
IMG_HANDLE hUniqueTag1,
- IMG_HANDLE hOSMemHandle,
+ IMG_HANDLE hOSMemHandle,
IMG_VOID *pvPDCPUAddr)
{
IMG_UINT8 *pui8LinAddr = (IMG_UINT8 *)pvPDCPUAddr;
return eErr;
}
-
-
+
+
sCpuPAddr = OSMapLinToCPUPhys(hOSMemHandle, pui8LinAddr);
sDevPAddr = SysCpuPAddrToDevPAddr(eDeviceType, sCpuPAddr);
-
+
sDevPAddr.uiAddr &= ~((PVRSRV_4K_PAGE_SIZE) -1);
eErr = PDumpOSBufprintf(hScript,
- ui32MaxLen,
+ ui32MaxLen,
"MMU :%s:v%d %d :%s:PA_%08X%08X\r\n",
pszMemSpace,
ui32MMUContextID,
}
PDumpOSWriteString2(hScript, PDUMP_FLAGS_CONTINUOUS);
-
+
*pui32MMUContextID = ui32MMUContextID;
return PVRSRV_OK;
PVR_UNREFERENCED_PARAMETER(eDeviceType);
PVR_UNREFERENCED_PARAMETER(ui32MMUType);
-
+
PDumpComment("Clear MMU Context for memory space %s\r\n", pszMemSpace);
eErr = PDumpOSBufprintf(hScript,
- ui32MaxLen,
+ ui32MaxLen,
"MMU :%s:v%d\r\n",
pszMemSpace,
ui32MMUContextID);
PVRSRV_ERROR PDumpStoreMemToFile(PDUMP_MMU_ATTRIB *psMMUAttrib,
IMG_CHAR *pszFileName,
- IMG_UINT32 ui32FileOffset,
+ IMG_UINT32 ui32FileOffset,
PVRSRV_KERNEL_MEM_INFO *psMemInfo,
- IMG_UINT32 uiAddr,
+ IMG_UINT32 uiAddr,
IMG_UINT32 ui32Size,
IMG_UINT32 ui32PDumpFlags,
IMG_HANDLE hUniqueTag)
PDUMP_GET_SCRIPT_STRING();
-
+
ui32PageOffset = (IMG_UINT32)((IMG_UINTPTR_T)psMemInfo->pvLinAddrKM & psMMUAttrib->ui32DataPageMask);
-
-
+
+
sDevVPageAddr.uiAddr = uiAddr - ui32PageOffset;
-
-
+
+
BM_GetPhysPageAddr(psMemInfo, sDevVPageAddr, &sDevPAddr);
-
-
+
+
sDevPAddr.uiAddr += ui32PageOffset;
PDumpOSBufprintf(hScript,
pszFileName);
PDumpOSWriteString2(hScript, ui32PDumpFlags);
-
- return PVRSRV_OK;
+
+ return PVRSRV_OK;
}
PVRSRV_ERROR PDumpRegBasedCBP(IMG_CHAR *pszPDumpRegName,
ui32PacketSize,
ui32BufferSize);
PDumpOSWriteString2(hScript, ui32Flags);
-
- return PVRSRV_OK;
+
+ return PVRSRV_OK;
}
-
+
#include "syscommon.h"
IMG_EXPORT IMG_VOID PDumpConnectionNotify(IMG_VOID)
SYS_DATA *psSysData;
PVRSRV_DEVICE_NODE *psThis;
PVR_DPF((PVR_DBG_WARNING, "PDump has connected."));
-
-
+
+
SysAcquireData(&psSysData);
-
+
psThis = psSysData->psDeviceNodeList;
while (psThis)
{
if (psThis->pfnPDumpInitDevice)
{
-
+
psThis->pfnPDumpInitDevice(psThis);
}
psThis = psThis->psNext;
IMG_UINT32 ui32Off = 0;
PDBG_STREAM_CONTROL psCtrl = psStream->psCtrl;
-
+
if ((ui32Flags & PDUMP_FLAGS_NEVER) != 0)
{
return ui32BCount;
}
-
+
#if defined(SUPPORT_PDUMP_MULTI_PROCESS)
-
+
if ( (_PDumpIsProcessActive() == IMG_FALSE ) &&
((ui32Flags & PDUMP_FLAGS_PERSISTENT) == 0) )
{
}
#endif
-
+
if ( ((ui32Flags & PDUMP_FLAGS_PERSISTENT) != 0) && (psCtrl->bInitPhaseComplete) )
{
while (ui32BCount > 0)
{
-
+
ui32BytesWritten = PDumpOSDebugDriverWrite( psStream,
PVR_DPF((PVR_DBG_ERROR, "DbgWrite: Failed to send persistent data"));
if( (psCtrl->ui32Flags & DEBUG_FLAGS_READONLY) != 0)
{
-
+
PDumpSuspendKM();
}
return 0xFFFFFFFFU;
}
}
-
-
+
+
ui32BCount = ui32Off; ui32Off = 0; ui32BytesWritten = 0;
}
{
if ((ui32Flags & PDUMP_FLAGS_CONTINUOUS) != 0)
{
-
+
if (((psCtrl->ui32CapMode & DEBUG_CAPMODE_FRAMED) != 0) &&
(psCtrl->ui32Start == 0xFFFFFFFFU) &&
}
else
{
- ui32BytesWritten = PDumpOSDebugDriverWrite( psStream,
+ ui32BytesWritten = PDumpOSDebugDriverWrite( psStream,
PDUMP_WRITE_MODE_CONTINUOUS,
&pui8Data[ui32Off], ui32BCount, 1, 0);
}
if (ui32Flags & PDUMP_FLAGS_LASTFRAME)
{
IMG_UINT32 ui32DbgFlags;
-
+
ui32DbgFlags = 0;
if (ui32Flags & PDUMP_FLAGS_RESETLFBUFFER)
{
ui32DbgFlags |= WRITELF_FLAGS_RESETBUF;
}
-
+
ui32BytesWritten = PDumpOSDebugDriverWrite( psStream,
PDUMP_WRITE_MODE_LASTFRAME,
&pui8Data[ui32Off], ui32BCount, 1, ui32DbgFlags);
}
else
{
- ui32BytesWritten = PDumpOSDebugDriverWrite( psStream,
+ ui32BytesWritten = PDumpOSDebugDriverWrite( psStream,
PDUMP_WRITE_MODE_BINCM,
&pui8Data[ui32Off], ui32BCount, 1, 0);
}
}
-
+
if (ui32BytesWritten == 0)
ui32BCount -= ui32BytesWritten;
}
-
+
}
-
+
return ui32BytesWritten;
}
-#else
-#endif
+#else
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
if (uiPerProc == 0)
{
PVR_DPF((PVR_DBG_ERROR, "FreePerProcessData: Couldn't find process in per-process data hash table"));
-
+
PVR_ASSERT(psPerProc->ui32PID == 0);
}
else
PVR_ASSERT(((PVRSRV_PER_PROCESS_DATA *)uiPerProc)->ui32PID == psPerProc->ui32PID);
}
-
+
if (psPerProc->psHandleBase != IMG_NULL)
{
eError = PVRSRVFreeHandleBase(psPerProc->psHandleBase);
}
}
-
+
if (psPerProc->hPerProcData != IMG_NULL)
{
eError = PVRSRVReleaseHandle(KERNEL_HANDLE_BASE, psPerProc->hPerProcData, PVRSRV_HANDLE_TYPE_PERPROC_DATA);
}
}
-
+
eError = OSPerProcessPrivateDataDeInit(psPerProc->hOsPrivateData);
if (eError != PVRSRV_OK)
{
sizeof(*psPerProc),
psPerProc,
psPerProc->hBlockAlloc);
-
+
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR, "FreePerProcessData: Couldn't free per-process data (%d)", eError));
PVR_ASSERT(psHashTab != IMG_NULL);
-
+
psPerProc = (PVRSRV_PER_PROCESS_DATA *)HASH_Retrieve(psHashTab, (IMG_UINTPTR_T)ui32PID);
return psPerProc;
}
return PVRSRV_ERROR_INIT_FAILURE;
}
-
+
psPerProc = (PVRSRV_PER_PROCESS_DATA *)HASH_Retrieve(psHashTab, (IMG_UINTPTR_T)ui32PID);
if (psPerProc == IMG_NULL)
{
-
+
eError = OSAllocMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
sizeof(*psPerProc),
(IMG_PVOID *)&psPerProc,
PVR_UNREFERENCED_PARAMETER(ui32Flags);
#endif
-
+
eError = OSPerProcessPrivateDataInit(&psPerProc->hOsPrivateData);
if (eError != PVRSRV_OK)
{
goto failure;
}
-
+
eError = PVRSRVAllocHandle(KERNEL_HANDLE_BASE,
&psPerProc->hPerProcData,
psPerProc,
goto failure;
}
-
+
eError = PVRSRVAllocHandleBase(&psPerProc->psHandleBase);
if (eError != PVRSRV_OK)
{
goto failure;
}
-
+
eError = OSPerProcessSetHandleOptions(psPerProc->psHandleBase);
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR, "PVRSRVPerProcessDataConnect: Couldn't set handle options (%d)", eError));
goto failure;
}
-
-
+
+
eError = PVRSRVResManConnect(psPerProc, &psPerProc->hResManContext);
if (eError != PVRSRV_OK)
{
PVRSRVTimeTraceBufferCreate(ui32PID);
#endif
}
-
+
psPerProc->ui32RefCount++;
PVR_DPF((PVR_DBG_MESSAGE,
"PVRSRVPerProcessDataConnect: Process 0x%x has ref-count %d",
PVRSRVTimeTraceBufferDestroy(ui32PID);
#endif
-
+
PVRSRVResManDisconnect(psPerProc->hResManContext, IMG_FALSE);
-
-
+
+
eError = FreePerProcessData(psPerProc);
if (eError != PVRSRV_OK)
{
{
PVR_ASSERT(psHashTab == IMG_NULL);
-
+
psHashTab = HASH_Create(HASH_TAB_INIT_SIZE);
if (psHashTab == IMG_NULL)
{
PVRSRV_ERROR PVRSRVPerProcessDataDeInit(IMG_VOID)
{
-
+
if (psHashTab != IMG_NULL)
{
-
+
HASH_Delete(psHashTab);
psHashTab = IMG_NULL;
}
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
}
else if (bTryLock)
{
-
+
eError = PVRSRV_ERROR_RETRY;
break;
OSPowerLockUnwrap();
}
-
+
if ((eError == PVRSRV_OK) &&
!bSystemPowerEvent &&
!_IsSystemStatePowered(psSysData->eCurrentPowerState))
{
-
+
PVRSRVPowerUnlock(ui32CallerID);
eError = PVRSRV_ERROR_RETRY;
}
PVRSRV_DEV_POWER_STATE eNewDevicePowerState;
PVRSRV_ERROR eError;
-
+
IMG_BOOL bAllDevices;
IMG_UINT32 ui32DeviceIndex;
PVRSRV_DEV_POWER_STATE eNewPowerState;
-
+
bAllDevices = va_arg(va, IMG_BOOL);
ui32DeviceIndex = va_arg(va, IMG_UINT32);
eNewPowerState = va_arg(va, PVRSRV_DEV_POWER_STATE);
{
if (psPowerDevice->pfnPrePower != IMG_NULL)
{
-
+
eError = psPowerDevice->pfnPrePower(psPowerDevice->hDevCookie,
eNewDevicePowerState,
psPowerDevice->eCurrentPowerState);
}
}
-
+
eError = SysDevicePrePowerState(psPowerDevice->ui32DeviceIndex,
eNewDevicePowerState,
psPowerDevice->eCurrentPowerState);
SysAcquireData(&psSysData);
-
+
eError = List_PVRSRV_POWER_DEV_PVRSRV_ERROR_Any_va(psSysData->psPowerDeviceList,
&PVRSRVDevicePrePowerStateKM_AnyVaCb,
bAllDevices,
PVRSRV_DEV_POWER_STATE eNewDevicePowerState;
PVRSRV_ERROR eError;
-
+
IMG_BOOL bAllDevices;
IMG_UINT32 ui32DeviceIndex;
PVRSRV_DEV_POWER_STATE eNewPowerState;
-
+
bAllDevices = va_arg(va, IMG_BOOL);
ui32DeviceIndex = va_arg(va, IMG_UINT32);
eNewPowerState = va_arg(va, PVRSRV_DEV_POWER_STATE);
if (psPowerDevice->eCurrentPowerState != eNewDevicePowerState)
{
-
+
eError = SysDevicePostPowerState(psPowerDevice->ui32DeviceIndex,
eNewDevicePowerState,
psPowerDevice->eCurrentPowerState);
if (psPowerDevice->pfnPostPower != IMG_NULL)
{
-
+
eError = psPowerDevice->pfnPostPower(psPowerDevice->hDevCookie,
eNewDevicePowerState,
psPowerDevice->eCurrentPowerState);
SysAcquireData(&psSysData);
-
+
eError = List_PVRSRV_POWER_DEV_PVRSRV_ERROR_Any_va(psSysData->psPowerDeviceList,
&PVRSRVDevicePostPowerStateKM_AnyVaCb,
bAllDevices,
#if defined(PDUMP)
if (eNewPowerState == PVRSRV_DEV_POWER_STATE_DEFAULT)
{
-
+
PDUMPSUSPEND();
}
- #endif
+ #endif
eError = PVRSRVDevicePrePowerStateKM(IMG_FALSE, ui32DeviceIndex, eNewPowerState);
if(eError != PVRSRV_OK)
SysAcquireData(&psSysData);
-
+
eError = PVRSRVPowerLock(KERNEL_ID, IMG_TRUE);
if(eError != PVRSRV_OK)
{
{
if (_IsSystemStatePowered(eNewSysPowerState))
{
-
+
eNewDevicePowerState = PVRSRV_DEV_POWER_STATE_DEFAULT;
}
else
eNewDevicePowerState = PVRSRV_DEV_POWER_STATE_OFF;
}
-
+
eError = PVRSRVDevicePrePowerStateKM(IMG_TRUE, 0, eNewDevicePowerState);
if (eError != PVRSRV_OK)
{
if (eNewSysPowerState != psSysData->eCurrentPowerState)
{
-
+
eError = SysSystemPrePowerState(eNewSysPowerState);
if (eError != PVRSRV_OK)
{
"PVRSRVSystemPrePowerStateKM: Transition from %d to %d FAILED 0x%x",
psSysData->eCurrentPowerState, eNewSysPowerState, eError));
-
+
psSysData->eFailedPowerState = eNewSysPowerState;
PVRSRVPowerUnlock(KERNEL_ID);
if (eNewSysPowerState != psSysData->eCurrentPowerState)
{
-
+
eError = SysSystemPostPowerState(eNewSysPowerState);
if (eError != PVRSRV_OK)
{
{
if (_IsSystemStatePowered(eNewSysPowerState))
{
-
+
eNewDevicePowerState = PVRSRV_DEV_POWER_STATE_DEFAULT;
}
else
eNewDevicePowerState = PVRSRV_DEV_POWER_STATE_OFF;
}
-
+
eError = PVRSRVDevicePostPowerStateKM(IMG_TRUE, 0, eNewDevicePowerState);
if (eError != PVRSRV_OK)
{
PVRSRVPowerUnlock(KERNEL_ID);
-
+
if (_IsSystemStatePowered(eNewSysPowerState) &&
PVRSRVGetInitServerState(PVRSRV_INIT_SERVER_SUCCESSFUL))
{
-
+
PVRSRVScheduleDeviceCallbacks();
goto ErrorExit;
}
-
+
psSysData->eFailedPowerState = PVRSRV_SYS_POWER_STATE_Unspecified;
return PVRSRV_OK;
"PVRSRVSetPowerStateKM: Transition from %d to %d FAILED 0x%x",
psSysData->eCurrentPowerState, eNewSysPowerState, eError));
-
+
psSysData->eFailedPowerState = eNewSysPowerState;
return eError;
return eError;
}
-
+
psPowerDevice->pfnPrePower = pfnPrePower;
psPowerDevice->pfnPostPower = pfnPostPower;
psPowerDevice->pfnPreClockSpeedChange = pfnPreClockSpeedChange;
psPowerDevice->eCurrentPowerState = eCurrentPowerState;
psPowerDevice->eDefaultPowerState = eDefaultPowerState;
-
+
List_PVRSRV_POWER_DEV_Insert(&(psSysData->psPowerDeviceList), psPowerDevice);
return (PVRSRV_OK);
SysAcquireData(&psSysData);
-
+
psPowerDev = (PVRSRV_POWER_DEV*)
List_PVRSRV_POWER_DEV_Any_va(psSysData->psPowerDeviceList,
&MatchPowerDeviceIndex_AnyVaCb,
{
List_PVRSRV_POWER_DEV_Remove(psPowerDev);
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_POWER_DEV), psPowerDev, IMG_NULL);
-
+
}
return (PVRSRV_OK);
SysAcquireData(&psSysData);
-
+
if (OSIsResourceLocked(&psSysData->sPowerStateChangeResource, KERNEL_ID) ||
OSIsResourceLocked(&psSysData->sPowerStateChangeResource, ISR_ID))
{
if (bIdleDevice)
{
-
+
eError = PVRSRVPowerLock(KERNEL_ID, IMG_FALSE);
if (eError != PVRSRV_OK)
{
}
}
-
+
psPowerDevice = (PVRSRV_POWER_DEV*)
List_PVRSRV_POWER_DEV_Any_va(psSysData->psPowerDeviceList,
&MatchPowerDeviceIndex_AnyVaCb,
SysAcquireData(&psSysData);
-
+
psPowerDevice = (PVRSRV_POWER_DEV*)
List_PVRSRV_POWER_DEV_Any_va(psSysData->psPowerDeviceList,
&MatchPowerDeviceIndex_AnyVaCb,
if (bIdleDevice)
{
-
+
PVRSRVPowerUnlock(KERNEL_ID);
}
}
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
psDeviceWalker = &psSysData->sDeviceID[0];
psDeviceEnd = psDeviceWalker + psSysData->ui32NumDevices;
-
+
while (psDeviceWalker < psDeviceEnd)
{
if (!psDeviceWalker->bInUse)
PVR_DPF((PVR_DBG_ERROR,"AllocateDeviceID: No free and valid device IDs available!"));
-
+
PVR_ASSERT(psDeviceWalker < psDeviceEnd);
return PVRSRV_ERROR_NO_FREE_DEVICEIDS_AVALIABLE;
psDeviceWalker = &psSysData->sDeviceID[0];
psDeviceEnd = psDeviceWalker + psSysData->ui32NumDevices;
-
+
while (psDeviceWalker < psDeviceEnd)
{
-
+
if (
(psDeviceWalker->uiID == ui32DevID) &&
(psDeviceWalker->bInUse)
PVR_DPF((PVR_DBG_ERROR,"FreeDeviceID: no matching dev ID that is in use!"));
-
+
PVR_ASSERT(psDeviceWalker < psDeviceEnd);
return PVRSRV_ERROR_INVALID_DEVICEID;
SysAcquireData(&psSysData);
-
+
for (i=0; i<PVRSRV_MAX_DEVICES; i++)
{
psDevIdList[i].eDeviceType = PVRSRV_DEVICE_TYPE_UNKNOWN;
}
-
+
*pui32NumDevices = 0;
-
+
{
PVRSRV_ERROR eError;
-
+
eError = ResManInit();
if (eError != PVRSRV_OK)
{
goto Error;
}
-
+
eError = PVRSRVHandleInit();
if(eError != PVRSRV_OK)
{
goto Error;
}
-
+
eError = OSCreateResource(&psSysData->sPowerStateChangeResource);
if (eError != PVRSRV_OK)
{
goto Error;
}
-
+
psSysData->eCurrentPowerState = PVRSRV_SYS_POWER_STATE_D0;
psSysData->eFailedPowerState = PVRSRV_SYS_POWER_STATE_Unspecified;
-
+
if(OSAllocMem( PVRSRV_PAGEABLE_SELECT,
sizeof(PVRSRV_EVENTOBJECT) ,
(IMG_VOID **)&psSysData->psGlobalEventObject, 0,
goto Error;
}
-
+
psSysData->pfnHighResTimerCreate = OSFuncHighResTimerCreate;
psSysData->pfnHighResTimerGetus = OSFuncHighResTimerGetus;
psSysData->pfnHighResTimerDestroy = OSFuncHighResTimerDestroy;
g_ui32InitFlags |= INIT_DATA_ENABLE_TTARCE;
#endif
-
+
PDUMPINIT();
g_ui32InitFlags |= INIT_DATA_ENABLE_PDUMPINIT;
PERFDEINIT();
#if defined(TTRACE)
-
+
if ((g_ui32InitFlags & INIT_DATA_ENABLE_TTARCE) > 0)
{
PVRSRVTimeTraceDeinit();
}
#endif
-
+
if( (g_ui32InitFlags & INIT_DATA_ENABLE_PDUMPINIT) > 0)
{
PDUMPDEINIT();
}
-
-
+
+
if(psSysData->psGlobalEventObject)
{
OSEventObjectDestroyKM(psSysData->psGlobalEventObject);
PVRSRV_ERROR eError;
PVRSRV_DEVICE_NODE *psDeviceNode;
-
+
if(OSAllocMem( PVRSRV_OS_NON_PAGEABLE_HEAP,
sizeof(PVRSRV_DEVICE_NODE),
(IMG_VOID **)&psDeviceNode, IMG_NULL,
{
OSFreeMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
sizeof(PVRSRV_DEVICE_NODE), psDeviceNode, IMG_NULL);
-
+
PVR_DPF((PVR_DBG_ERROR,"PVRSRVRegisterDevice : Failed to register device"));
return (PVRSRV_ERROR_DEVICE_REGISTER_FAILED);
}
-
+
psDeviceNode->psSysData = psSysData;
psDeviceNode->ui32SOCInterruptBit = ui32SOCInterruptBit;
-
+
AllocateDeviceID(psSysData, &psDeviceNode->sDevId.ui32DeviceIndex);
-
+
List_PVRSRV_DEVICE_NODE_Insert(&psSysData->psDeviceNodeList, psDeviceNode);
-
+
*pui32DeviceIndex = psDeviceNode->sDevId.ui32DeviceIndex;
return PVRSRV_OK;
SysAcquireData(&psSysData);
-
+
psDeviceNode = (PVRSRV_DEVICE_NODE*)
List_PVRSRV_DEVICE_NODE_Any_va(psSysData->psDeviceNodeList,
&MatchDeviceKM_AnyVaCb,
IMG_TRUE);
if(!psDeviceNode)
{
-
+
PVR_DPF((PVR_DBG_ERROR,"PVRSRVInitialiseDevice: requested device is not present"));
return PVRSRV_ERROR_INIT_FAILURE;
}
PVR_ASSERT (psDeviceNode->ui32RefCount > 0);
-
+
eError = PVRSRVResManConnect(IMG_NULL, &psDeviceNode->hResManContext);
if (eError != PVRSRV_OK)
return eError;
}
-
+
if(psDeviceNode->pfnInitDevice != IMG_NULL)
{
eError = psDeviceNode->pfnInitDevice(psDeviceNode);
return eError;
}
-
+
eError = List_PVRSRV_DEVICE_NODE_PVRSRV_ERROR_Any(psSysData->psDeviceNodeList,
&PVRSRVFinaliseSystem_SetPowerState_AnyCb);
if (eError != PVRSRV_OK)
return eError;
}
-
+
eError = List_PVRSRV_DEVICE_NODE_PVRSRV_ERROR_Any(psSysData->psDeviceNodeList,
&PVRSRVFinaliseSystem_CompatCheck_AnyCb);
if (eError != PVRSRV_OK)
}
}
-
+
PVRSRV_ERROR PVRSRVDevInitCompatCheck(PVRSRV_DEVICE_NODE *psDeviceNode)
{
-
+
if (psDeviceNode->pfnInitDeviceCompatCheck)
return psDeviceNode->pfnInitDeviceCompatCheck(psDeviceNode);
else
SysAcquireData(&psSysData);
-
+
psDeviceNode = List_PVRSRV_DEVICE_NODE_Any_va(psSysData->psDeviceNodeList,
&PVRSRVAcquireDeviceDataKM_Match_AnyVaCb,
eDeviceType,
if (!psDeviceNode)
{
-
+
PVR_DPF((PVR_DBG_ERROR,"PVRSRVAcquireDeviceDataKM: requested device is not present"));
return PVRSRV_ERROR_INIT_FAILURE;
}
PVR_ASSERT (psDeviceNode->ui32RefCount > 0);
-
+
if (phDevCookie)
{
*phDevCookie = (IMG_HANDLE)psDeviceNode;
return PVRSRV_ERROR_DEVICEID_NOT_FOUND;
}
-
+
eError = PVRSRVSetDevicePowerStateKM(ui32DevIndex,
PVRSRV_DEV_POWER_STATE_OFF,
return eError;
}
-
+
eError = ResManFreeResByCriteria(psDeviceNode->hResManContext,
RESMAN_CRITERIA_RESTYPE,
return eError;
}
-
+
if(psDeviceNode->pfnDeInitDevice != IMG_NULL)
{
}
}
-
+
PVRSRVResManDisconnect(psDeviceNode->hResManContext, IMG_TRUE);
psDeviceNode->hResManContext = IMG_NULL;
-
+
List_PVRSRV_DEVICE_NODE_Remove(psDeviceNode);
-
+
(IMG_VOID)FreeDeviceID(psSysData, ui32DevIndex);
OSFreeMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
sizeof(PVRSRV_DEVICE_NODE), psDeviceNode, IMG_NULL);
-
+
return (PVRSRV_OK);
}
}
#else
{
- IMG_UINT32 ui32ActualValue = 0xFFFFFFFFU;
+ IMG_UINT32 ui32ActualValue = 0xFFFFFFFFU;
if (bAllowPreemption)
{
PVR_ASSERT(ui32PollPeriodus >= 1000);
}
-
+
LOOP_UNTIL_TIMEOUT(ui32Timeoutus)
{
ui32ActualValue = (*pui32LinMemAddr & ui32Mask);
{
return PVRSRV_OK;
}
-
+
if (bAllowPreemption)
{
OSSleepms(ui32PollPeriodus / 1000);
OSWaitus(ui32PollPeriodus);
}
} END_LOOP_UNTIL_TIMEOUT();
-
+
PVR_DPF((PVR_DBG_ERROR,"PollForValueKM: Timeout. Expected 0x%x but found 0x%x (mask 0x%x).",
ui32Value, ui32ActualValue, ui32Mask));
}
pui32StrLen = va_arg(va, IMG_UINT32*);
ui32Mode = va_arg(va, IMG_UINT32);
-
+
switch(ui32Mode)
{
case PVRSRV_MISC_INFO_MEMSTATS_PRESENT:
*pi32Count = OSSNPrintf(*ppszStr, 100, "\n\nDevice Type %d:\n", psDeviceNode->sDevId.eDeviceType);
UPDATE_SPACE(*ppszStr, *pi32Count, *pui32StrLen);
-
+
if(psDeviceNode->sDevMemoryInfo.pBMKernelContext)
{
CHECK_SPACE(*pui32StrLen);
ui32Mode);
}
-
+
return List_BM_CONTEXT_PVRSRV_ERROR_Any_va(psDeviceNode->sDevMemoryInfo.pBMContext,
&PVRSRVGetMiscInfoKM_BMContext_AnyVaCb,
pui32StrLen,
psMiscInfo->ui32StatePresent = 0;
-
+
if(psMiscInfo->ui32StateRequest & ~(PVRSRV_MISC_INFO_TIMER_PRESENT
|PVRSRV_MISC_INFO_CLOCKGATE_PRESENT
|PVRSRV_MISC_INFO_MEMSTATS_PRESENT
SysAcquireData(&psSysData);
-
+
if(((psMiscInfo->ui32StateRequest & PVRSRV_MISC_INFO_TIMER_PRESENT) != 0UL) &&
(psSysData->pvSOCTimerRegisterKM != IMG_NULL))
{
psMiscInfo->hSOCTimerRegisterOSMemHandle = IMG_NULL;
}
-
+
if(((psMiscInfo->ui32StateRequest & PVRSRV_MISC_INFO_CLOCKGATE_PRESENT) != 0UL) &&
(psSysData->pvSOCClockGateRegsBase != IMG_NULL))
{
psMiscInfo->ui32SOCClockGateRegsSize = psSysData->ui32SOCClockGateRegsSize;
}
-
+
if(((psMiscInfo->ui32StateRequest & PVRSRV_MISC_INFO_MEMSTATS_PRESENT) != 0UL) &&
(psMiscInfo->pszMemoryStr != IMG_NULL))
{
psMiscInfo->ui32StatePresent |= PVRSRV_MISC_INFO_MEMSTATS_PRESENT;
-
+
ppArena = &psSysData->apsLocalDevMemArena[0];
while(*ppArena)
{
RA_GetStats(*ppArena,
&pszStr,
&ui32StrLen);
-
+
ppArena++;
}
-
-
+
+
List_PVRSRV_DEVICE_NODE_PVRSRV_ERROR_Any_va(psSysData->psDeviceNodeList,
&PVRSRVGetMiscInfoKM_Device_AnyVaCb,
&ui32StrLen,
&pszStr,
PVRSRV_MISC_INFO_MEMSTATS_PRESENT);
-
+
i32Count = OSSNPrintf(pszStr, 100, "\n");
UPDATE_SPACE(pszStr, i32Count, ui32StrLen);
}
-
+
if(((psMiscInfo->ui32StateRequest & PVRSRV_MISC_INFO_FREEMEM_PRESENT) != 0)
&& psMiscInfo->pszMemoryStr)
{
IMG_CHAR *pszStr;
IMG_UINT32 ui32StrLen;
IMG_INT32 i32Count;
-
+
pszStr = psMiscInfo->pszMemoryStr;
ui32StrLen = psMiscInfo->ui32MemoryStrLen;
-
+
psMiscInfo->ui32StatePresent |= PVRSRV_MISC_INFO_FREEMEM_PRESENT;
-
+
List_PVRSRV_DEVICE_NODE_PVRSRV_ERROR_Any_va(psSysData->psDeviceNodeList,
&PVRSRVGetMiscInfoKM_Device_AnyVaCb,
&ui32StrLen,
&i32Count,
&pszStr,
PVRSRV_MISC_INFO_FREEMEM_PRESENT);
-
+
i32Count = OSSNPrintf(pszStr, 100, "\n");
UPDATE_SPACE(pszStr, i32Count, ui32StrLen);
}
psMiscInfo->sGlobalEventObject = *psSysData->psGlobalEventObject;
}
-
+
if (((psMiscInfo->ui32StateRequest & PVRSRV_MISC_INFO_DDKVERSION_PRESENT) != 0UL)
&& ((psMiscInfo->ui32StateRequest & PVRSRV_MISC_INFO_MEMSTATS_PRESENT) == 0UL)
{
IMG_CHAR *pszStr;
IMG_UINT32 ui32StrLen;
- IMG_UINT32 ui32LenStrPerNum = 12;
+ IMG_UINT32 ui32LenStrPerNum = 12;
IMG_INT32 i32Count;
IMG_INT i;
psMiscInfo->ui32StatePresent |= PVRSRV_MISC_INFO_DDKVERSION_PRESENT;
-
+
psMiscInfo->aui32DDKVersion[0] = PVRVERSION_MAJ;
psMiscInfo->aui32DDKVersion[1] = PVRVERSION_MIN;
psMiscInfo->aui32DDKVersion[2] = PVRVERSION_BUILD_HI;
if(psMiscInfo->sCacheOpCtl.bDeferOp)
{
-
+
psSysData->ePendingCacheOpType = psMiscInfo->sCacheOpCtl.eCacheOpType;
}
else
PVR_LOG(("User requested OS reset"));
OSPanic();
}
-#endif
+#endif
return PVRSRV_OK;
}
}
psSysData = psDeviceNode->psSysData;
-
+
ui32InterruptSource = SysGetInterruptSource(psSysData, psDeviceNode);
if(ui32InterruptSource & psDeviceNode->ui32SOCInterruptBit)
{
{
if((*psDeviceNode->pfnDeviceISR)(psDeviceNode->pvISRData))
{
-
+
*pbStatus = IMG_TRUE;
}
-
+
*pui32ClearInterrupts |= psDeviceNode->ui32SOCInterruptBit;
}
}
}
else
{
-
+
ui32InterruptSource = SysGetInterruptSource(psSysData, IMG_NULL);
-
+
if(ui32InterruptSource)
{
-
+
List_PVRSRV_DEVICE_NODE_ForEach_va(psSysData->psDeviceNodeList,
&PVRSRVSystemLISR_ForEachVaCb,
&bStatus,
return;
}
-
+
List_PVRSRV_DEVICE_NODE_ForEach(psSysData->psDeviceNodeList,
&PVRSRVMISR_ForEachCb);
-
+
if (PVRSRVProcessQueues(IMG_FALSE) == PVRSRV_ERROR_PROCESSING_BLOCKED)
{
PVRSRVProcessQueues(IMG_FALSE);
}
-
+
if (psSysData->psGlobalEventObject)
{
IMG_HANDLE hOSEventKM = psSysData->psGlobalEventObject->hOSEventKM;
sSegDetails.sCpuPhyAddr.uiAddr = 0;
sSegDetails.hSegment = 0;
-
+
while (RA_GetNextLiveSegment(hArena, &sSegDetails))
{
if (pbyBuffer == IMG_NULL)
{
-
+
uiBytesSaved += sizeof(sSegDetails.uiSize) + sSegDetails.uiSize;
}
else
PVR_DPF((PVR_DBG_MESSAGE, "PVRSRVSaveRestoreLiveSegments: Base %08x size %08x", sSegDetails.sCpuPhyAddr.uiAddr, sSegDetails.uiSize));
-
+
pvLocalMemCPUVAddr = OSMapPhysToLin(sSegDetails.sCpuPhyAddr,
sSegDetails.uiSize,
PVRSRV_HAP_KERNEL_ONLY|PVRSRV_HAP_UNCACHED,
if (bSave)
{
-
+
OSMemCopy(pbyBuffer, &sSegDetails.uiSize, sizeof(sSegDetails.uiSize));
pbyBuffer += sizeof(sSegDetails.uiSize);
else
{
IMG_UINT32 uiSize;
-
+
OSMemCopy(&uiSize, pbyBuffer, sizeof(sSegDetails.uiSize));
if (uiSize != sSegDetails.uiSize)
IMG_EXPORT
const IMG_CHAR *PVRSRVGetErrorStringKM(PVRSRV_ERROR eError)
-{
-
+{
+
#include "pvrsrv_errors.h"
}
{
if(psDeviceNode->pfnDeviceCommandComplete != IMG_NULL)
{
-
+
(*psDeviceNode->pfnDeviceCommandComplete)(psDeviceNode);
}
}
SYS_DATA *psSysData;
SysAcquireData(&psSysData);
-
+
List_PVRSRV_DEVICE_NODE_ForEach(psSysData->psDeviceNodeList,
&PVRSRVCommandCompleteCallbacks_ForEachCb);
}
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#include "services_headers.h"
-#include "pvr_bridge_km.h"
#include "lists.h"
#include "ttrace.h"
}
}
-
+
ui32ReadOffset += psCmd->uCmdSize;
ui32ReadOffset &= psQueue->ui32QueueSize - 1;
cmds++;
return psQueue;
}
-#endif
+#endif
#define GET_SPACE_IN_CMDQ(psQueue) \
((((psQueue)->ui32ReadOffset - (psQueue)->ui32WriteOffset) \
SysAcquireData(&psSysData);
-
+
eError = OSAllocMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
sizeof(PVRSRV_QUEUE_INFO),
(IMG_VOID **)&psQueueInfo, &hMemBlock,
psQueueInfo->hMemBlock[0] = hMemBlock;
psQueueInfo->ui32ProcessID = OSGetCurrentProcessIDKM();
-
+
eError = OSAllocMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
ui32Power2QueueSize + PVRSRV_MAX_CMD_SIZE,
&psQueueInfo->pvLinQueueKM, &hMemBlock,
psQueueInfo->hMemBlock[1] = hMemBlock;
psQueueInfo->pvLinQueueUM = psQueueInfo->pvLinQueueKM;
-
+
PVR_ASSERT(psQueueInfo->ui32ReadOffset == 0);
PVR_ASSERT(psQueueInfo->ui32WriteOffset == 0);
psQueueInfo->ui32QueueSize = ui32Power2QueueSize;
-
+
if (psSysData->psQueueList == IMG_NULL)
{
eError = OSCreateResource(&psSysData->sQProcessResource);
}
}
-
+
eError = OSLockResource(&psSysData->sQProcessResource,
KERNEL_ID);
if (eError != PVRSRV_OK)
sizeof(PVRSRV_QUEUE_INFO),
psQueueInfo,
psQueueInfo->hMemBlock[0]);
-
+
}
return eError;
psQueue = psSysData->psQueueList;
-
+
LOOP_UNTIL_TIMEOUT(MAX_HW_TIME_US)
{
if(psQueueInfo->ui32ReadOffset == psQueueInfo->ui32WriteOffset)
if (bTimeout)
{
-
+
PVR_DPF((PVR_DBG_ERROR,"PVRSRVDestroyCommandQueueKM : Failed to empty queue"));
eError = PVRSRV_ERROR_CANNOT_FLUSH_QUEUE;
goto ErrorExit;
}
-
+
eError = OSLockResource(&psSysData->sQProcessResource,
KERNEL_ID);
if (eError != PVRSRV_OK)
sizeof(PVRSRV_QUEUE_INFO),
psQueueInfo,
psQueueInfo->hMemBlock[0]);
-
- psQueueInfo = IMG_NULL;
+
+ psQueueInfo = IMG_NULL;
}
else
{
sizeof(PVRSRV_QUEUE_INFO),
psQueueInfo,
psQueueInfo->hMemBlock[0]);
-
- psQueueInfo = IMG_NULL;
+
+ psQueueInfo = IMG_NULL;
break;
}
psQueue = psQueue->psNextKM;
}
}
-
+
eError = OSUnlockResource(&psSysData->sQProcessResource, KERNEL_ID);
if (eError != PVRSRV_OK)
{
goto ErrorExit;
}
-
+
if (psSysData->psQueueList == IMG_NULL)
{
eError = OSDestroyResource(&psSysData->sQProcessResource);
{
IMG_BOOL bTimeout = IMG_TRUE;
-
+
ui32ParamSize = (ui32ParamSize+3) & 0xFFFFFFFC;
if (ui32ParamSize > PVRSRV_MAX_CMD_SIZE)
return PVRSRV_ERROR_CMD_TOO_BIG;
}
-
+
LOOP_UNTIL_TIMEOUT(MAX_HW_TIME_US)
{
if (GET_SPACE_IN_CMDQ(psQueue) > ui32ParamSize)
return PVRSRV_ERROR_INVALID_PARAMS;
}
-
+
ui32DataByteSize = (ui32DataByteSize + 3UL) & ~3UL;
-
+
ui32CommandSize = sizeof(PVRSRV_COMMAND)
+ ((ui32DstSyncCount + ui32SrcSyncCount) * sizeof(PVRSRV_SYNC_OBJECT))
+ ui32DataByteSize;
-
+
eError = PVRSRVGetQueueSpaceKM (psQueue, ui32CommandSize, (IMG_VOID**)&psCommand);
if(eError != PVRSRV_OK)
{
psCommand->ui32ProcessID = OSGetCurrentProcessIDKM();
-
- psCommand->uCmdSize = ui32CommandSize;
+
+ psCommand->uCmdSize = ui32CommandSize;
psCommand->ui32DevIndex = ui32DevIndex;
psCommand->CommandType = CommandType;
psCommand->ui32DstSyncCount = ui32DstSyncCount;
psCommand->ui32SrcSyncCount = ui32SrcSyncCount;
-
-
+
+
psCommand->psDstSync = (PVRSRV_SYNC_OBJECT*)(((IMG_UINTPTR_T)psCommand) + sizeof(PVRSRV_COMMAND));
PVR_TTRACE_UI32(PVRSRV_TRACE_GROUP_QUEUE, PVRSRV_TRACE_CLASS_NONE,
QUEUE_TOKEN_COMMAND_TYPE, CommandType);
-
+
for (i=0; i<ui32DstSyncCount; i++)
{
PVR_TTRACE_SYNC_OBJECT(PVRSRV_TRACE_GROUP_QUEUE, QUEUE_TOKEN_DST_SYNC,
psCommand->psDstSync[i].ui32WriteOpsPending = PVRSRVGetWriteOpsPending(apsDstSync[i], IMG_FALSE);
psCommand->psDstSync[i].ui32ReadOps2Pending = PVRSRVGetReadOpsPending(apsDstSync[i], IMG_FALSE);
- PVRSRVKernelSyncInfoIncRef(apsDstSync[i], IMG_NULL);
-
PVR_DPF((PVR_DBG_MESSAGE, "PVRSRVInsertCommandKM: Dst %u RO-VA:0x%x WO-VA:0x%x ROP:0x%x WOP:0x%x",
i, psCommand->psDstSync[i].psKernelSyncInfoKM->sReadOps2CompleteDevVAddr.uiAddr,
psCommand->psDstSync[i].psKernelSyncInfoKM->sWriteOpsCompleteDevVAddr.uiAddr,
psCommand->psDstSync[i].ui32WriteOpsPending));
}
-
+
for (i=0; i<ui32SrcSyncCount; i++)
{
PVR_TTRACE_SYNC_OBJECT(PVRSRV_TRACE_GROUP_QUEUE, QUEUE_TOKEN_DST_SYNC,
psCommand->psSrcSync[i].ui32WriteOpsPending = PVRSRVGetWriteOpsPending(apsSrcSync[i], IMG_TRUE);
psCommand->psSrcSync[i].ui32ReadOps2Pending = PVRSRVGetReadOpsPending(apsSrcSync[i], IMG_TRUE);
- PVRSRVKernelSyncInfoIncRef(apsSrcSync[i], IMG_NULL);
-
PVR_DPF((PVR_DBG_MESSAGE, "PVRSRVInsertCommandKM: Src %u RO-VA:0x%x WO-VA:0x%x ROP:0x%x WOP:0x%x",
i, psCommand->psSrcSync[i].psKernelSyncInfoKM->sReadOps2CompleteDevVAddr.uiAddr,
psCommand->psSrcSync[i].psKernelSyncInfoKM->sWriteOpsCompleteDevVAddr.uiAddr,
}
PVR_TTRACE(PVRSRV_TRACE_GROUP_QUEUE, PVRSRV_TRACE_CLASS_CMD_END, QUEUE_TOKEN_INSERTKM);
-
+
*ppsCommand = psCommand;
return PVRSRV_OK;
PVRSRV_ERROR IMG_CALLCONV PVRSRVSubmitCommandKM(PVRSRV_QUEUE_INFO *psQueue,
PVRSRV_COMMAND *psCommand)
{
-
-
-
+
+
+
if (psCommand->ui32DstSyncCount > 0)
{
psCommand->psDstSync = (PVRSRV_SYNC_OBJECT*)(((IMG_UINTPTR_T)psQueue->pvLinQueueKM)
+ (psCommand->ui32DstSyncCount * sizeof(PVRSRV_SYNC_OBJECT))
+ (psCommand->ui32SrcSyncCount * sizeof(PVRSRV_SYNC_OBJECT)));
-
+
UPDATE_QUEUE_WOFF(psQueue, psCommand->uCmdSize);
return PVRSRV_OK;
DEVICE_COMMAND_DATA *psDeviceCommandData;
IMG_UINT32 ui32CCBOffset;
-
+
psWalkerObj = psCommand->psDstSync;
psEndObj = psWalkerObj + psCommand->ui32DstSyncCount;
while (psWalkerObj < psEndObj)
ui32WriteOpsComplete = psSyncData->ui32WriteOpsComplete;
ui32ReadOpsComplete = psSyncData->ui32ReadOps2Complete;
-
+
if ((ui32WriteOpsComplete != psWalkerObj->ui32WriteOpsPending)
|| (ui32ReadOpsComplete != psWalkerObj->ui32ReadOps2Pending))
{
psWalkerObj++;
}
-
+
psWalkerObj = psCommand->psSrcSync;
psEndObj = psWalkerObj + psCommand->ui32SrcSyncCount;
while (psWalkerObj < psEndObj)
ui32ReadOpsComplete = psSyncData->ui32ReadOps2Complete;
ui32WriteOpsComplete = psSyncData->ui32WriteOpsComplete;
-
+
if ((ui32WriteOpsComplete != psWalkerObj->ui32WriteOpsPending)
|| (ui32ReadOpsComplete != psWalkerObj->ui32ReadOps2Pending))
{
psWalkerObj++;
}
-
+
if (psCommand->ui32DevIndex >= SYS_DEVICE_COUNT)
{
PVR_DPF((PVR_DBG_ERROR,
return PVRSRV_ERROR_INVALID_PARAMS;
}
-
+
psDeviceCommandData = psSysData->apsDeviceCommandData[psCommand->ui32DevIndex];
ui32CCBOffset = psDeviceCommandData[psCommand->CommandType].ui32CCBOffset;
psCmdCompleteData = psDeviceCommandData[psCommand->CommandType].apsCmdCompleteData[ui32CCBOffset];
if (psCmdCompleteData->bInUse)
{
-
+
return PVRSRV_ERROR_FAILED_DEPENDENCIES;
}
-
+
psCmdCompleteData->bInUse = IMG_TRUE;
-
+
psCmdCompleteData->ui32DstSyncCount = psCommand->ui32DstSyncCount;
for (i=0; i<psCommand->ui32DstSyncCount; i++)
{
psCmdCompleteData->pfnCommandComplete = psCommand->pfnCommandComplete;
psCmdCompleteData->hCallbackData = psCommand->hCallbackData;
-
+
psCmdCompleteData->ui32SrcSyncCount = psCommand->ui32SrcSyncCount;
for (i=0; i<psCommand->ui32SrcSyncCount; i++)
{
ui32CCBOffset));
}
-
+
(IMG_UINT32)psCommand->uDataSize,
psCommand->pvData) == IMG_FALSE)
{
-
+
psCmdCompleteData->bInUse = IMG_FALSE;
eError = PVRSRV_ERROR_CMD_NOT_PROCESSED;
}
-
-
+
+
psDeviceCommandData[psCommand->CommandType].ui32CCBOffset = (ui32CCBOffset + 1) % DC_NUM_COMMANDS_PER_TYPE;
return eError;
PVRSRV_COMMAND *psCommand;
SysAcquireData(&psSysData);
-
+
while (OSLockResource(&psSysData->sQProcessResource, ISR_ID) != PVRSRV_OK)
{
OSWaitus(1);
};
-
+
psQueue = psSysData->psQueueList;
if(!psQueue)
if (PVRSRVProcessCommand(psSysData, psCommand, bFlush) == PVRSRV_OK)
{
-
+
UPDATE_QUEUE_ROFF(psQueue, psCommand->uCmdSize)
continue;
}
PVRSRVSetDCState(DC_STATE_NO_FLUSH_COMMANDS);
}
-
+
List_PVRSRV_DEVICE_NODE_ForEach(psSysData->psDeviceNodeList,
&PVRSRVProcessQueues_ForEachCb);
SysAcquireData(&psSysData);
-
+
psCmdCompleteData->bInUse = IMG_FALSE;
-
+
PVRSRVScheduleDeviceCallbacks();
if(bScheduleMISR)
}
}
-#endif
+#endif
IMG_EXPORT
PVR_TTRACE(PVRSRV_TRACE_GROUP_QUEUE, PVRSRV_TRACE_CLASS_CMD_COMP_START,
QUEUE_TOKEN_COMMAND_COMPLETE);
-
+
for (i=0; i<psCmdCompleteData->ui32DstSyncCount; i++)
{
psCmdCompleteData->psDstSync[i].psKernelSyncInfoKM->psSyncData->ui32WriteOpsComplete++;
- PVRSRVKernelSyncInfoDecRef(psCmdCompleteData->psDstSync[i].psKernelSyncInfoKM, IMG_NULL);
- if (psCmdCompleteData->psDstSync[i].psKernelSyncInfoKM->ui32RefCount == 0)
- {
- PVRSRVFreeSyncInfoKM(psCmdCompleteData->psDstSync[i].psKernelSyncInfoKM);
- }
-
PVR_TTRACE_SYNC_OBJECT(PVRSRV_TRACE_GROUP_QUEUE, QUEUE_TOKEN_UPDATE_DST,
psCmdCompleteData->psDstSync[i].psKernelSyncInfoKM,
PVRSRV_SYNCOP_COMPLETE);
psCmdCompleteData->psDstSync[i].ui32WriteOpsPending));
}
-
+
for (i=0; i<psCmdCompleteData->ui32SrcSyncCount; i++)
{
psCmdCompleteData->psSrcSync[i].psKernelSyncInfoKM->psSyncData->ui32ReadOps2Complete++;
- PVRSRVKernelSyncInfoDecRef(psCmdCompleteData->psSrcSync[i].psKernelSyncInfoKM, IMG_NULL);
- if (psCmdCompleteData->psSrcSync[i].psKernelSyncInfoKM->ui32RefCount == 0)
- {
- PVRSRVFreeSyncInfoKM(psCmdCompleteData->psSrcSync[i].psKernelSyncInfoKM);
- }
-
PVR_TTRACE_SYNC_OBJECT(PVRSRV_TRACE_GROUP_QUEUE, QUEUE_TOKEN_UPDATE_SRC,
psCmdCompleteData->psSrcSync[i].psKernelSyncInfoKM,
PVRSRV_SYNCOP_COMPLETE);
psCmdCompleteData->pfnCommandComplete(psCmdCompleteData->hCallbackData);
}
-
+
psCmdCompleteData->bInUse = IMG_FALSE;
-
+
PVRSRVScheduleDeviceCallbacks();
if(bScheduleMISR)
DEVICE_COMMAND_DATA *psDeviceCommandData;
COMMAND_COMPLETE_DATA *psCmdCompleteData;
-
+
if(ui32DevIndex >= SYS_DEVICE_COUNT)
{
PVR_DPF((PVR_DBG_ERROR,
return PVRSRV_ERROR_INVALID_PARAMS;
}
-
+
SysAcquireData(&psSysData);
-
+
ui32AllocSize = ui32CmdCount * sizeof(*psDeviceCommandData);
eError = OSAllocMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
ui32AllocSize,
psDeviceCommandData[ui32CmdTypeCounter].ui32MaxSrcSyncCount = ui32MaxSyncsPerCmd[ui32CmdTypeCounter][1];
for (ui32CmdCounter = 0; ui32CmdCounter < DC_NUM_COMMANDS_PER_TYPE; ui32CmdCounter++)
{
+
-
- ui32AllocSize = sizeof(COMMAND_COMPLETE_DATA)
+ ui32AllocSize = sizeof(COMMAND_COMPLETE_DATA)
+ ((ui32MaxSyncsPerCmd[ui32CmdTypeCounter][0]
+ ui32MaxSyncsPerCmd[ui32CmdTypeCounter][1])
- * sizeof(PVRSRV_SYNC_OBJECT));
+ * sizeof(PVRSRV_SYNC_OBJECT));
eError = OSAllocMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
ui32AllocSize,
PVR_DPF((PVR_DBG_ERROR,"PVRSRVRegisterCmdProcListKM: Failed to alloc cmd %d", ui32CmdTypeCounter));
goto ErrorExit;
}
-
+
psDeviceCommandData[ui32CmdTypeCounter].apsCmdCompleteData[ui32CmdCounter] = psCmdCompleteData;
-
-
+
+
OSMemSet(psCmdCompleteData, 0x00, ui32AllocSize);
-
+
psCmdCompleteData->psDstSync = (PVRSRV_SYNC_OBJECT*)
(((IMG_UINTPTR_T)psCmdCompleteData)
+ sizeof(COMMAND_COMPLETE_DATA));
ErrorExit:
-
+
if (PVRSRVRemoveCmdProcListKM(ui32DevIndex, ui32CmdCount) != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR,
"PVRSRVRegisterCmdProcListKM: Failed to clean up after error, device 0x%x",
ui32DevIndex));
}
-
+
return eError;
}
COMMAND_COMPLETE_DATA *psCmdCompleteData;
IMG_SIZE_T ui32AllocSize;
-
+
if(ui32DevIndex >= SYS_DEVICE_COUNT)
{
PVR_DPF((PVR_DBG_ERROR,
return PVRSRV_ERROR_INVALID_PARAMS;
}
-
+
SysAcquireData(&psSysData);
psDeviceCommandData = psSysData->apsDeviceCommandData[ui32DevIndex];
for (ui32CmdCounter = 0; ui32CmdCounter < DC_NUM_COMMANDS_PER_TYPE; ui32CmdCounter++)
{
psCmdCompleteData = psDeviceCommandData[ui32CmdTypeCounter].apsCmdCompleteData[ui32CmdCounter];
-
-
+
+
if (psCmdCompleteData != IMG_NULL)
{
- PVR_ASSERT(psCmdCompleteData->bInUse == IMG_FALSE);
OSFreeMem(PVRSRV_OS_NON_PAGEABLE_HEAP, psCmdCompleteData->ui32AllocSize,
psCmdCompleteData, IMG_NULL);
psDeviceCommandData[ui32CmdTypeCounter].apsCmdCompleteData[ui32CmdCounter] = IMG_NULL;
}
}
-
+
ui32AllocSize = ui32CmdCount * sizeof(*psDeviceCommandData);
OSFreeMem(PVRSRV_OS_NON_PAGEABLE_HEAP, ui32AllocSize, psDeviceCommandData, IMG_NULL);
psSysData->apsDeviceCommandData[ui32DevIndex] = IMG_NULL;
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
{
enum bt_type
{
- btt_span,
- btt_free,
- btt_live
+ btt_span,
+ btt_free,
+ btt_live
} type;
-
+
IMG_UINTPTR_T base;
IMG_SIZE_T uSize;
-
+
struct _BT_ *pNextSegment;
struct _BT_ *pPrevSegment;
-
+
struct _BT_ *pNextFree;
struct _BT_ *pPrevFree;
-
+
BM_MAPPING *psMapping;
#if defined(VALIDATE_ARENA_TEST)
RESOURCE_DESCRIPTOR eResourceSpan;
RESOURCE_TYPE eResourceType;
-
+
IMG_UINT32 ui32BoundaryTagID;
#endif
struct _RA_ARENA_
{
-
+
IMG_CHAR *name;
-
+
IMG_SIZE_T uQuantum;
-
+
IMG_BOOL (*pImportAlloc)(IMG_VOID *,
IMG_SIZE_T uSize,
IMG_SIZE_T *pActualSize,
BM_MAPPING *psMapping);
IMG_VOID (*pBackingStoreFree) (IMG_VOID *, IMG_SIZE_T, IMG_SIZE_T, IMG_HANDLE);
-
+
IMG_VOID *pImportHandle;
-
+
#define FREE_TABLE_LIMIT 32
-
+
BT *aHeadFree [FREE_TABLE_LIMIT];
-
+
BT *pHeadSegment;
BT *pTailSegment;
-
+
HASH_TABLE *pSegmentHash;
#ifdef RA_STATS
static void RA_ProcSeqShowRegs(struct seq_file *sfile, void* el);
static void* RA_ProcSeqOff2ElementRegs(struct seq_file * sfile, loff_t off);
-#endif
+#endif
#ifdef USE_BM_FREESPACE_CHECK
IMG_VOID CheckBMFreespace(IMG_VOID);
{
PVRSRV_ERROR eError = PVRSRV_OK;
-
+
if (pArena->pHeadSegment == IMG_NULL)
{
pArena->pHeadSegment = pArena->pTailSegment = pBT;
if (pBT->base < pArena->pHeadSegment->base)
{
-
+
pBT->pNextSegment = pArena->pHeadSegment;
pArena->pHeadSegment->pPrevSegment = pBT;
pArena->pHeadSegment = pBT;
else
{
-
+
pBTScan = pArena->pHeadSegment;
fail_SegListInsert:
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BT), pBT, IMG_NULL);
-
+
fail_bt:
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BT), pSpanEnd, IMG_NULL);
-
+
fail_end:
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BT), pSpanStart, IMG_NULL);
-
+
fail_start:
return IMG_NULL;
}
uOrigBase = pBT->base;
uOrigSize = pBT->uSize;
-
+
pNeighbour = pBT->pPrevSegment;
if (pNeighbour!=IMG_NULL
&& pNeighbour->type == btt_free
pBT->base = pNeighbour->base;
pBT->uSize += pNeighbour->uSize;
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BT), pNeighbour, IMG_NULL);
-
+
#ifdef RA_STATS
pArena->sStatistics.uFreeSegmentCount--;
#endif
}
-
+
pNeighbour = pBT->pNextSegment;
if (pNeighbour!=IMG_NULL
&& pNeighbour->type == btt_free
_SegmentListRemove (pArena, pNeighbour);
pBT->uSize += pNeighbour->uSize;
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BT), pNeighbour, IMG_NULL);
-
+
#ifdef RA_STATS
pArena->sStatistics.uFreeSegmentCount--;
#endif
}
-
+
if (pArena->pBackingStoreFree != IMG_NULL && bFreeBackingStore)
{
IMG_UINTPTR_T uRoundedStart, uRoundedEnd;
-
+
uRoundedStart = (uOrigBase / pArena->uQuantum) * pArena->uQuantum;
-
+
if (uRoundedStart < pBT->base)
{
uRoundedStart += pArena->uQuantum;
}
-
+
uRoundedEnd = ((uOrigBase + uOrigSize + pArena->uQuantum - 1) / pArena->uQuantum) * pArena->uQuantum;
-
+
if (uRoundedEnd > (pBT->base + pBT->uSize))
{
uRoundedEnd -= pArena->uQuantum;
pArena->sStatistics.uTotalResourceCount-=pBT->uSize;
#endif
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BT), next, IMG_NULL);
-
+
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BT), prev, IMG_NULL);
-
+
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BT), pBT, IMG_NULL);
-
+
}
else
_FreeListInsert (pArena, pBT);
if (uAlignment>1)
uAlignmentOffset %= uAlignment;
-
+
uIndex = pvr_log2 (uSize);
#if 0
-
+
if (1u<<uIndex < uSize)
uIndex++;
#endif
{
if (pArena->aHeadFree[uIndex]!=IMG_NULL)
{
-
+
BT *pBT;
pBT = pArena->aHeadFree [uIndex];
pArena->sStatistics.uFreeResourceCount-=pBT->uSize;
#endif
-
+
if (aligned_base > pBT->base)
{
BT *pNeighbour;
pNeighbour = _SegmentSplit (pArena, pBT, (IMG_SIZE_T)(aligned_base - pBT->base));
-
+
if (pNeighbour==IMG_NULL)
{
PVR_DPF ((PVR_DBG_ERROR,"_AttemptAllocAligned: Front split failed"));
-
+
_FreeListInsert (pArena, pBT);
return IMG_FALSE;
}
pBT = pNeighbour;
}
-
+
if (pBT->uSize > uSize)
{
BT *pNeighbour;
pNeighbour = _SegmentSplit (pArena, pBT, uSize);
-
+
if (pNeighbour==IMG_NULL)
{
PVR_DPF ((PVR_DBG_ERROR,"_AttemptAllocAligned: Back split failed"));
-
+
_FreeListInsert (pArena, pBT);
return IMG_FALSE;
}
pArena->bInitProcEntry = !PVRSRVGetInitServerState(PVRSRV_INIT_SERVER_SUCCESSFUL);
-
+
pfnCreateProcEntrySeq = pArena->bInitProcEntry ? CreateProcEntrySeq : CreatePerProcessProcEntrySeq;
ret = snprintf(szProcInfoName, sizeof(szProcInfoName), "ra_info_%s", pArena->name);
PVR_DPF((PVR_DBG_ERROR, "RA_Create: couldn't create ra_segs proc entry for arena %s", pArena->name));
}
}
-#endif
+#endif
pArena->pSegmentHash = HASH_Create (MINIMUM_HASH_SIZE);
if (pArena->pSegmentHash==IMG_NULL)
HASH_Delete (pArena->pSegmentHash);
hash_fail:
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(RA_ARENA), pArena, IMG_NULL);
-
+
arena_fail:
return IMG_NULL;
}
_SegmentListRemove (pArena, pBT);
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BT), pBT, IMG_NULL);
-
+
#ifdef RA_STATS
pArena->sStatistics.uSpanCount--;
#endif
#endif
HASH_Delete (pArena->pSegmentHash);
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(RA_ARENA), pArena, IMG_NULL);
-
+
}
IMG_BOOL
"RA_Alloc: arena='%s', size=0x%x(0x%x), alignment=0x%x, offset=0x%x",
pArena->name, uSize, uRequestSize, uAlignment, uAlignmentOffset));
-
+
bResult = _AttemptAllocAligned (pArena, uSize, ppsMapping, uFlags,
uAlignment, uAlignmentOffset, base);
IMG_UINTPTR_T import_base;
IMG_SIZE_T uImportSize = uSize;
-
+
if (uAlignment > pArena->uQuantum)
uImportSize += (uAlignment - 1);
}
-
+
uImportSize = ((uImportSize + pArena->uQuantum - 1)/pArena->uQuantum)*pArena->uQuantum;
bResult =
{
BT *pBT;
pBT = _InsertResourceSpan (pArena, import_base, uImportSize);
-
+
if (pBT == IMG_NULL)
{
-
+
pArena->pImportFree(pArena->pImportHandle, import_base,
psImportMapping);
PVR_DPF ((PVR_DBG_MESSAGE,
"RA_Alloc: name='%s', size=0x%x failed!",
pArena->name, uSize));
-
+
return IMG_FALSE;
}
pBT->psMapping = psImportMapping;
"RA_Alloc: name='%s', size=0x%x, *base=0x%x = %d",
pArena->name, uSize, *base, bResult));
-
+
#if defined(VALIDATE_ARENA_TEST)
ValidateArena(pArena);
(eNextSpan == IMPORTED_RESOURCE_SPAN_FREE) ||
(eNextSpan == IMPORTED_RESOURCE_SPAN_END)))
{
-
+
PVR_DPF((PVR_DBG_ERROR, "ValidateArena ERROR: adjacent boundary tags %d (base=0x%x) and %d (base=0x%x) are incompatible (arena: %s)",
pSegment->ui32BoundaryTagID, pSegment->base, pSegment->pNextSegment->ui32BoundaryTagID, pSegment->pNextSegment->base, pArena->name));
if (!((eNextSpan == IMPORTED_RESOURCE_SPAN_LIVE) ||
(eNextSpan == IMPORTED_RESOURCE_SPAN_END)))
{
-
+
PVR_DPF((PVR_DBG_ERROR, "ValidateArena ERROR: adjacent boundary tags %d (base=0x%x) and %d (base=0x%x) are incompatible (arena: %s)",
pSegment->ui32BoundaryTagID, pSegment->base, pSegment->pNextSegment->ui32BoundaryTagID, pSegment->pNextSegment->base, pArena->name));
(eNextSpan == IMPORTED_RESOURCE_SPAN_FREE) ||
(eNextSpan == IMPORTED_RESOURCE_SPAN_END))
{
-
+
PVR_DPF((PVR_DBG_ERROR, "ValidateArena ERROR: adjacent boundary tags %d (base=0x%x) and %d (base=0x%x) are incompatible (arena: %s)",
pSegment->ui32BoundaryTagID, pSegment->base, pSegment->pNextSegment->ui32BoundaryTagID, pSegment->pNextSegment->base, pArena->name));
if (!((eNextSpan == IMPORTED_RESOURCE_SPAN_LIVE) ||
(eNextSpan == IMPORTED_RESOURCE_SPAN_FREE)))
{
-
+
PVR_DPF((PVR_DBG_ERROR, "ValidateArena ERROR: adjacent boundary tags %d (base=0x%x) and %d (base=0x%x) are incompatible (arena: %s)",
pSegment->ui32BoundaryTagID, pSegment->base, pSegment->pNextSegment->ui32BoundaryTagID, pSegment->pNextSegment->base, pArena->name));
if (!((eNextSpan == RESOURCE_SPAN_FREE) ||
(eNextSpan == RESOURCE_SPAN_LIVE)))
{
-
+
PVR_DPF((PVR_DBG_ERROR, "ValidateArena ERROR: adjacent boundary tags %d (base=0x%x) and %d (base=0x%x) are incompatible (arena: %s)",
pSegment->ui32BoundaryTagID, pSegment->base, pSegment->pNextSegment->ui32BoundaryTagID, pSegment->pNextSegment->base, pArena->name));
if (!((eNextSpan == RESOURCE_SPAN_FREE) ||
(eNextSpan == RESOURCE_SPAN_LIVE)))
{
-
+
PVR_DPF((PVR_DBG_ERROR, "ValidateArena ERROR: adjacent boundary tags %d (base=0x%x) and %d (base=0x%x) are incompatible (arena: %s)",
pSegment->ui32BoundaryTagID, pSegment->base, pSegment->pNextSegment->ui32BoundaryTagID, pSegment->pNextSegment->base, pArena->name));
pBT = pArena->pHeadSegment;
}
-
+
while (pBT != IMG_NULL)
{
if (pBT->type == btt_live)
}
return "junk";
}
-#endif
+#endif
#if defined(ENABLE_RA_DUMP)
IMG_VOID
HASH_Dump (pArena->pSegmentHash);
#endif
}
-#endif
+#endif
#if defined(CONFIG_PROC_FS) && defined(DEBUG)
return (void*)pBT;
}
-#endif
+#endif
#ifdef RA_STATS
}
PVRSRV_ERROR RA_GetStatsFreeMem(RA_ARENA *pArena,
- IMG_CHAR **ppszStr,
+ IMG_CHAR **ppszStr,
IMG_UINT32 *pui32StrLen)
{
IMG_CHAR *pszStr = *ppszStr;
UPDATE_SPACE(pszStr, i32Count, ui32StrLen);
*ppszStr = pszStr;
*pui32StrLen = ui32StrLen;
-
+
return PVRSRV_OK;
}
#endif
-/**********************************************************************
- *
- * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * The full GNU General Public License is included in this distribution in
- * the file called "COPYING".
- *
- * Contact Information:
- * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
- *
+/*************************************************************************/ /*!
+@Title Services reference count debugging
+@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
+@License Strictly Confidential.
*/ /**************************************************************************/
#if defined(PVRSRV_REFCOUNT_DEBUG)
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#ifdef DEBUG
IMG_UINT32 ui32Signature;
#endif
- struct _RESMAN_ITEM_ **ppsThis;
- struct _RESMAN_ITEM_ *psNext;
+ struct _RESMAN_ITEM_ **ppsThis;
+ struct _RESMAN_ITEM_ *psNext;
- IMG_UINT32 ui32Flags;
+ IMG_UINT32 ui32Flags;
IMG_UINT32 ui32ResType;
- IMG_PVOID pvParam;
- IMG_UINT32 ui32Param;
+ IMG_PVOID pvParam;
+ IMG_UINT32 ui32Param;
RESMAN_FREE_FN pfnFreeResource;
} RESMAN_ITEM;
struct _RESMAN_CONTEXT_ **ppsThis;
struct _RESMAN_CONTEXT_ *psNext;
- PVRSRV_PER_PROCESS_DATA *psPerProc;
+ PVRSRV_PER_PROCESS_DATA *psPerProc;
RESMAN_ITEM *psResItemList;
typedef struct
{
- RESMAN_CONTEXT *psContextList;
+ RESMAN_CONTEXT *psContextList;
-} RESMAN_LIST, *PRESMAN_LIST;
+} RESMAN_LIST, *PRESMAN_LIST;
PRESMAN_LIST gpsResList = IMG_NULL;
-#include "lists.h"
+#include "lists.h"
static IMPLEMENT_LIST_ANY_VA(RESMAN_ITEM)
static IMPLEMENT_LIST_ANY_VA_2(RESMAN_ITEM, IMG_BOOL, IMG_FALSE)
{
if (gpsResList == IMG_NULL)
{
-
+
if (OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
sizeof(*gpsResList),
(IMG_VOID **)&gpsResList, IMG_NULL,
return PVRSRV_ERROR_OUT_OF_MEMORY;
}
-
+
gpsResList->psContextList = IMG_NULL;
-
+
VALIDATERESLIST();
}
{
if (gpsResList != IMG_NULL)
{
-
+
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(*gpsResList), gpsResList, IMG_NULL);
gpsResList = IMG_NULL;
}
PVRSRV_ERROR eError;
PRESMAN_CONTEXT psResManContext;
-
+
ACQUIRE_SYNC_OBJ;
-
+
VALIDATERESLIST();
-
+
eError = OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(*psResManContext),
(IMG_VOID **)&psResManContext, IMG_NULL,
"Resource Manager Context");
{
PVR_DPF((PVR_DBG_ERROR, "PVRSRVResManConnect: ERROR allocating new RESMAN context struct"));
-
+
VALIDATERESLIST();
-
+
RELEASE_SYNC_OBJ;
return eError;
#ifdef DEBUG
psResManContext->ui32Signature = RESMAN_SIGNATURE;
-#endif
+#endif
psResManContext->psResItemList = IMG_NULL;
psResManContext->psPerProc = hPerProc;
-
+
List_RESMAN_CONTEXT_Insert(&gpsResList->psContextList, psResManContext);
-
+
VALIDATERESLIST();
-
+
RELEASE_SYNC_OBJ;
*phResManContext = psResManContext;
IMG_VOID PVRSRVResManDisconnect(PRESMAN_CONTEXT psResManContext,
IMG_BOOL bKernelContext)
{
-
+
ACQUIRE_SYNC_OBJ;
-
+
VALIDATERESLIST();
-
+
PRINT_RESLIST(gpsResList, psResManContext, IMG_TRUE);
-
+
if (!bKernelContext)
{
-
+
FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_OS_USERMODE_MAPPING, 0, 0, IMG_TRUE);
-
+
FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_DMA_CLIENT_FIFO_DATA, 0, 0, IMG_TRUE);
-
+
FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_EVENT_OBJECT, 0, 0, IMG_TRUE);
-
-
+
+
List_RESMAN_ITEM_Reverse(&psResManContext->psResItemList);
FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_MODIFY_SYNC_OPS, 0, 0, IMG_TRUE);
- List_RESMAN_ITEM_Reverse(&psResManContext->psResItemList);
-
+ List_RESMAN_ITEM_Reverse(&psResManContext->psResItemList);
+
FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_HW_RENDER_CONTEXT, 0, 0, IMG_TRUE);
FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_HW_TRANSFER_CONTEXT, 0, 0, IMG_TRUE);
FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_HW_2D_CONTEXT, 0, 0, IMG_TRUE);
FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_TRANSFER_CONTEXT, 0, 0, IMG_TRUE);
FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_SHARED_PB_DESC_CREATE_LOCK, 0, 0, IMG_TRUE);
FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_SHARED_PB_DESC, 0, 0, IMG_TRUE);
+
+
-
-
-
+
FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_SYNC_INFO, 0, 0, IMG_TRUE);
FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_DEVICECLASSMEM_MAPPING, 0, 0, IMG_TRUE);
FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_DEVICEMEM_WRAP, 0, 0, IMG_TRUE);
FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_DEVICEMEM_CONTEXT, 0, 0, IMG_TRUE);
FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_SHARED_MEM_INFO, 0, 0, IMG_TRUE);
-
+
FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_DISPLAYCLASS_SWAPCHAIN_REF, 0, 0, IMG_TRUE);
FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_DISPLAYCLASS_DEVICE, 0, 0, IMG_TRUE);
-
+
FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_BUFFERCLASS_DEVICE, 0, 0, IMG_TRUE);
}
-
+
PVR_ASSERT(psResManContext->psResItemList == IMG_NULL);
-
+
List_RESMAN_CONTEXT_Remove(psResManContext);
-
+
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(RESMAN_CONTEXT), psResManContext, IMG_NULL);
+
-
-
+
VALIDATERESLIST();
-
+
PRINT_RESLIST(gpsResList, psResManContext, IMG_FALSE);
-
+
RELEASE_SYNC_OBJ;
}
return (PRESMAN_ITEM) IMG_NULL;
}
-
+
ACQUIRE_SYNC_OBJ;
-
+
VALIDATERESLIST();
PVR_DPF((PVR_DBG_MESSAGE, "ResManRegisterRes: register resource "
ui32Param,
(IMG_UINTPTR_T)pfnFreeResource));
-
+
if (OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
sizeof(RESMAN_ITEM), (IMG_VOID **)&psNewResItem,
IMG_NULL,
PVR_DPF((PVR_DBG_ERROR, "ResManRegisterRes: "
"ERROR allocating new resource item"));
-
+
RELEASE_SYNC_OBJ;
return((PRESMAN_ITEM)IMG_NULL);
}
-
+
#ifdef DEBUG
psNewResItem->ui32Signature = RESMAN_SIGNATURE;
-#endif
+#endif
psNewResItem->ui32ResType = ui32ResType;
psNewResItem->pvParam = pvParam;
psNewResItem->ui32Param = ui32Param;
psNewResItem->pfnFreeResource = pfnFreeResource;
psNewResItem->ui32Flags = 0;
-
+
List_RESMAN_ITEM_Insert(&psResManContext->psResItemList, psNewResItem);
-
+
VALIDATERESLIST();
-
+
RELEASE_SYNC_OBJ;
return(psNewResItem);
PVR_DPF((PVR_DBG_MESSAGE, "ResManFreeResByPtr: freeing resource at %08X",
(IMG_UINTPTR_T)psResItem));
-
+
ACQUIRE_SYNC_OBJ;
-
+
VALIDATERESLIST();
-
+
eError = FreeResourceByPtr(psResItem, IMG_TRUE, bForceCleanup);
-
+
VALIDATERESLIST();
-
+
RELEASE_SYNC_OBJ;
return(eError);
PVR_ASSERT(psResManContext != IMG_NULL);
-
+
ACQUIRE_SYNC_OBJ;
-
+
VALIDATERESLIST();
PVR_DPF((PVR_DBG_MESSAGE, "ResManFreeResByCriteria: "
(IMG_UINTPTR_T)psResManContext, ui32SearchCriteria, ui32ResType,
(IMG_UINTPTR_T)pvParam, ui32Param));
-
+
eError = FreeResourceByCriteria(psResManContext, ui32SearchCriteria,
ui32ResType, pvParam, ui32Param,
IMG_TRUE);
-
+
VALIDATERESLIST();
-
+
RELEASE_SYNC_OBJ;
return eError;
return PVRSRV_ERROR_INVALID_PARAMS;
}
-#ifdef DEBUG
+#ifdef DEBUG
PVR_ASSERT(psResItem->ui32Signature == RESMAN_SIGNATURE);
#endif
if (psNewResManContext != IMG_NULL)
{
-
+
List_RESMAN_ITEM_Remove(psResItem);
-
+
List_RESMAN_ITEM_Insert(&psNewResManContext->psResItemList, psResItem);
}
return PVRSRV_ERROR_INVALID_PARAMS;
}
-#ifdef DEBUG
+#ifdef DEBUG
PVR_ASSERT(psItem->ui32Signature == RESMAN_SIGNATURE);
#endif
-
+
ACQUIRE_SYNC_OBJ;
PVR_DPF((PVR_DBG_MESSAGE,
(IMG_UINTPTR_T)psItem->pfnFreeResource,
psItem->ui32Flags));
-
+
if(List_RESMAN_ITEM_IMG_BOOL_Any_va(psResManContext->psResItemList,
&ResManFindResourceByPtr_AnyVaCb,
psItem))
eResult = PVRSRV_ERROR_NOT_OWNER;
}
-
+
RELEASE_SYNC_OBJ;
return eResult;
return PVRSRV_ERROR_INVALID_PARAMS;
}
-#ifdef DEBUG
+#ifdef DEBUG
PVR_ASSERT(psItem->ui32Signature == RESMAN_SIGNATURE);
#endif
(IMG_UINTPTR_T)psItem->pvParam, psItem->ui32Param,
(IMG_UINTPTR_T)psItem->pfnFreeResource, psItem->ui32Flags));
-
+
List_RESMAN_ITEM_Remove(psItem);
-
+
RELEASE_SYNC_OBJ;
-
+
if (bExecuteCallback)
{
eError = psItem->pfnFreeResource(psItem->pvParam, psItem->ui32Param, bForceCleanup);
}
}
-
+
ACQUIRE_SYNC_OBJ;
-
+
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(RESMAN_ITEM), psItem, IMG_NULL);
return(eError);
pvParam = va_arg(va, IMG_PVOID);
ui32Param = va_arg(va, IMG_UINT32);
-
+
if(
-
+
(((ui32SearchCriteria & RESMAN_CRITERIA_RESTYPE) == 0UL) ||
(psCurItem->ui32ResType == ui32ResType))
&&
-
+
(((ui32SearchCriteria & RESMAN_CRITERIA_PVOID_PARAM) == 0UL) ||
(psCurItem->pvParam == pvParam))
&&
-
+
(((ui32SearchCriteria & RESMAN_CRITERIA_UI32_PARAM) == 0UL) ||
(psCurItem->ui32Param == ui32Param))
)
PRESMAN_ITEM psCurItem;
PVRSRV_ERROR eError = PVRSRV_OK;
-
-
+
+
while((psCurItem = (PRESMAN_ITEM)
List_RESMAN_ITEM_Any_va(psResManContext->psResItemList,
&FreeResourceByCriteria_AnyVaCb,
PRESMAN_ITEM psCurItem, *ppsThisItem;
PRESMAN_CONTEXT psCurContext, *ppsThisContext;
-
+
if (psResList == IMG_NULL)
{
PVR_DPF((PVR_DBG_MESSAGE, "ValidateResList: resman not initialised yet"));
psCurContext = psResList->psContextList;
ppsThisContext = &psResList->psContextList;
-
+
while(psCurContext != IMG_NULL)
{
-
+
PVR_ASSERT(psCurContext->ui32Signature == RESMAN_SIGNATURE);
if (psCurContext->ppsThis != ppsThisContext)
{
PVR_ASSERT(psCurContext->ppsThis == ppsThisContext);
}
-
+
psCurItem = psCurContext->psResItemList;
ppsThisItem = &psCurContext->psResItemList;
while(psCurItem != IMG_NULL)
{
-
+
PVR_ASSERT(psCurItem->ui32Signature == RESMAN_SIGNATURE);
if (psCurItem->ppsThis != ppsThisItem)
{
PVR_ASSERT(psCurItem->ppsThis == ppsThisItem);
}
-
+
ppsThisItem = &psCurItem->psNext;
psCurItem = psCurItem->psNext;
}
-
+
ppsThisContext = &psCurContext->psNext;
psCurContext = psCurContext->psNext;
}
}
-#endif
+#endif
+++ /dev/null
-/**********************************************************************
- *
- * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * The full GNU General Public License is included in this distribution in
- * the file called "COPYING".
- *
- * Contact Information:
- * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
- *
-*****************************************************************************/
-#if defined (TTRACE)
-
-#include "services_headers.h"
-#include "ttrace.h"
-
-#define CHECKSIZE(n,m) \
- if ((n & m) != n) \
- PVR_DPF((PVR_DBG_ERROR,"Size check failed for " #m)) \
-
-#define TIME_TRACE_HASH_TABLE_SIZE 32
-
-HASH_TABLE *g_psBufferTable;
-IMG_UINT32 g_ui32HostUID;
-IMG_HANDLE g_psTimer;
-
-/* Trace buffer struct */
-typedef struct
-{
- IMG_UINT32 ui32Woff; /* Offset to where next item will be written */
- IMG_UINT32 ui32Roff; /* Offset to where to start reading from */
- IMG_UINT32 ui32ByteCount; /* Number of bytes in buffer */
- IMG_UINT8 ui8Data[0];
-} sTimeTraceBuffer;
-
-/*!
-******************************************************************************
-
- @Function PVRSRVTimeTraceItemSize
-
- @Description
-
- Calculate the size of a trace item
-
- @Input psTraceItem : Trace item
-
- @Return size of trace item
-
-******************************************************************************/
-static IMG_UINT32
-PVRSRVTimeTraceItemSize(IMG_UINT32 *psTraceItem)
-{
- IMG_UINT32 ui32Size = PVRSRV_TRACE_ITEM_SIZE;
-
- ui32Size += READ_HEADER(SIZE, psTraceItem[PVRSRV_TRACE_DATA_HEADER]);
-
- return ui32Size;
-}
-
-/*!
-******************************************************************************
-
- @Function PVRSRVTimeTraceAllocItem
-
- @Description
-
- Allocate a trace item from the buffer of the current process
-
- @Output ppsTraceItem : Pointer to allocated trace item
-
- @Input ui32Size : Size of data packet to be allocated
-
- @Return none
-
-******************************************************************************/
-static IMG_VOID
-PVRSRVTimeTraceAllocItem(IMG_UINT32 **pui32Item, IMG_UINT32 ui32Size)
-{
- IMG_UINT32 ui32PID = OSGetCurrentProcessIDKM();
- IMG_UINT32 ui32AllocOffset;
- sTimeTraceBuffer *psBuffer = (sTimeTraceBuffer *) HASH_Retrieve(g_psBufferTable, (IMG_UINTPTR_T) ui32PID);
-
- /* The caller only asks for extra data space */
- ui32Size += PVRSRV_TRACE_ITEM_SIZE;
-
- /* Always round to 32-bit */
- ui32Size = ((ui32Size - 1) & (~0x3)) + 0x04;
-
- if (!psBuffer)
- {
- PVRSRV_ERROR eError;
-
- PVR_DPF((PVR_DBG_MESSAGE, "PVRSRVTimeTraceAllocItem: Creating buffer for PID %u", (IMG_UINT32) ui32PID));
- eError = PVRSRVTimeTraceBufferCreate(ui32PID);
- if (eError != PVRSRV_OK)
- {
- *pui32Item = IMG_NULL;
- PVR_DPF((PVR_DBG_ERROR, "PVRSRVTimeTraceAllocItem: Failed to create buffer"));
- return;
- }
-
- psBuffer = (sTimeTraceBuffer *) HASH_Retrieve(g_psBufferTable, (IMG_UINTPTR_T) ui32PID);
- if (psBuffer == IMG_NULL)
- {
- *pui32Item = NULL;
- PVR_DPF((PVR_DBG_ERROR, "PVRSRVTimeTraceAllocItem: Failed to retrieve buffer"));
- return;
- }
- }
-
- /* Can't allocate more then buffer size */
- if (ui32Size >= TIME_TRACE_BUFFER_SIZE)
- {
- *pui32Item = NULL;
- PVR_DPF((PVR_DBG_ERROR, "PVRSRVTimeTraceAllocItem: Error trace item too large (%d)", ui32Size));
- return;
- }
-
- /* FIXME: Enter critical section? */
-
- /* Always ensure we have enough space to write a padding message */
- if ((psBuffer->ui32Woff + ui32Size + PVRSRV_TRACE_ITEM_SIZE) > TIME_TRACE_BUFFER_SIZE)
- {
- IMG_UINT32 *ui32WriteEOB = (IMG_UINT32 *) &psBuffer->ui8Data[psBuffer->ui32Woff];
- IMG_UINT32 ui32Remain = TIME_TRACE_BUFFER_SIZE - psBuffer->ui32Woff;
-
- /* Not enough space at the end of the buffer, back to the start */
- *ui32WriteEOB++ = WRITE_HEADER(GROUP, PVRSRV_TRACE_GROUP_PADDING);
- *ui32WriteEOB++ = 0; /* Don't need timestamp */
- *ui32WriteEOB++ = 0; /* Don't need UID */
- *ui32WriteEOB = WRITE_HEADER(SIZE, (ui32Remain - PVRSRV_TRACE_ITEM_SIZE));
- psBuffer->ui32ByteCount += ui32Remain;
- psBuffer->ui32Woff = ui32AllocOffset = 0;
- }
- else
- ui32AllocOffset = psBuffer->ui32Woff;
-
- psBuffer->ui32Woff = psBuffer->ui32Woff + ui32Size;
- psBuffer->ui32ByteCount += ui32Size;
-
- /* This allocation will start overwritting past our read pointer, move the read pointer along */
- while (psBuffer->ui32ByteCount > TIME_TRACE_BUFFER_SIZE)
- {
- IMG_UINT32 *psReadItem = (IMG_UINT32 *) &psBuffer->ui8Data[psBuffer->ui32Roff];
- IMG_UINT32 ui32ReadSize;
-
- ui32ReadSize = PVRSRVTimeTraceItemSize(psReadItem);
- psBuffer->ui32Roff = (psBuffer->ui32Roff + ui32ReadSize) & (TIME_TRACE_BUFFER_SIZE - 1);
- psBuffer->ui32ByteCount -= ui32ReadSize;
- }
-
- *pui32Item = (IMG_UINT32 *) &psBuffer->ui8Data[ui32AllocOffset];
- /* FIXME: Exit critical section? */
-}
-
-/*!
-******************************************************************************
-
- @Function PVRSRVTimeTraceBufferCreate
-
- @Description
-
- Create a trace buffer.
-
- Note: We assume that this will only be called once per process.
-
- @Input ui32PID : PID of the process that is creating the buffer
-
- @Return none
-
-******************************************************************************/
-PVRSRV_ERROR PVRSRVTimeTraceBufferCreate(IMG_UINT32 ui32PID)
-{
- sTimeTraceBuffer *psBuffer;
- PVRSRV_ERROR eError = PVRSRV_OK;
-
- eError = OSAllocMem(PVRSRV_PAGEABLE_SELECT,
- sizeof(sTimeTraceBuffer) + TIME_TRACE_BUFFER_SIZE,
- (IMG_VOID **)&psBuffer, IMG_NULL,
- "Time Trace Buffer");
- if (eError != PVRSRV_OK)
- {
- PVR_DPF((PVR_DBG_ERROR, "PVRSRVTimeTraceBufferCreate: Error allocating trace buffer"));
- return eError;
- }
-
- OSMemSet(psBuffer, 0, TIME_TRACE_BUFFER_SIZE);
-
- if (!HASH_Insert(g_psBufferTable, (IMG_UINTPTR_T) ui32PID, (IMG_UINTPTR_T) psBuffer))
- {
- OSFreeMem(PVRSRV_PAGEABLE_SELECT, sizeof(sTimeTraceBuffer) + TIME_TRACE_BUFFER_SIZE,
- psBuffer, NULL);
- PVR_DPF((PVR_DBG_ERROR, "PVRSRVTimeTraceBufferCreate: Error adding trace buffer to hash table"));
- return PVRSRV_ERROR_OUT_OF_MEMORY;
- }
-
- return eError;
-}
-
-/*!
-******************************************************************************
-
- @Function PVRSRVTimeTraceBufferDestroy
-
- @Description
-
- Destroy a trace buffer.
-
- Note: We assume that this will only be called once per process.
-
- @Input ui32PID : PID of the process that is creating the buffer
-
- @Return none
-
-******************************************************************************/
-PVRSRV_ERROR PVRSRVTimeTraceBufferDestroy(IMG_UINT32 ui32PID)
-{
- sTimeTraceBuffer *psBuffer;
-
-#if defined(DUMP_TTRACE_BUFFERS_ON_EXIT)
- PVRSRVDumpTimeTraceBuffers();
-#endif
- psBuffer = (sTimeTraceBuffer *) HASH_Retrieve(g_psBufferTable, (IMG_UINTPTR_T) ui32PID);
- if (psBuffer)
- {
- OSFreeMem(PVRSRV_PAGEABLE_SELECT, sizeof(sTimeTraceBuffer) + TIME_TRACE_BUFFER_SIZE,
- psBuffer, NULL);
- HASH_Remove(g_psBufferTable, (IMG_UINTPTR_T) ui32PID);
- return PVRSRV_OK;
- }
-
- PVR_DPF((PVR_DBG_ERROR, "PVRSRVTimeTraceBufferDestroy: Can't find trace buffer in hash table"));
- return PVRSRV_ERROR_INVALID_PARAMS;
-}
-
-/*!
-******************************************************************************
-
- @Function PVRSRVTimeTraceInit
-
- @Description
-
- Initialise the timed trace subsystem.
-
- @Return Error
-
-******************************************************************************/
-PVRSRV_ERROR PVRSRVTimeTraceInit(IMG_VOID)
-{
- g_psBufferTable = HASH_Create(TIME_TRACE_HASH_TABLE_SIZE);
-
- /* Create hash table to store the per process buffers in */
- if (!g_psBufferTable)
- {
- PVR_DPF((PVR_DBG_ERROR, "PVRSRVTimeTraceInit: Error creating hash table"));
- return PVRSRV_ERROR_OUT_OF_MEMORY;
- }
-
- /* Create the kernel buffer */
- PVRSRVTimeTraceBufferCreate(KERNEL_ID);
-
- g_psTimer = OSFuncHighResTimerCreate();
-
- if (!g_psTimer)
- {
- PVR_DPF((PVR_DBG_ERROR, "PVRSRVTimeTraceInit: Error creating timer"));
- return PVRSRV_ERROR_INIT_FAILURE;
- }
- return PVRSRV_OK;
-}
-
-static PVRSRV_ERROR _PVRSRVTimeTraceBufferDestroy(IMG_UINTPTR_T hKey, IMG_UINTPTR_T hData)
-{
- PVR_UNREFERENCED_PARAMETER(hData);
- PVR_DPF((PVR_DBG_MESSAGE, "_PVRSRVTimeTraceBufferDestroy: Destroying buffer for PID %u", (IMG_UINT32) hKey));
-
- PVRSRVTimeTraceBufferDestroy(hKey);
- return PVRSRV_OK;
-}
-
-/*!
-******************************************************************************
-
- @Function PVRSRVTimeTraceDeinit
-
- @Description
-
- De-initialise the timed trace subsystem.
-
- @Return Error
-
-******************************************************************************/
-IMG_VOID PVRSRVTimeTraceDeinit(IMG_VOID)
-{
- PVRSRVTimeTraceBufferDestroy(KERNEL_ID);
- /* Free any buffers the where created at alloc item time */
- HASH_Iterate(g_psBufferTable, _PVRSRVTimeTraceBufferDestroy);
- HASH_Delete(g_psBufferTable);
- OSFuncHighResTimerDestroy(g_psTimer);
-}
-
-/*!
-******************************************************************************
-
- @Function PVRSRVTimeTraceWriteHeader
-
- @Description
-
- Write the header for a trace item.
-
- @Input pui32TraceItem : Pointer to trace item
-
- @Input ui32Group : Trace item's group ID
-
- @Input ui32Class : Trace item's class ID
-
- @Input ui32Token : Trace item's ui32Token ID
-
- @Input ui32Size : Trace item's data payload size
-
- @Input ui32Type : Trace item's data type
-
- @Input ui32Count : Trace item's data count
-
- @Return Pointer to data payload space, or NULL if no data payload
-
-******************************************************************************/
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(PVRSRVTimeTraceWriteHeader)
-#endif
-static INLINE IMG_VOID *PVRSRVTimeTraceWriteHeader(IMG_UINT32 *pui32TraceItem, IMG_UINT32 ui32Group,
- IMG_UINT32 ui32Class, IMG_UINT32 ui32Token,
- IMG_UINT32 ui32Size, IMG_UINT32 ui32Type,
- IMG_UINT32 ui32Count)
-{
- /* Sanity check arg's */
- CHECKSIZE(ui32Group, PVRSRV_TRACE_GROUP_MASK);
- CHECKSIZE(ui32Class, PVRSRV_TRACE_CLASS_MASK);
- CHECKSIZE(ui32Token, PVRSRV_TRACE_TOKEN_MASK);
-
- CHECKSIZE(ui32Size, PVRSRV_TRACE_SIZE_MASK);
- CHECKSIZE(ui32Type, PVRSRV_TRACE_TYPE_MASK);
- CHECKSIZE(ui32Count, PVRSRV_TRACE_COUNT_MASK);
-
- /* Trace header */
- pui32TraceItem[PVRSRV_TRACE_HEADER] = WRITE_HEADER(GROUP, ui32Group);
- pui32TraceItem[PVRSRV_TRACE_HEADER] |= WRITE_HEADER(CLASS, ui32Class);
- pui32TraceItem[PVRSRV_TRACE_HEADER] |= WRITE_HEADER(TOKEN, ui32Token);
-
- /* Data header */
- pui32TraceItem[PVRSRV_TRACE_DATA_HEADER] = WRITE_HEADER(SIZE, ui32Size);
- pui32TraceItem[PVRSRV_TRACE_DATA_HEADER] |= WRITE_HEADER(TYPE, ui32Type);
- pui32TraceItem[PVRSRV_TRACE_DATA_HEADER] |= WRITE_HEADER(COUNT, ui32Count);
-
- pui32TraceItem[PVRSRV_TRACE_TIMESTAMP] = OSFuncHighResTimerGetus(g_psTimer);
- pui32TraceItem[PVRSRV_TRACE_HOSTUID] = g_ui32HostUID++;
-
- return ui32Size?((IMG_VOID *) &pui32TraceItem[PVRSRV_TRACE_DATA_PAYLOAD]):NULL;
-}
-
-/*!
-******************************************************************************
-
- @Function PVRSRVTimeTraceArray
-
- @Description
-
- Write trace item with an array of data
-
- @Input ui32Group : Trace item's group ID
-
- @Input ui32Class : Trace item's class ID
-
- @Input ui32Token : Trace item's ui32Token ID
-
- @Input ui32Size : Trace item's data payload size
-
- @Input ui32Type : Trace item's data type
-
- @Input ui32Count : Trace item's data count
-
- @Input pui8Data : Pointer to data array
-
- @Return Pointer to data payload space, or NULL if no data payload
-
-******************************************************************************/
-IMG_VOID PVRSRVTimeTraceArray(IMG_UINT32 ui32Group, IMG_UINT32 ui32Class, IMG_UINT32 ui32Token,
- IMG_UINT32 ui32Type, IMG_UINT32 ui32Count, IMG_UINT8 *pui8Data)
-{
- IMG_UINT32 *pui32TraceItem;
- IMG_UINT32 ui32Size, ui32TypeSize;
- IMG_UINT8 *ui8Ptr;
-
- /* Only the 1st 4 sizes are for ui types, others are "special" */
- switch (ui32Type)
- {
- case PVRSRV_TRACE_TYPE_UI8: ui32TypeSize = 1;
- break;
- case PVRSRV_TRACE_TYPE_UI16: ui32TypeSize = 2;
- break;
- case PVRSRV_TRACE_TYPE_UI32: ui32TypeSize = 4;
- break;
- case PVRSRV_TRACE_TYPE_UI64: ui32TypeSize = 8;
- break;
- default:
- PVR_DPF((PVR_DBG_ERROR, "Unsupported size\n"));
- return;
- }
-
- ui32Size = ui32TypeSize * ui32Count;
-
- /* Allocate space from the buffer */
- PVRSRVTimeTraceAllocItem(&pui32TraceItem, ui32Size);
-
- if (!pui32TraceItem)
- {
- PVR_DPF((PVR_DBG_ERROR, "Can't find buffer\n"));
- return;
- }
-
- ui8Ptr = PVRSRVTimeTraceWriteHeader(pui32TraceItem, ui32Group, ui32Class, ui32Token,
- ui32Size, ui32Type, ui32Count);
-
- if (ui8Ptr)
- {
- OSMemCopy(ui8Ptr, pui8Data, ui32Size);
- }
-}
-
-/*!
-******************************************************************************
-
- @Function PVRSRVTimeTraceSyncObject
-
- @Description
-
- Write trace item with a sync object
-
- @Input ui32Group : Trace item's group ID
-
- @Input ui32Token : Trace item's ui32Token ID
-
- @Input psSync : Sync object
-
- @Input ui8SyncOpp : Sync object operation
-
- @Return None
-
-******************************************************************************/
-IMG_VOID PVRSRVTimeTraceSyncObject(IMG_UINT32 ui32Group, IMG_UINT32 ui32Token,
- PVRSRV_KERNEL_SYNC_INFO *psSync, IMG_UINT8 ui8SyncOp)
-{
- IMG_UINT32 *pui32TraceItem;
- IMG_UINT32 *ui32Ptr;
- IMG_UINT32 ui32Size = PVRSRV_TRACE_TYPE_SYNC_SIZE;
-
-
- PVRSRVTimeTraceAllocItem(&pui32TraceItem, ui32Size);
-
- if (!pui32TraceItem)
- {
- PVR_DPF((PVR_DBG_ERROR, "Can't find buffer\n"));
- return;
- }
-
- ui32Ptr = PVRSRVTimeTraceWriteHeader(pui32TraceItem, ui32Group, PVRSRV_TRACE_CLASS_SYNC,
- ui32Token, ui32Size, PVRSRV_TRACE_TYPE_SYNC, 1);
-
- ui32Ptr[PVRSRV_TRACE_SYNC_UID] = psSync->ui32UID;
- ui32Ptr[PVRSRV_TRACE_SYNC_WOP] = psSync->psSyncData->ui32WriteOpsPending;
- ui32Ptr[PVRSRV_TRACE_SYNC_WOC] = psSync->psSyncData->ui32WriteOpsComplete;
- ui32Ptr[PVRSRV_TRACE_SYNC_ROP] = psSync->psSyncData->ui32ReadOpsPending;
- ui32Ptr[PVRSRV_TRACE_SYNC_ROC] = psSync->psSyncData->ui32ReadOpsComplete;
- ui32Ptr[PVRSRV_TRACE_SYNC_RO2P] = psSync->psSyncData->ui32ReadOps2Pending;
- ui32Ptr[PVRSRV_TRACE_SYNC_RO2C] = psSync->psSyncData->ui32ReadOps2Complete;
- ui32Ptr[PVRSRV_TRACE_SYNC_WO_DEV_VADDR] = psSync->sWriteOpsCompleteDevVAddr.uiAddr;
- ui32Ptr[PVRSRV_TRACE_SYNC_RO_DEV_VADDR] = psSync->sReadOpsCompleteDevVAddr.uiAddr;
- ui32Ptr[PVRSRV_TRACE_SYNC_RO2_DEV_VADDR] = psSync->sReadOps2CompleteDevVAddr.uiAddr;
- ui32Ptr[PVRSRV_TRACE_SYNC_OP] = ui8SyncOp;
-}
-
-/*!
-******************************************************************************
-
- @Function PVRSRVDumpTimeTraceBuffer
-
- @Description
-
- Dump the contents of the trace buffer.
-
- @Input hKey : Trace item's group ID
-
- @Input hData : Trace item's ui32Token ID
-
- @Return Error
-
-******************************************************************************/
-static PVRSRV_ERROR PVRSRVDumpTimeTraceBuffer(IMG_UINTPTR_T hKey, IMG_UINTPTR_T hData)
-{
- sTimeTraceBuffer *psBuffer = (sTimeTraceBuffer *) hData;
- IMG_UINT32 ui32ByteCount = psBuffer->ui32ByteCount;
- IMG_UINT32 ui32Walker = psBuffer->ui32Roff;
- IMG_UINT32 ui32Read, ui32LineLen, ui32EOL, ui32MinLine;
-
- PVR_DPF((PVR_DBG_ERROR, "TTB for PID %u:\n", (IMG_UINT32) hKey));
-
- while (ui32ByteCount)
- {
- IMG_UINT32 *pui32Buffer = (IMG_UINT32 *) &psBuffer->ui8Data[ui32Walker];
-
- ui32LineLen = (ui32ByteCount/sizeof(IMG_UINT32));
- ui32EOL = (TIME_TRACE_BUFFER_SIZE - ui32Walker)/sizeof(IMG_UINT32);
- ui32MinLine = (ui32LineLen < ui32EOL)?ui32LineLen:ui32EOL;
-
- if (ui32MinLine >= 4)
- {
- PVR_DPF((PVR_DBG_ERROR, "\t(TTB-%X) %08X %08X %08X %08X", ui32ByteCount,
- pui32Buffer[0], pui32Buffer[1], pui32Buffer[2], pui32Buffer[3]));
- ui32Read = 4 * sizeof(IMG_UINT32);
- }
- else if (ui32MinLine >= 3)
- {
- PVR_DPF((PVR_DBG_ERROR, "\t(TTB-%X) %08X %08X %08X", ui32ByteCount,
- pui32Buffer[0], pui32Buffer[1], pui32Buffer[2]));
- ui32Read = 3 * sizeof(IMG_UINT32);
- }
- else if (ui32MinLine >= 2)
- {
- PVR_DPF((PVR_DBG_ERROR, "\t(TTB-%X) %08X %08X", ui32ByteCount,
- pui32Buffer[0], pui32Buffer[1]));
- ui32Read = 2 * sizeof(IMG_UINT32);
- }
- else
- {
- PVR_DPF((PVR_DBG_ERROR, "\t(TTB-%X) %08X", ui32ByteCount,
- pui32Buffer[0]));
- ui32Read = sizeof(IMG_UINT32);
- }
-
- ui32Walker = (ui32Walker + ui32Read) & (TIME_TRACE_BUFFER_SIZE - 1);
- ui32ByteCount -= ui32Read;
- }
-
- return PVRSRV_OK;
-}
-
-/*!
-******************************************************************************
-
- @Function PVRSRVDumpTimeTraceBuffers
-
- @Description
-
- Dump the contents of all the trace buffers.
-
- @Return None
-
-******************************************************************************/
-IMG_VOID PVRSRVDumpTimeTraceBuffers(IMG_VOID)
-{
- HASH_Iterate(g_psBufferTable, PVRSRVDumpTimeTraceBuffer);
-}
-
-#endif /* TTRACE */
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
typedef struct _MMU_PT_INFO_
{
-
+
IMG_VOID *hPTPageOSMemHandle;
IMG_CPU_VIRTADDR PTPageCpuVAddr;
-
-
+
+
IMG_UINT32 ui32ValidPTECount;
} MMU_PT_INFO;
struct _MMU_CONTEXT_
{
-
+
PVRSRV_DEVICE_NODE *psDeviceNode;
-
+
IMG_CPU_VIRTADDR pvPDCpuVAddr;
IMG_DEV_PHYADDR sPDDevPAddr;
IMG_VOID *hPDOSMemHandle;
-
+
MMU_PT_INFO *apsPTInfoList[SGX_MAX_PD_ENTRIES];
PVRSRV_SGXDEV_INFO *psDevInfo;
struct _MMU_HEAP_
{
-
+
MMU_CONTEXT *psMMUContext;
+
-
-
+
IMG_UINT32 ui32PDBaseIndex;
-
+
IMG_UINT32 ui32PageTableCount;
-
+
IMG_UINT32 ui32PTETotalUsable;
-
+
IMG_UINT32 ui32PDEPageSizeCtrl;
+
-
-
+
IMG_UINT32 ui32DataPageSize;
-
+
IMG_UINT32 ui32DataPageBitWidth;
-
+
IMG_UINT32 ui32DataPageMask;
+
-
-
+
IMG_UINT32 ui32PTShift;
-
+
IMG_UINT32 ui32PTBitWidth;
-
+
IMG_UINT32 ui32PTMask;
-
+
IMG_UINT32 ui32PTSize;
-
+
IMG_UINT32 ui32PTNumEntriesAllocated;
-
+
IMG_UINT32 ui32PTNumEntriesUsable;
+
-
-
+
IMG_UINT32 ui32PDShift;
-
+
IMG_UINT32 ui32PDBitWidth;
-
+
IMG_UINT32 ui32PDMask;
-
+
RA_ARENA *psVMArena;
DEV_ARENA_DESCRIPTOR *psDevArena;
IMG_SIZE_T uSize,
IMG_BOOL bForUnmap,
IMG_HANDLE hUniqueTag);
-#endif
+#endif
#define PAGE_TEST 0
#if PAGE_TEST
IMG_UINT32 *p = (IMG_UINT32*) psPTInfoList->PTPageCpuVAddr;
IMG_UINT32 i, ui32Count = 0;
-
+
for(i = 0; i < 1024; i++)
if(p[i] & SGX_MMU_PTE_VALID)
ui32Count++;
BUG();
}
}
-#else
+#else
static INLINE IMG_VOID CheckPT(MMU_PT_INFO *psPTInfoList)
{
PVR_UNREFERENCED_PARAMETER(psPTInfoList);
}
-#endif
-
-#if defined(PVRSRV_MMU_MAKE_READWRITE_ON_DEMAND)
-
-#include <linux/version.h>
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38))
-#ifndef AUTOCONF_INCLUDED
-#include <linux/config.h>
-#endif
-#else
-#include <generated/autoconf.h>
-#endif
-
-#include <linux/mm.h>
-#include <linux/sched.h>
-#include <linux/highmem.h>
-#include <asm/pgtable.h>
-#include <asm/tlbflush.h>
-
-static IMG_VOID MakeKernelPageReadWrite(IMG_PVOID ulCPUVAddr)
-{
- pgd_t *psPGD;
- pud_t *psPUD;
- pmd_t *psPMD;
- pte_t *psPTE;
- pte_t ptent;
- spinlock_t *psPTLock;
- IMG_UINT32 ui32CPUVAddr = (IMG_UINT32) ulCPUVAddr;
- struct mm_struct *psMM = current->active_mm;
-
-
- psPGD = pgd_offset(psMM, ui32CPUVAddr);
- if (pgd_none(*psPGD) || pgd_bad(*psPGD))
- {
- PVR_ASSERT(0);
- }
-
- psPUD = pud_offset(psPGD, ui32CPUVAddr);
- if (pud_none(*psPUD) || pud_bad(*psPUD))
- {
- PVR_ASSERT(0);
- }
-
- psPMD = pmd_offset(psPUD, ui32CPUVAddr);
- if (pmd_none(*psPMD) || pmd_bad(*psPMD))
- {
- PVR_ASSERT(0);
- }
-
- psPTE = (pte_t *)pte_offset_map_lock(psMM, psPMD, ui32CPUVAddr, &psPTLock);
-
- ptent = ptep_modify_prot_start(psMM, ui32CPUVAddr, psPTE);
- ptent = pte_mkwrite(ptent);
- ptep_modify_prot_commit(psMM, ui32CPUVAddr, psPTE, ptent);
- pte_unmap_unlock(psPTE, psPTLock);
-
- flush_tlb_all();
-}
-
-static IMG_VOID MakeKernelPageReadOnly(IMG_PVOID ulCPUVAddr)
-{
- pgd_t *psPGD;
- pud_t *psPUD;
- pmd_t *psPMD;
- pte_t *psPTE;
- pte_t ptent;
- spinlock_t *psPTLock;
- IMG_UINT32 ui32CPUVAddr = (IMG_UINT32) ulCPUVAddr;
- struct mm_struct *psMM = current->active_mm;
-
- OSWriteMemoryBarrier();
-
- psPGD = pgd_offset(psMM, ui32CPUVAddr);
- if (pgd_none(*psPGD) || pgd_bad(*psPGD))
- {
- PVR_ASSERT(0);
- }
+#endif
- psPUD = pud_offset(psPGD, ui32CPUVAddr);
- if (pud_none(*psPUD) || pud_bad(*psPUD))
- {
- PVR_ASSERT(0);
- }
-
- psPMD = pmd_offset(psPUD, ui32CPUVAddr);
- if (pmd_none(*psPMD) || pmd_bad(*psPMD))
- {
- PVR_ASSERT(0);
- }
-
-
- psPTE = (pte_t *)pte_offset_map_lock(psMM, psPMD, ui32CPUVAddr, &psPTLock);
-
- ptent = ptep_modify_prot_start(psMM, ui32CPUVAddr, psPTE);
- ptent = pte_wrprotect(ptent);
- ptep_modify_prot_commit(psMM, ui32CPUVAddr, psPTE, ptent);
- pte_unmap_unlock(psPTE, psPTLock);
-
- flush_tlb_all();
-
-}
-
-#else
-
-static INLINE IMG_VOID MakeKernelPageReadWrite(IMG_PVOID ulCPUVAddr)
-{
- PVR_UNREFERENCED_PARAMETER(ulCPUVAddr);
-}
-
-static INLINE IMG_VOID MakeKernelPageReadOnly(IMG_PVOID ulCPUVAddr)
-{
- PVR_UNREFERENCED_PARAMETER(ulCPUVAddr);
-}
-
-#endif
IMG_BOOL MMU_IsHeapShared(MMU_HEAP* pMMUHeap)
{
IMG_UINT32 ui32RegVal;
IMG_VOID *pvRegsBaseKM = psMMUContext->psDevInfo->pvRegsBaseKM;
-
+
ui32RegVal = OSReadHWReg(pvRegsBaseKM, EUR_CR_BIF_CTRL);
OSWriteHWReg(pvRegsBaseKM,
EUR_CR_BIF_CTRL,
ui32RegVal | EUR_CR_BIF_CTRL_MMU_BYPASS_HOST_MASK);
-
+
PDUMPREG(SGX_PDUMPREG_NAME, EUR_CR_BIF_CTRL, EUR_CR_BIF_CTRL_MMU_BYPASS_HOST_MASK);
}
IMG_UINT32 ui32RegVal;
IMG_VOID *pvRegsBaseKM = psMMUContext->psDevInfo->pvRegsBaseKM;
-
+
OSWriteHWReg(pvRegsBaseKM,
EUR_CR_BIF_CTRL,
ui32RegVal & ~EUR_CR_BIF_CTRL_MMU_BYPASS_HOST_MASK);
-
+
PDUMPREG(SGX_PDUMPREG_NAME, EUR_CR_BIF_CTRL, 0);
}
#endif
#if defined(SGX_FEATURE_MP)
psDevInfo->ui32CacheControl |= SGXMKIF_CC_INVAL_BIF_SL;
#else
-
+
PVR_UNREFERENCED_PARAMETER(psDevInfo);
- #endif
+ #endif
}
-#endif
+#endif
IMG_VOID MMU_InvalidateDirectoryCache(PVRSRV_SGXDEV_INFO *psDevInfo)
{
psDevInfo->ui32CacheControl |= SGXMKIF_CC_INVAL_BIF_PD;
#if defined(SGX_FEATURE_SYSTEM_CACHE)
MMU_InvalidateSystemLevelCache(psDevInfo);
- #endif
+ #endif
}
psDevInfo->ui32CacheControl |= SGXMKIF_CC_INVAL_BIF_PT;
#if defined(SGX_FEATURE_SYSTEM_CACHE)
MMU_InvalidateSystemLevelCache(psDevInfo);
- #endif
+ #endif
}
#if defined(FIX_HW_BRN_31620)
{
PVRSRV_SGXDEV_INFO *psDevInfo = psMMUContext->psDevInfo;
-
+
if (((ui32PDIndex % (BRN31620_PDE_CACHE_FILL_SIZE/BRN31620_PT_ADDRESS_RANGE_SIZE)) == BRN31620_DUMMY_PDE_INDEX)
&& (ui32PTIndex == BRN31620_DUMMY_PTE_INDEX))
{
PVR_ASSERT(psMMUHeap != IMG_NULL);
-
+
PVR_ASSERT(psMMUContext->apsPTInfoListSave[ui32PDIndex] == IMG_NULL);
psMMUContext->apsPTInfoListSave[ui32PDIndex] = psMMUContext->apsPTInfoList[ui32PDIndex];
psMMUContext->apsPTInfoList[ui32PDIndex] = IMG_NULL;
-
+
if (--psMMUContext->ui32PDCacheRangeRefCount[ui32PDCacheLine] == 0)
{
IMG_UINT32 i;
IMG_UINT32 ui32PDIndexEnd = ui32PDIndexStart + BRN31620_PDES_PER_CACHE_LINE_SIZE;
IMG_UINT32 ui32PDBitMaskIndex, ui32PDBitMaskShift;
-
+
for (i=ui32PDIndexStart;i<ui32PDIndexEnd;i++)
{
-
+
psMMUContext->apsPTInfoList[i] = psMMUContext->apsPTInfoListSave[i];
psMMUContext->apsPTInfoListSave[i] = IMG_NULL;
_DeferredFreePageTable(psMMUHeap, i - psMMUHeap->ui32PDBaseIndex, IMG_TRUE);
ui32PDBitMaskIndex = ui32PDCacheLine >> BRN31620_CACHE_FLUSH_BITS_SHIFT;
ui32PDBitMaskShift = ui32PDCacheLine & BRN31620_CACHE_FLUSH_BITS_MASK;
-
+
if (MMU_IsHeapShared(psMMUHeap))
{
-
+
MMU_CONTEXT *psMMUContextWalker = (MMU_CONTEXT*) psMMUHeap->psMMUContext->psDevInfo->pvMMUContextList;
while(psMMUContextWalker)
{
psMMUContextWalker->ui32PDChangeMask[ui32PDBitMaskIndex] |= 1 << ui32PDBitMaskShift;
-
- MakeKernelPageReadWrite(psMMUContextWalker->pvPDCpuVAddr);
+
pui32Tmp = (IMG_UINT32 *) psMMUContextWalker->pvPDCpuVAddr;
pui32Tmp[ui32PDIndexStart + BRN31620_DUMMY_PDE_INDEX] = (psDevInfo->sBRN31620DummyPTDevPAddr.uiAddr>>SGX_MMU_PDE_ADDR_ALIGNSHIFT)
| SGX_MMU_PDE_PAGE_SIZE_4K
| SGX_MMU_PDE_DUMMY_PAGE
| SGX_MMU_PDE_VALID;
- MakeKernelPageReadOnly(psMMUContextWalker->pvPDCpuVAddr);
PDUMPCOMMENT("BRN31620 Re-wire dummy PT due to releasing PT allocation block");
PDUMPPDENTRIES(&psMMUHeap->sMMUAttrib, psMMUContextWalker->hPDOSMemHandle, (IMG_VOID*)&pui32Tmp[ui32PDIndexStart + BRN31620_DUMMY_PDE_INDEX], sizeof(IMG_UINT32), 0, IMG_FALSE, PDUMP_PT_UNIQUETAG, PDUMP_PT_UNIQUETAG);
{
psMMUContext->ui32PDChangeMask[ui32PDBitMaskIndex] |= 1 << ui32PDBitMaskShift;
-
- MakeKernelPageReadWrite(psMMUContext->pvPDCpuVAddr);
+
pui32Tmp = (IMG_UINT32 *) psMMUContext->pvPDCpuVAddr;
pui32Tmp[ui32PDIndexStart + BRN31620_DUMMY_PDE_INDEX] = (psDevInfo->sBRN31620DummyPTDevPAddr.uiAddr>>SGX_MMU_PDE_ADDR_ALIGNSHIFT)
| SGX_MMU_PDE_PAGE_SIZE_4K
| SGX_MMU_PDE_DUMMY_PAGE
| SGX_MMU_PDE_VALID;
- MakeKernelPageReadOnly(psMMUContext->pvPDCpuVAddr);
PDUMPCOMMENT("BRN31620 Re-wire dummy PT due to releasing PT allocation block");
PDUMPPDENTRIES(&psMMUHeap->sMMUAttrib, psMMUContext->hPDOSMemHandle, (IMG_VOID*)&pui32Tmp[ui32PDIndexStart + BRN31620_DUMMY_PDE_INDEX], sizeof(IMG_UINT32), 0, IMG_FALSE, PDUMP_PT_UNIQUETAG, PDUMP_PT_UNIQUETAG);
}
-
+
bFreePTs = IMG_TRUE;
}
IMG_DEV_PHYADDR sDevPAddr;
IMG_CPU_PHYADDR sCpuPAddr;
-
+
if(pMMUHeap->psDevArena->psDeviceMemoryHeapInfo->psLocalDevMemArena == IMG_NULL)
{
-
+
if (OSAllocPages(PVRSRV_HAP_WRITECOMBINE | PVRSRV_HAP_KERNEL_ONLY,
pMMUHeap->ui32PTSize,
SGX_MMU_PAGE_SIZE,
return IMG_FALSE;
}
-
-
-
- MakeKernelPageReadOnly(psPTInfoList->PTPageCpuVAddr);
-
-
+
if(psPTInfoList->PTPageCpuVAddr)
{
sCpuPAddr = OSMapLinToCPUPhys(psPTInfoList->hPTPageOSMemHandle,
}
else
{
-
+
sCpuPAddr = OSMemHandleToCpuPAddr(psPTInfoList->hPTPageOSMemHandle, 0);
}
{
IMG_SYS_PHYADDR sSysPAddr;
+
-
-
+
if(RA_Alloc(pMMUHeap->psDevArena->psDeviceMemoryHeapInfo->psLocalDevMemArena,
SGX_MMU_PAGE_SIZE,
IMG_NULL,
return IMG_FALSE;
}
-
+
sCpuPAddr = SysSysPAddrToCpuPAddr(sSysPAddr);
-
+
psPTInfoList->PTPageCpuVAddr = OSMapPhysToLin(sCpuPAddr,
SGX_MMU_PAGE_SIZE,
PVRSRV_HAP_WRITECOMBINE|PVRSRV_HAP_KERNEL_ONLY,
return IMG_FALSE;
}
-
+
sDevPAddr = SysCpuPAddrToDevPAddr (PVRSRV_DEVICE_TYPE_SGX, sCpuPAddr);
#if PAGE_TEST
#endif
}
- MakeKernelPageReadWrite(psPTInfoList->PTPageCpuVAddr);
#if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
{
IMG_UINT32 *pui32Tmp;
IMG_UINT32 i;
pui32Tmp = (IMG_UINT32*)psPTInfoList->PTPageCpuVAddr;
-
+
for(i=0; i<pMMUHeap->ui32PTNumEntriesUsable; i++)
{
pui32Tmp[i] = (pMMUHeap->psMMUContext->psDevInfo->sDummyDataDevPAddr.uiAddr>>SGX_MMU_PTE_ADDR_ALIGNSHIFT)
| SGX_MMU_PTE_VALID;
}
-
+
for(; i<pMMUHeap->ui32PTNumEntriesAllocated; i++)
{
pui32Tmp[i] = 0;
}
}
#else
-
+
OSMemSet(psPTInfoList->PTPageCpuVAddr, 0, pMMUHeap->ui32PTSize);
#endif
- MakeKernelPageReadOnly(psPTInfoList->PTPageCpuVAddr);
#if defined(PDUMP)
{
IMG_UINT32 ui32Flags = 0;
#if defined(SUPPORT_PDUMP_MULTI_PROCESS)
-
+
ui32Flags |= ( MMU_IsHeapShared(pMMUHeap) ) ? PDUMP_FLAGS_PERSISTENT : 0;
#endif
-
+
PDUMPMALLOCPAGETABLE(&pMMUHeap->psMMUContext->psDeviceNode->sDevId, psPTInfoList->hPTPageOSMemHandle, 0, psPTInfoList->PTPageCpuVAddr, pMMUHeap->ui32PTSize, ui32Flags, PDUMP_PT_UNIQUETAG);
-
+
PDUMPMEMPTENTRIES(&pMMUHeap->sMMUAttrib, psPTInfoList->hPTPageOSMemHandle, psPTInfoList->PTPageCpuVAddr, pMMUHeap->ui32PTSize, ui32Flags, IMG_TRUE, PDUMP_PT_UNIQUETAG, PDUMP_PT_UNIQUETAG);
}
#endif
-
-
+
+
*psDevPAddr = sDevPAddr;
return IMG_TRUE;
static IMG_VOID
_FreePageTableMemory (MMU_HEAP *pMMUHeap, MMU_PT_INFO *psPTInfoList)
{
-
+
if(pMMUHeap->psDevArena->psDeviceMemoryHeapInfo->psLocalDevMemArena == IMG_NULL)
{
-
- MakeKernelPageReadWrite(psPTInfoList->PTPageCpuVAddr);
-
-
+
OSFreePages(PVRSRV_HAP_WRITECOMBINE | PVRSRV_HAP_KERNEL_ONLY,
pMMUHeap->ui32PTSize,
psPTInfoList->PTPageCpuVAddr,
IMG_SYS_PHYADDR sSysPAddr;
IMG_CPU_PHYADDR sCpuPAddr;
-
- sCpuPAddr = OSMapLinToCPUPhys(psPTInfoList->hPTPageOSMemHandle,
+
+ sCpuPAddr = OSMapLinToCPUPhys(psPTInfoList->hPTPageOSMemHandle,
psPTInfoList->PTPageCpuVAddr);
sSysPAddr = SysCpuPAddrToSysPAddr (sCpuPAddr);
-
-
+
+
OSUnMapPhysToLin(psPTInfoList->PTPageCpuVAddr,
SGX_MMU_PAGE_SIZE,
PVRSRV_HAP_WRITECOMBINE|PVRSRV_HAP_KERNEL_ONLY,
psPTInfoList->hPTPageOSMemHandle);
-
+
RA_Free (pMMUHeap->psDevArena->psDeviceMemoryHeapInfo->psLocalDevMemArena, sSysPAddr.uiAddr, IMG_FALSE);
SysAcquireData(&psSysData);
-
+
ui32PDIndex = pMMUHeap->psDevArena->BaseDevVAddr.uiAddr >> pMMUHeap->ui32PDShift;
-
+
ppsPTInfoList = &pMMUHeap->psMMUContext->apsPTInfoList[ui32PDIndex];
{
if(ppsPTInfoList[ui32PTIndex] && ppsPTInfoList[ui32PTIndex]->ui32ValidPTECount > 0)
{
DumpPT(ppsPTInfoList[ui32PTIndex]);
-
+
}
#endif
-
+
PVR_ASSERT(ppsPTInfoList[ui32PTIndex] == IMG_NULL || ppsPTInfoList[ui32PTIndex]->ui32ValidPTECount == 0);
}
#if defined(SUPPORT_PDUMP_MULTI_PROCESS)
ui32Flags |= ( MMU_IsHeapShared(pMMUHeap) ) ? PDUMP_FLAGS_PERSISTENT : 0;
#endif
-
+
PDUMPCOMMENT("Free page table (page count == %08X)", pMMUHeap->ui32PageTableCount);
if(ppsPTInfoList[ui32PTIndex] && ppsPTInfoList[ui32PTIndex]->PTPageCpuVAddr)
{
case DEVICE_MEMORY_HEAP_SHARED :
case DEVICE_MEMORY_HEAP_SHARED_EXPORTED :
{
-
+
MMU_CONTEXT *psMMUContext = (MMU_CONTEXT*)pMMUHeap->psMMUContext->psDevInfo->pvMMUContextList;
while(psMMUContext)
{
-
- MakeKernelPageReadWrite(psMMUContext->pvPDCpuVAddr);
+
pui32PDEntry = (IMG_UINT32*)psMMUContext->pvPDCpuVAddr;
pui32PDEntry += ui32PDIndex;
#if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
-
+
pui32PDEntry[ui32PTIndex] = (psMMUContext->psDevInfo->sDummyPTDevPAddr.uiAddr
>>SGX_MMU_PDE_ADDR_ALIGNSHIFT)
| SGX_MMU_PDE_PAGE_SIZE_4K
| SGX_MMU_PDE_VALID;
#else
-
+
if(bOSFreePT)
{
pui32PDEntry[ui32PTIndex] = 0;
}
#endif
- MakeKernelPageReadOnly(psMMUContext->pvPDCpuVAddr);
#if defined(PDUMP)
-
+
#if defined(SUPPORT_PDUMP_MULTI_PROCESS)
if(psMMUContext->bPDumpActive)
#endif
PDUMPPDENTRIES(&pMMUHeap->sMMUAttrib, psMMUContext->hPDOSMemHandle, (IMG_VOID*)&pui32PDEntry[ui32PTIndex], sizeof(IMG_UINT32), 0, IMG_FALSE, PDUMP_PT_UNIQUETAG, PDUMP_PT_UNIQUETAG);
}
#endif
-
+
psMMUContext = psMMUContext->psNext;
}
break;
case DEVICE_MEMORY_HEAP_PERCONTEXT :
case DEVICE_MEMORY_HEAP_KERNEL :
{
- MakeKernelPageReadWrite(pMMUHeap->psMMUContext->pvPDCpuVAddr);
-
+
pui32PDEntry = (IMG_UINT32*)pMMUHeap->psMMUContext->pvPDCpuVAddr;
pui32PDEntry += ui32PDIndex;
#if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
-
+
pui32PDEntry[ui32PTIndex] = (pMMUHeap->psMMUContext->psDevInfo->sDummyPTDevPAddr.uiAddr
>>SGX_MMU_PDE_ADDR_ALIGNSHIFT)
| SGX_MMU_PDE_PAGE_SIZE_4K
| SGX_MMU_PDE_VALID;
#else
-
+
if(bOSFreePT)
{
pui32PDEntry[ui32PTIndex] = 0;
}
#endif
- MakeKernelPageReadOnly(pMMUHeap->psMMUContext->pvPDCpuVAddr);
-
+
PDUMPPDENTRIES(&pMMUHeap->sMMUAttrib, pMMUHeap->psMMUContext->hPDOSMemHandle, (IMG_VOID*)&pui32PDEntry[ui32PTIndex], sizeof(IMG_UINT32), 0, IMG_FALSE, PDUMP_PD_UNIQUETAG, PDUMP_PT_UNIQUETAG);
break;
}
}
}
-
+
if(ppsPTInfoList[ui32PTIndex] != IMG_NULL)
{
if(ppsPTInfoList[ui32PTIndex]->PTPageCpuVAddr != IMG_NULL)
{
IMG_PUINT32 pui32Tmp;
- MakeKernelPageReadWrite(ppsPTInfoList[ui32PTIndex]->PTPageCpuVAddr);
pui32Tmp = (IMG_UINT32*)ppsPTInfoList[ui32PTIndex]->PTPageCpuVAddr;
-
+
for(i=0;
(i<pMMUHeap->ui32PTETotalUsable) && (i<pMMUHeap->ui32PTNumEntriesUsable);
i++)
{
-
+
pui32Tmp[i] = 0;
}
- MakeKernelPageReadOnly(ppsPTInfoList[ui32PTIndex]->PTPageCpuVAddr);
-
+
if(bOSFreePT)
{
_FreePageTableMemory(pMMUHeap, ppsPTInfoList[ui32PTIndex]);
}
-
+
pMMUHeap->ui32PTETotalUsable -= i;
}
else
{
-
+
pMMUHeap->ui32PTETotalUsable -= pMMUHeap->ui32PTNumEntriesUsable;
}
if(bOSFreePT)
{
-
+
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP,
sizeof(MMU_PT_INFO),
ppsPTInfoList[ui32PTIndex],
}
else
{
-
+
pMMUHeap->ui32PTETotalUsable -= pMMUHeap->ui32PTNumEntriesUsable;
}
{
if (psMMUContext->apsPTInfoList[ui32PDIndex]->PTPageCpuVAddr)
{
-
+
for (j=0;j<SGX_MMU_PT_SIZE;j++)
{
pui32Tmp = (IMG_UINT32 *) psMMUContext->apsPTInfoList[ui32PDIndex]->PTPageCpuVAddr;
BRN31620InvalidatePageTableEntry(psMMUContext, ui32PDIndex, j, &pui32Tmp[j]);
}
}
-
+
if (BRN31620FreePageTable(pMMUHeap, ui32PDIndex) == IMG_TRUE)
{
bInvalidateDirectoryCache = IMG_TRUE;
}
}
-
+
if (bInvalidateDirectoryCache)
{
MMU_InvalidateDirectoryCache(pMMUHeap->psMMUContext->psDevInfo);
IMG_UINT32 ui32ModifiedCachelines[BRN31620_CACHE_FLUSH_INDEX_SIZE];
#endif
-
+
#if SGX_FEATURE_ADDRESS_SPACE_SIZE < 32
PVR_ASSERT(DevVAddr.uiAddr < (1<<SGX_FEATURE_ADDRESS_SPACE_SIZE));
#endif
-
+
SysAcquireData(&psSysData);
-
+
ui32PDIndex = DevVAddr.uiAddr >> pMMUHeap->ui32PDShift;
-
-
+
+
if((UINT32_MAX_VALUE - DevVAddr.uiAddr)
< (ui32Size + pMMUHeap->ui32DataPageMask + pMMUHeap->ui32PTMask))
{
-
+
sHighDevVAddr.uiAddr = UINT32_MAX_VALUE;
}
else
ui32PageTableCount = sHighDevVAddr.uiAddr >> pMMUHeap->ui32PDShift;
-
+
if (ui32PageTableCount == 0)
ui32PageTableCount = 1024;
ui32ModifiedCachelines[i] = 0;
}
-
-
-
+
+
+
sDevVAddrRequestStart = DevVAddr;
ui32PDRequestStart = ui32PDIndex;
sDevVAddrRequestEnd = sHighDevVAddr;
ui32PDRequestEnd = ui32PageTableCount - 1;
-
+
DevVAddr.uiAddr = DevVAddr.uiAddr & (~BRN31620_PDE_CACHE_FILL_MASK);
-
+
sHighDevVAddr.uiAddr = ((sHighDevVAddr.uiAddr + (BRN31620_PDE_CACHE_FILL_SIZE - 1)) & (~BRN31620_PDE_CACHE_FILL_MASK));
ui32PDIndex = DevVAddr.uiAddr >> pMMUHeap->ui32PDShift;
ui32PageTableCount = sHighDevVAddr.uiAddr >> pMMUHeap->ui32PDShift;
-
+
if (ui32PageTableCount == 0)
ui32PageTableCount = 1024;
#endif
ui32PageTableCount -= ui32PDIndex;
-
+
pui32PDEntry = (IMG_UINT32*)pMMUHeap->psMMUContext->pvPDCpuVAddr;
pui32PDEntry += ui32PDIndex;
-
+
ppsPTInfoList = &pMMUHeap->psMMUContext->apsPTInfoList[ui32PDIndex];
#if defined(PDUMP)
{
IMG_UINT32 ui32Flags = 0;
-
-
+
+
if( MMU_IsHeapShared(pMMUHeap) )
{
ui32Flags |= PDUMP_FLAGS_CONTINUOUS;
PDUMPCOMMENTWITHFLAGS(ui32Flags, "Page directory mods (page count == %08X)", ui32PageTableCount);
}
#endif
-
+
for(i=0; i<ui32PageTableCount; i++)
{
if(ppsPTInfoList[i] == IMG_NULL)
{
#if defined(FIX_HW_BRN_31620)
-
+
if (pMMUHeap->psMMUContext->apsPTInfoListSave[ui32PDIndex + i])
{
-
+
if (((ui32PDIndex + i) >= ui32PDRequestStart) && ((ui32PDIndex + i) <= ui32PDRequestEnd))
{
IMG_UINT32 ui32PDCacheLine = (ui32PDIndex + i) >> BRN31620_PDES_PER_CACHE_LINE_SHIFT;
#endif
}
#if defined(FIX_HW_BRN_31620)
-
+
if (ppsPTInfoList[i])
{
#endif
IMG_UINT32 j;
#else
#if !defined(FIX_HW_BRN_31620)
-
+
PVR_ASSERT(pui32PDEntry[i] == 0);
#endif
#endif
}
#if defined(FIX_HW_BRN_31620)
bFlushSystemCache = IMG_TRUE;
-
+
{
IMG_UINT32 ui32PD;
IMG_UINT32 ui32PDCacheLine;
ui32PDBitMaskShift = ui32PDCacheLine & BRN31620_CACHE_FLUSH_BITS_MASK;
ui32ModifiedCachelines[ui32PDBitMaskIndex] |= 1 << ui32PDBitMaskShift;
-
+
if ((pMMUHeap->ui32PDBaseIndex + pMMUHeap->ui32PageTableCount) < (ui32PD + 1))
{
pMMUHeap->ui32PageTableCount = (ui32PD + 1) - pMMUHeap->ui32PDBaseIndex;
case DEVICE_MEMORY_HEAP_SHARED :
case DEVICE_MEMORY_HEAP_SHARED_EXPORTED :
{
-
+
MMU_CONTEXT *psMMUContext = (MMU_CONTEXT*)pMMUHeap->psMMUContext->psDevInfo->pvMMUContextList;
while(psMMUContext)
{
- MakeKernelPageReadWrite(psMMUContext->pvPDCpuVAddr);
-
+
pui32PDEntry = (IMG_UINT32*)psMMUContext->pvPDCpuVAddr;
pui32PDEntry += ui32PDIndex;
-
+
pui32PDEntry[i] = (sDevPAddr.uiAddr>>SGX_MMU_PDE_ADDR_ALIGNSHIFT)
| pMMUHeap->ui32PDEPageSizeCtrl
| SGX_MMU_PDE_VALID;
- MakeKernelPageReadOnly(psMMUContext->pvPDCpuVAddr);
#if defined(PDUMP)
-
+
#if defined(SUPPORT_PDUMP_MULTI_PROCESS)
if(psMMUContext->bPDumpActive)
#endif
{
-
+
PDUMPPDENTRIES(&pMMUHeap->sMMUAttrib, psMMUContext->hPDOSMemHandle, (IMG_VOID*)&pui32PDEntry[i], sizeof(IMG_UINT32), 0, IMG_FALSE, PDUMP_PD_UNIQUETAG, PDUMP_PT_UNIQUETAG);
}
- #endif
-
+ #endif
+
psMMUContext = psMMUContext->psNext;
}
#if defined(FIX_HW_BRN_31620)
case DEVICE_MEMORY_HEAP_PERCONTEXT :
case DEVICE_MEMORY_HEAP_KERNEL :
{
- MakeKernelPageReadWrite(pMMUHeap->psMMUContext->pvPDCpuVAddr);
-
+
pui32PDEntry[i] = (sDevPAddr.uiAddr>>SGX_MMU_PDE_ADDR_ALIGNSHIFT)
| pMMUHeap->ui32PDEPageSizeCtrl
| SGX_MMU_PDE_VALID;
- MakeKernelPageReadOnly(pMMUHeap->psMMUContext->pvPDCpuVAddr);
-
+
+
PDUMPPDENTRIES(&pMMUHeap->sMMUAttrib, pMMUHeap->psMMUContext->hPDOSMemHandle, (IMG_VOID*)&pui32PDEntry[i], sizeof(IMG_UINT32), 0, IMG_FALSE, PDUMP_PD_UNIQUETAG, PDUMP_PT_UNIQUETAG);
break;
}
}
#if !defined(SGX_FEATURE_MULTIPLE_MEM_CONTEXTS)
-
+
MMU_InvalidateDirectoryCache(pMMUHeap->psMMUContext->psDevInfo);
#endif
#if defined(FIX_HW_BRN_31620)
-
+
if (((ui32PDIndex + i) < ui32PDRequestStart) || ((ui32PDIndex + i) > ui32PDRequestEnd))
{
pMMUHeap->psMMUContext->apsPTInfoListSave[ui32PDIndex + i] = ppsPTInfoList[i];
else
{
#if !defined(FIX_HW_BRN_31620)
-
+
PVR_ASSERT(pui32PDEntry[i] != 0);
#endif
}
#if defined(SGX_FEATURE_SYSTEM_CACHE)
#if defined(FIX_HW_BRN_31620)
-
+
if (bFlushSystemCache)
{
#endif
MMU_InvalidateSystemLevelCache(pMMUHeap->psMMUContext->psDevInfo);
- #endif
+ #endif
#if defined(FIX_HW_BRN_31620)
}
-
+
sHighDevVAddr.uiAddr = sHighDevVAddr.uiAddr - 1;
-
+
if (bFlushSystemCache)
{
MMU_CONTEXT *psMMUContext;
psMMUContext->ui32PDChangeMask[i] |= ui32ModifiedCachelines[i];
}
-
+
psMMUContext = psMMUContext->psNext;
}
}
}
}
-
+
psMMUContext = pMMUHeap->psMMUContext;
for (i=0;i<BRN31620_CACHE_FLUSH_INDEX_SIZE;i++)
{
ui32PDIndex = (((i * BRN31620_CACHE_FLUSH_BITS_SIZE) + j) * BRN31620_PDES_PER_CACHE_LINE_SIZE) + BRN31620_DUMMY_PDE_INDEX;
-
+
if (psMMUContext->apsPTInfoList[ui32PDIndex])
{
psTempPTInfo = psMMUContext->apsPTInfoList[ui32PDIndex];
PVR_ASSERT(psTempPTInfo != IMG_NULL);
- MakeKernelPageReadWrite(psTempPTInfo->PTPageCpuVAddr);
pui32Tmp = (IMG_UINT32 *) psTempPTInfo->PTPageCpuVAddr;
PVR_ASSERT(pui32Tmp != IMG_NULL);
pui32Tmp[BRN31620_DUMMY_PTE_INDEX] = (psDevInfo->sBRN31620DummyPageDevPAddr.uiAddr>>SGX_MMU_PTE_ADDR_ALIGNSHIFT)
| SGX_MMU_PTE_DUMMY_PAGE
| SGX_MMU_PTE_READONLY
| SGX_MMU_PTE_VALID;
- MakeKernelPageReadOnly(psTempPTInfo->PTPageCpuVAddr);
+
PDUMPCOMMENT("BRN31620 Dump PTE for dummy page after wireing up new PT");
PDUMPMEMPTENTRIES(&pMMUHeap->sMMUAttrib, psTempPTInfo->hPTPageOSMemHandle, (IMG_VOID *) &pui32Tmp[BRN31620_DUMMY_PTE_INDEX], sizeof(IMG_UINT32), 0, IMG_FALSE, PDUMP_PT_UNIQUETAG, PDUMP_PT_UNIQUETAG);
}
{
BM_CONTEXT *pBMContext = hDevMemContext;
PVR_ASSERT(pBMContext);
-
+
return pBMContext->psMMUContext->ui32PDumpMMUContextID;
}
IMG_UINT32 ui32DataPageMask,
IMG_UINT32 ui32PTSize)
{
-
+
psMMUAttrib->sDevId = psDeviceNode->sDevId;
-
+
psMMUAttrib->pszPDRegRegion = IMG_NULL;
psMMUAttrib->ui32DataPageMask = ui32DataPageMask;
-
+
psMMUAttrib->ui32PTEValid = SGX_MMU_PTE_VALID;
psMMUAttrib->ui32PTSize = ui32PTSize;
psMMUAttrib->ui32PTEAlignShift = SGX_MMU_PTE_ADDR_ALIGNSHIFT;
-
+
psMMUAttrib->ui32PDEMask = SGX_MMU_PDE_ADDR_MASK;
psMMUAttrib->ui32PDEAlignShift = SGX_MMU_PDE_ADDR_ALIGNSHIFT;
}
-#endif
+#endif
PVRSRV_ERROR
MMU_Initialise (PVRSRV_DEVICE_NODE *psDeviceNode, MMU_CONTEXT **ppsMMUContext, IMG_DEV_PHYADDR *psPDDevPAddr)
SysAcquireData(&psSysData);
#if defined(PDUMP)
-
-
+
+
MMU_SetPDumpAttribs(&sMMUAttrib, psDeviceNode,
SGX_MMU_PAGE_MASK,
SGX_MMU_PT_SIZE * sizeof(IMG_UINT32));
}
OSMemSet (psMMUContext, 0, sizeof(MMU_CONTEXT));
-
+
psDevInfo = (PVRSRV_SGXDEV_INFO*)psDeviceNode->pvDevice;
psMMUContext->psDevInfo = psDevInfo;
-
+
psMMUContext->psDeviceNode = psDeviceNode;
-
+
if(psDeviceNode->psLocalDevMemArena == IMG_NULL)
{
if (OSAllocPages(PVRSRV_HAP_WRITECOMBINE | PVRSRV_HAP_KERNEL_ONLY,
}
else
{
-
+
sCpuPAddr = OSMemHandleToCpuPAddr(hPDOSMemHandle, 0);
}
sPDDevPAddr = SysCpuPAddrToDevPAddr (PVRSRV_DEVICE_TYPE_SGX, sCpuPAddr);
#endif
#if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
-
+
if(!psDevInfo->pvMMUContextList)
{
-
+
if (OSAllocPages(PVRSRV_HAP_WRITECOMBINE | PVRSRV_HAP_KERNEL_ONLY,
SGX_MMU_PAGE_SIZE,
SGX_MMU_PAGE_SIZE,
}
else
{
-
+
sCpuPAddr = OSMemHandleToCpuPAddr(psDevInfo->hDummyPTPageOSMemHandle, 0);
}
psDevInfo->sDummyPTDevPAddr = SysCpuPAddrToDevPAddr (PVRSRV_DEVICE_TYPE_SGX, sCpuPAddr);
-
+
if (OSAllocPages(PVRSRV_HAP_WRITECOMBINE | PVRSRV_HAP_KERNEL_ONLY,
SGX_MMU_PAGE_SIZE,
SGX_MMU_PAGE_SIZE,
}
psDevInfo->sDummyDataDevPAddr = SysCpuPAddrToDevPAddr (PVRSRV_DEVICE_TYPE_SGX, sCpuPAddr);
}
-#endif
+#endif
#if defined(FIX_HW_BRN_31620)
-
+
if(!psDevInfo->pvMMUContextList)
{
IMG_UINT32 j;
-
+
if (OSAllocPages(PVRSRV_HAP_WRITECOMBINE | PVRSRV_HAP_KERNEL_ONLY,
SGX_MMU_PAGE_SIZE,
SGX_MMU_PAGE_SIZE,
{
PVR_DPF((PVR_DBG_ERROR, "MMU_Initialise: ERROR call to OSAllocPages failed"));
return PVRSRV_ERROR_FAILED_TO_ALLOC_PAGES;
- }
-
+ }
+
if(psDevInfo->pvBRN31620DummyPageCpuVAddr)
{
sCpuPAddr = OSMapLinToCPUPhys(psDevInfo->hBRN31620DummyPageOSMemHandle,
psDevInfo->sBRN31620DummyPageDevPAddr = SysCpuPAddrToDevPAddr(PVRSRV_DEVICE_TYPE_SGX, sCpuPAddr);
PDUMPMALLOCPAGETABLE(&psDeviceNode->sDevId, psDevInfo->hBRN31620DummyPageOSMemHandle, 0, psDevInfo->pvBRN31620DummyPageCpuVAddr, SGX_MMU_PAGE_SIZE, 0, PDUMP_PT_UNIQUETAG);
-
+
if (OSAllocPages(PVRSRV_HAP_WRITECOMBINE | PVRSRV_HAP_KERNEL_ONLY,
SGX_MMU_PAGE_SIZE,
SGX_MMU_PAGE_SIZE,
{
PVR_DPF((PVR_DBG_ERROR, "MMU_Initialise: ERROR call to OSAllocPages failed"));
return PVRSRV_ERROR_FAILED_TO_ALLOC_PAGES;
- }
-
+ }
+
if(psDevInfo->pvBRN31620DummyPTCpuVAddr)
{
sCpuPAddr = OSMapLinToCPUPhys(psDevInfo->hBRN31620DummyPTOSMemHandle,
{
IMG_SYS_PHYADDR sSysPAddr;
-
+
if(RA_Alloc(psDeviceNode->psLocalDevMemArena,
SGX_MMU_PAGE_SIZE,
IMG_NULL,
return PVRSRV_ERROR_FAILED_TO_ALLOC_VIRT_MEMORY;
}
-
+
sCpuPAddr = SysSysPAddrToCpuPAddr(sSysPAddr);
sPDDevPAddr = SysSysPAddrToDevPAddr(PVRSRV_DEVICE_TYPE_SGX, sSysPAddr);
pvPDCpuVAddr = OSMapPhysToLin(sCpuPAddr,
#endif
#if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
-
+
if(!psDevInfo->pvMMUContextList)
{
-
+
if(RA_Alloc(psDeviceNode->psLocalDevMemArena,
SGX_MMU_PAGE_SIZE,
IMG_NULL,
return PVRSRV_ERROR_FAILED_TO_ALLOC_VIRT_MEMORY;
}
-
+
sCpuPAddr = SysSysPAddrToCpuPAddr(sSysPAddr);
psDevInfo->sDummyPTDevPAddr = SysSysPAddrToDevPAddr(PVRSRV_DEVICE_TYPE_SGX, sSysPAddr);
psDevInfo->pvDummyPTPageCpuVAddr = OSMapPhysToLin(sCpuPAddr,
return PVRSRV_ERROR_FAILED_TO_MAP_PAGE_TABLE;
}
-
+
if(RA_Alloc(psDeviceNode->psLocalDevMemArena,
SGX_MMU_PAGE_SIZE,
IMG_NULL,
return PVRSRV_ERROR_FAILED_TO_ALLOC_VIRT_MEMORY;
}
-
+
sCpuPAddr = SysSysPAddrToCpuPAddr(sSysPAddr);
psDevInfo->sDummyDataDevPAddr = SysSysPAddrToDevPAddr(PVRSRV_DEVICE_TYPE_SGX, sSysPAddr);
psDevInfo->pvDummyDataPageCpuVAddr = OSMapPhysToLin(sCpuPAddr,
return PVRSRV_ERROR_FAILED_TO_MAP_PAGE_TABLE;
}
}
-#endif
+#endif
#if defined(FIX_HW_BRN_31620)
-
+
if(!psDevInfo->pvMMUContextList)
{
IMG_UINT32 j;
-
+
if(RA_Alloc(psDeviceNode->psLocalDevMemArena,
SGX_MMU_PAGE_SIZE,
IMG_NULL,
return PVRSRV_ERROR_FAILED_TO_ALLOC_VIRT_MEMORY;
}
-
+
sCpuPAddr = SysSysPAddrToCpuPAddr(sSysPAddr);
psDevInfo->sBRN31620DummyPageDevPAddr = SysSysPAddrToDevPAddr(PVRSRV_DEVICE_TYPE_SGX, sSysPAddr);
psDevInfo->pvBRN31620DummyPageCpuVAddr = OSMapPhysToLin(sCpuPAddr,
return PVRSRV_ERROR_FAILED_TO_MAP_PAGE_TABLE;
}
- MakeKernelPageReadWrite(psDevInfo->pvBRN31620DummyPageCpuVAddr);
pui32Tmp = (IMG_UINT32 *)psDevInfo->pvBRN31620DummyPageCpuVAddr;
for(j=0; j<(SGX_MMU_PAGE_SIZE/4); j++)
{
pui32Tmp[j] = BRN31620_DUMMY_PAGE_SIGNATURE;
}
- MakeKernelPageReadOnly(psDevInfo->pvBRN31620DummyPageCpuVAddr);
PDUMPMALLOCPAGETABLE(&psDeviceNode->sDevId, psDevInfo->hBRN31620DummyPageOSMemHandle, 0, psDevInfo->pvBRN31620DummyPageCpuVAddr, SGX_MMU_PAGE_SIZE, 0, PDUMP_PT_UNIQUETAG);
-
+
if(RA_Alloc(psDeviceNode->psLocalDevMemArena,
SGX_MMU_PAGE_SIZE,
IMG_NULL,
return PVRSRV_ERROR_FAILED_TO_ALLOC_VIRT_MEMORY;
}
-
+
sCpuPAddr = SysSysPAddrToCpuPAddr(sSysPAddr);
psDevInfo->sBRN31620DummyPTDevPAddr = SysSysPAddrToDevPAddr(PVRSRV_DEVICE_TYPE_SGX, sSysPAddr);
psDevInfo->pvBRN31620DummyPTCpuVAddr = OSMapPhysToLin(sCpuPAddr,
return PVRSRV_ERROR_FAILED_TO_MAP_PAGE_TABLE;
}
- OSMemSet(psDevInfo->pvBRN31620DummyPTCpuVAddr,0,SGX_MMU_PAGE_SIZE);
+ OSMemSet(psDevInfo->pvBRN31620DummyPTCpuVAddr,0,SGX_MMU_PAGE_SIZE);
PDUMPMALLOCPAGETABLE(&psDeviceNode->sDevId, psDevInfo->hBRN31620DummyPTOSMemHandle, 0, psDevInfo->pvBRN31620DummyPTCpuVAddr, SGX_MMU_PAGE_SIZE, 0, PDUMP_PT_UNIQUETAG);
}
-#endif
+#endif
}
#if defined(FIX_HW_BRN_31620)
if (!psDevInfo->pvMMUContextList)
{
-
+
psDevInfo->hKernelMMUContext = psMMUContext;
PVR_DPF((PVR_DBG_ERROR, "MMU_Initialise: saving kernel mmu context: %p", psMMUContext));
}
#if defined(PDUMP)
#if defined(SUPPORT_PDUMP_MULTI_PROCESS)
-
+
{
PVRSRV_PER_PROCESS_DATA* psPerProc = PVRSRVFindPerProcessData();
if(psPerProc == IMG_NULL)
{
-
+
psMMUContext->bPDumpActive = IMG_TRUE;
}
else
psMMUContext->bPDumpActive = psPerProc->bPDumpActive;
}
}
-#endif
-
+#endif
+
#if IMG_ADDRSPACE_PHYSADDR_BITS == 32
PDUMPCOMMENT("Alloc page directory for new MMU context (PDDevPAddr == 0x%08x)",
sPDDevPAddr.uiAddr);
sPDDevPAddr.uiHighAddr, sPDDevPAddr.uiAddr);
#endif
PDUMPMALLOCPAGETABLE(&psDeviceNode->sDevId, hPDOSMemHandle, 0, pvPDCpuVAddr, SGX_MMU_PAGE_SIZE, 0, PDUMP_PD_UNIQUETAG);
-#endif
+#endif
#ifdef SUPPORT_SGX_MMU_BYPASS
EnableHostAccess(psMMUContext);
#if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
- MakeKernelPageReadWrite(pvPDCpuVAddr);
-
+
for(i=0; i<SGX_MMU_PD_SIZE; i++)
{
pui32Tmp[i] = (psDevInfo->sDummyPTDevPAddr.uiAddr>>SGX_MMU_PDE_ADDR_ALIGNSHIFT)
| SGX_MMU_PDE_PAGE_SIZE_4K
| SGX_MMU_PDE_VALID;
}
- MakeKernelPageReadOnly(pvPDCpuVAddr);
if(!psDevInfo->pvMMUContextList)
{
+
-
- MakeKernelPageReadWrite(psDevInfo->pvDummyPTPageCpuVAddr);
pui32Tmp = (IMG_UINT32 *)psDevInfo->pvDummyPTPageCpuVAddr;
for(i=0; i<SGX_MMU_PT_SIZE; i++)
{
pui32Tmp[i] = (psDevInfo->sDummyDataDevPAddr.uiAddr>>SGX_MMU_PTE_ADDR_ALIGNSHIFT)
| SGX_MMU_PTE_VALID;
}
- MakeKernelPageReadOnly(psDevInfo->pvDummyPTPageCpuVAddr);
-
+
PDUMPCOMMENT("Dummy Page table contents");
PDUMPMEMPTENTRIES(&sMMUAttrib, psDevInfo->hDummyPTOSMemHandle, psDevInfo->pvDummyPTPageCpuVAddr, SGX_MMU_PAGE_SIZE, 0, IMG_TRUE, PDUMP_PD_UNIQUETAG, PDUMP_PT_UNIQUETAG);
+
-
- MakeKernelPageReadWrite(psDevInfo->pvDummyDataPageCpuVAddr);
pui32Tmp = (IMG_UINT32 *)psDevInfo->pvDummyDataPageCpuVAddr;
for(i=0; i<(SGX_MMU_PAGE_SIZE/4); i++)
{
pui32Tmp[i] = DUMMY_DATA_PAGE_SIGNATURE;
}
- MakeKernelPageReadOnly(psDevInfo->pvDummyDataPageCpuVAddr);
-
+
PDUMPCOMMENT("Dummy Data Page contents");
PDUMPMEMPTENTRIES(PVRSRV_DEVICE_TYPE_SGX, psDevInfo->hDummyDataPageOSMemHandle, psDevInfo->pvDummyDataPageCpuVAddr, SGX_MMU_PAGE_SIZE, 0, IMG_TRUE, PDUMP_PD_UNIQUETAG, PDUMP_PT_UNIQUETAG);
}
-#else
-
- MakeKernelPageReadWrite(pvPDCpuVAddr);
+#else
+
for(i=0; i<SGX_MMU_PD_SIZE; i++)
{
-
+
pui32Tmp[i] = 0;
}
- MakeKernelPageReadOnly(pvPDCpuVAddr);
-#endif
+#endif
#if defined(PDUMP)
#if defined(SUPPORT_PDUMP_MULTI_PROCESS)
if(psMMUContext->bPDumpActive)
-#endif
+#endif
{
-
+
PDUMPCOMMENT("Page directory contents");
PDUMPPDENTRIES(&sMMUAttrib, hPDOSMemHandle, pvPDCpuVAddr, SGX_MMU_PAGE_SIZE, 0, IMG_TRUE, PDUMP_PD_UNIQUETAG, PDUMP_PT_UNIQUETAG);
}
PDUMPCOMMENT("BRN31620 Set up dummy PT");
- MakeKernelPageReadWrite(psDevInfo->pvBRN31620DummyPTCpuVAddr);
pui32PT = (IMG_UINT32 *) psDevInfo->pvBRN31620DummyPTCpuVAddr;
pui32PT[BRN31620_DUMMY_PTE_INDEX] = (psDevInfo->sBRN31620DummyPageDevPAddr.uiAddr>>SGX_MMU_PTE_ADDR_ALIGNSHIFT)
| SGX_MMU_PTE_DUMMY_PAGE
| SGX_MMU_PTE_READONLY
| SGX_MMU_PTE_VALID;
- MakeKernelPageReadOnly(psDevInfo->pvBRN31620DummyPTCpuVAddr);
-#if defined(PDUMP)
+#if defined(PDUMP)
+
PDUMPCOMMENT("BRN31620 Dump dummy PT contents");
PDUMPMEMPTENTRIES(&sMMUAttrib, psDevInfo->hBRN31620DummyPTOSMemHandle, psDevInfo->pvBRN31620DummyPTCpuVAddr, SGX_MMU_PAGE_SIZE, 0, IMG_TRUE, PDUMP_PD_UNIQUETAG, PDUMP_PT_UNIQUETAG);
PDUMPCOMMENT("BRN31620 Dump dummy page contents");
PDUMPMEMPTENTRIES(&sMMUAttrib, psDevInfo->hBRN31620DummyPageOSMemHandle, psDevInfo->pvBRN31620DummyPageCpuVAddr, SGX_MMU_PAGE_SIZE, 0, IMG_TRUE, PDUMP_PD_UNIQUETAG, PDUMP_PT_UNIQUETAG);
-
+
for(i=0;i<SGX_MMU_PT_SIZE;i++)
{
PDUMPMEMPTENTRIES(&sMMUAttrib, psDevInfo->hBRN31620DummyPTOSMemHandle, &pui32PT[i], sizeof(IMG_UINT32), 0, IMG_FALSE, PDUMP_PD_UNIQUETAG, PDUMP_PT_UNIQUETAG);
}
#endif
PDUMPCOMMENT("BRN31620 Dump PDE wire up");
-
+
for(i=0;i<SGX_MMU_PD_SIZE;i++)
{
pui32Tmp[i] = 0;
if (ui32PDCount == BRN31620_DUMMY_PDE_INDEX)
{
- MakeKernelPageReadWrite(pvPDCpuVAddr);
pui32Tmp[i] = (psDevInfo->sBRN31620DummyPTDevPAddr.uiAddr>>SGX_MMU_PDE_ADDR_ALIGNSHIFT)
| SGX_MMU_PDE_PAGE_SIZE_4K
| SGX_MMU_PDE_DUMMY_PAGE
| SGX_MMU_PDE_VALID;
- MakeKernelPageReadOnly(pvPDCpuVAddr);
}
PDUMPMEMPTENTRIES(&sMMUAttrib, hPDOSMemHandle, (IMG_VOID *) &pui32Tmp[i], sizeof(IMG_UINT32), 0, IMG_FALSE, PDUMP_PT_UNIQUETAG, PDUMP_PT_UNIQUETAG);
ui32PDCount++;
if (ui32PDCount == BRN31620_PDES_PER_CACHE_LINE_SIZE)
{
-
+
ui32PDCount = 0;
}
}
-
+
PDUMPCOMMENT("BRN31620 dummy Page table contents");
PDUMPMEMPTENTRIES(&sMMUAttrib, psDevInfo->hBRN31620DummyPageOSMemHandle, psDevInfo->pvBRN31620DummyPageCpuVAddr, SGX_MMU_PAGE_SIZE, 0, IMG_TRUE, PDUMP_PD_UNIQUETAG, PDUMP_PT_UNIQUETAG);
}
#endif
#if defined(PDUMP)
-
+
{
PVRSRV_ERROR eError;
-
+
IMG_UINT32 ui32MMUType = 1;
#if defined(SGX_FEATURE_36BIT_MMU)
}
}
-
+
PDUMPCOMMENT("Set MMU context complete (MMU Context ID == %u)", psMMUContext->ui32PDumpMMUContextID);
#endif
psMMUContext->apsPTInfoListSave[i] = IMG_NULL;
}
#endif
-
+
psMMUContext->pvPDCpuVAddr = pvPDCpuVAddr;
psMMUContext->sPDDevPAddr = sPDDevPAddr;
psMMUContext->hPDOSMemHandle = hPDOSMemHandle;
-
+
*ppsMMUContext = psMMUContext;
-
+
*psPDDevPAddr = sPDDevPAddr;
-
+
psMMUContext->psNext = (MMU_CONTEXT*)psDevInfo->pvMMUContextList;
psDevInfo->pvMMUContextList = (IMG_VOID*)psMMUContext;
SysAcquireData(&psSysData);
#if defined(PDUMP)
-
+
PDUMPCOMMENT("Clear MMU context (MMU Context ID == %u)", psMMUContext->ui32PDumpMMUContextID);
PDUMPCLEARMMUCONTEXT(PVRSRV_DEVICE_TYPE_SGX, psMMUContext->psDeviceNode->sDevId.pszPDumpDevName, psMMUContext->ui32PDumpMMUContextID, 2);
-
+
#if IMG_ADDRSPACE_PHYSADDR_BITS == 32
PDUMPCOMMENT("Free page directory (PDDevPAddr == 0x%08x)",
psMMUContext->sPDDevPAddr.uiAddr);
PDUMPCOMMENT("Free page directory, 64-bit arch detected (PDDevPAddr == 0x%08x%08x)",
psMMUContext->sPDDevPAddr.uiHighAddr, psMMUContext->sPDDevPAddr.uiAddr);
#endif
-#endif
+#endif
PDUMPFREEPAGETABLE(&psMMUContext->psDeviceNode->sDevId, psMMUContext->hPDOSMemHandle, psMMUContext->pvPDCpuVAddr, SGX_MMU_PAGE_SIZE, 0, PDUMP_PT_UNIQUETAG);
#if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
pui32Tmp = (IMG_UINT32 *)psMMUContext->pvPDCpuVAddr;
- MakeKernelPageReadWrite(psMMUContext->pvPDCpuVAddr);
-
+
for(i=0; i<SGX_MMU_PD_SIZE; i++)
{
-
+
pui32Tmp[i] = 0;
}
- MakeKernelPageReadOnly(psMMUContext->pvPDCpuVAddr);
-
+
psMMUContext->hPDOSMemHandle);
#if defined(FIX_HW_BRN_31620)
-
+
if (!psMMUContextList->psNext)
{
PDUMPFREEPAGETABLE(&psMMUContext->psDeviceNode->sDevId, psDevInfo->hBRN31620DummyPageOSMemHandle, psDevInfo->pvBRN31620DummyPageCpuVAddr, SGX_MMU_PAGE_SIZE, 0, PDUMP_PT_UNIQUETAG);
SGX_MMU_PAGE_SIZE,
psDevInfo->pvBRN31620DummyPTCpuVAddr,
psDevInfo->hBRN31620DummyPTOSMemHandle);
-
+
}
#endif
#if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
-
+
if(!psMMUContextList->psNext)
{
OSFreePages(PVRSRV_HAP_WRITECOMBINE | PVRSRV_HAP_KERNEL_ONLY,
IMG_SYS_PHYADDR sSysPAddr;
IMG_CPU_PHYADDR sCpuPAddr;
-
+
sCpuPAddr = OSMapLinToCPUPhys(psMMUContext->hPDOSMemHandle,
psMMUContext->pvPDCpuVAddr);
sSysPAddr = SysCpuPAddrToSysPAddr(sCpuPAddr);
-
+
OSUnMapPhysToLin(psMMUContext->pvPDCpuVAddr,
SGX_MMU_PAGE_SIZE,
PVRSRV_HAP_WRITECOMBINE|PVRSRV_HAP_KERNEL_ONLY,
psMMUContext->hPDOSMemHandle);
-
+
RA_Free (psMMUContext->psDeviceNode->psLocalDevMemArena, sSysPAddr.uiAddr, IMG_FALSE);
#if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
-
+
if(!psMMUContextList->psNext)
{
-
+
sCpuPAddr = OSMapLinToCPUPhys(psDevInfo->hDummyPTPageOSMemHandle,
psDevInfo->pvDummyPTPageCpuVAddr);
sSysPAddr = SysCpuPAddrToSysPAddr(sCpuPAddr);
-
+
OSUnMapPhysToLin(psDevInfo->pvDummyPTPageCpuVAddr,
SGX_MMU_PAGE_SIZE,
PVRSRV_HAP_WRITECOMBINE|PVRSRV_HAP_KERNEL_ONLY,
psDevInfo->hDummyPTPageOSMemHandle);
-
+
RA_Free (psMMUContext->psDeviceNode->psLocalDevMemArena, sSysPAddr.uiAddr, IMG_FALSE);
-
+
sCpuPAddr = OSMapLinToCPUPhys(psDevInfo->hDummyDataPageOSMemHandle,
psDevInfo->pvDummyDataPageCpuVAddr);
sSysPAddr = SysCpuPAddrToSysPAddr(sCpuPAddr);
-
+
OSUnMapPhysToLin(psDevInfo->pvDummyDataPageCpuVAddr,
SGX_MMU_PAGE_SIZE,
PVRSRV_HAP_WRITECOMBINE|PVRSRV_HAP_KERNEL_ONLY,
psDevInfo->hDummyDataPageOSMemHandle);
-
+
RA_Free (psMMUContext->psDeviceNode->psLocalDevMemArena, sSysPAddr.uiAddr, IMG_FALSE);
}
#endif
#if defined(FIX_HW_BRN_31620)
-
+
if(!psMMUContextList->psNext)
{
-
+
PDUMPFREEPAGETABLE(&psMMUContext->psDeviceNode->sDevId, psDevInfo->hBRN31620DummyPageOSMemHandle, psDevInfo->pvBRN31620DummyPageCpuVAddr, SGX_MMU_PAGE_SIZE, 0, PDUMP_PT_UNIQUETAG);
sCpuPAddr = OSMapLinToCPUPhys(psDevInfo->hBRN31620DummyPageOSMemHandle,
psDevInfo->pvBRN31620DummyPageCpuVAddr);
sSysPAddr = SysCpuPAddrToSysPAddr(sCpuPAddr);
-
+
OSUnMapPhysToLin(psDevInfo->pvBRN31620DummyPageCpuVAddr,
SGX_MMU_PAGE_SIZE,
PVRSRV_HAP_WRITECOMBINE|PVRSRV_HAP_KERNEL_ONLY,
psDevInfo->hBRN31620DummyPageOSMemHandle);
-
+
RA_Free (psMMUContext->psDeviceNode->psLocalDevMemArena, sSysPAddr.uiAddr, IMG_FALSE);
-
+
PDUMPFREEPAGETABLE(&psMMUContext->psDeviceNode->sDevId, psDevInfo->hBRN31620DummyPTOSMemHandle, psDevInfo->pvBRN31620DummyPTCpuVAddr, SGX_MMU_PAGE_SIZE, 0, PDUMP_PT_UNIQUETAG);
sCpuPAddr = OSMapLinToCPUPhys(psDevInfo->hBRN31620DummyPTOSMemHandle,
psDevInfo->pvBRN31620DummyPTCpuVAddr);
sSysPAddr = SysCpuPAddrToSysPAddr(sCpuPAddr);
-
+
OSUnMapPhysToLin(psDevInfo->pvBRN31620DummyPTCpuVAddr,
SGX_MMU_PAGE_SIZE,
PVRSRV_HAP_WRITECOMBINE|PVRSRV_HAP_KERNEL_ONLY,
psDevInfo->hBRN31620DummyPTOSMemHandle);
-
+
RA_Free (psMMUContext->psDeviceNode->psLocalDevMemArena, sSysPAddr.uiAddr, IMG_FALSE);
}
#endif
PVR_DPF ((PVR_DBG_MESSAGE, "MMU_Finalise"));
-
+
ppsMMUContext = (MMU_CONTEXT**)&psMMUContext->psDevInfo->pvMMUContextList;
while(*ppsMMUContext)
{
if(*ppsMMUContext == psMMUContext)
{
-
+
*ppsMMUContext = psMMUContext->psNext;
break;
}
-
+
ppsMMUContext = &((*ppsMMUContext)->psNext);
}
-
+
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(MMU_CONTEXT), psMMUContext, IMG_NULL);
-
+
}
IMG_BOOL bInvalidateDirectoryCache = IMG_FALSE;
#endif
-
+
pui32PDCpuVAddr += psMMUHeap->psDevArena->BaseDevVAddr.uiAddr >> psMMUHeap->ui32PDShift;
pui32KernelPDCpuVAddr += psMMUHeap->psDevArena->BaseDevVAddr.uiAddr >> psMMUHeap->ui32PDShift;
-
+
#if defined(PDUMP)
psMMUHeap->psMMUContext->ui32PDumpMMUContextID,
psMMUHeap->ui32PageTableCount);
PDUMPCOMMENT(" (Destination MMU Context ID == %u)", psMMUContext->ui32PDumpMMUContextID);
-#endif
+#endif
#ifdef SUPPORT_SGX_MMU_BYPASS
EnableHostAccess(psMMUContext);
#endif
for (ui32PDEntry = 0; ui32PDEntry < psMMUHeap->ui32PageTableCount; ui32PDEntry++)
{
#if (!defined(SUPPORT_SGX_MMU_DUMMY_PAGE)) && (!defined(FIX_HW_BRN_31620))
-
+
PVR_ASSERT(pui32PDCpuVAddr[ui32PDEntry] == 0);
#endif
- MakeKernelPageReadWrite(psMMUContext->pvPDCpuVAddr);
+
pui32PDCpuVAddr[ui32PDEntry] = pui32KernelPDCpuVAddr[ui32PDEntry];
- MakeKernelPageReadOnly(psMMUContext->pvPDCpuVAddr);
if (pui32PDCpuVAddr[ui32PDEntry])
{
-
+
#if defined(PDUMP)
-
+
#if defined(SUPPORT_PDUMP_MULTI_PROCESS)
if(psMMUContext->bPDumpActive)
- #endif
+ #endif
{
PDUMPPDENTRIES(&psMMUHeap->sMMUAttrib, psMMUContext->hPDOSMemHandle, (IMG_VOID *) &pui32PDCpuVAddr[ui32PDEntry], sizeof(IMG_UINT32), 0, IMG_FALSE, PDUMP_PD_UNIQUETAG, PDUMP_PT_UNIQUETAG);
}
#if !defined(SGX_FEATURE_MULTIPLE_MEM_CONTEXTS)
if (bInvalidateDirectoryCache)
{
-
+
#if !defined (PDUMP)
PVR_UNREFERENCED_PARAMETER(hUniqueTag);
#endif
-
+
sTmpDevVAddr = sDevVAddr;
for(i=0; i<ui32PageCount; i++)
{
MMU_PT_INFO **ppsPTInfoList;
-
+
ui32PDIndex = sTmpDevVAddr.uiAddr >> psMMUHeap->ui32PDShift;
-
+
ppsPTInfoList = &psMMUHeap->psMMUContext->apsPTInfoList[ui32PDIndex];
{
-
+
ui32PTIndex = (sTmpDevVAddr.uiAddr & psMMUHeap->ui32PTMask) >> psMMUHeap->ui32PTShift;
-
+
if (!ppsPTInfoList[0])
{
PVR_DPF((PVR_DBG_MESSAGE, "MMU_UnmapPagesAndFreePTs: Invalid PT for alloc at VAddr:0x%08X (VaddrIni:0x%08X AllocPage:%u) PDIdx:%u PTIdx:%u",sTmpDevVAddr.uiAddr, sDevVAddr.uiAddr,i, ui32PDIndex, ui32PTIndex ));
-
+
sTmpDevVAddr.uiAddr += psMMUHeap->ui32DataPageSize;
-
+
continue;
}
-
+
pui32Tmp = (IMG_UINT32*)ppsPTInfoList[0]->PTPageCpuVAddr;
-
+
if (!pui32Tmp)
{
continue;
CheckPT(ppsPTInfoList[0]);
-
+
if (pui32Tmp[ui32PTIndex] & SGX_MMU_PTE_VALID)
{
ppsPTInfoList[0]->ui32ValidPTECount--;
PVR_DPF((PVR_DBG_MESSAGE, "MMU_UnmapPagesAndFreePTs: Page is already invalid for alloc at VAddr:0x%08X (VAddrIni:0x%08X AllocPage:%u) PDIdx:%u PTIdx:%u",sTmpDevVAddr.uiAddr, sDevVAddr.uiAddr,i, ui32PDIndex, ui32PTIndex ));
}
-
+
PVR_ASSERT((IMG_INT32)ppsPTInfoList[0]->ui32ValidPTECount >= 0);
- MakeKernelPageReadWrite(ppsPTInfoList[0]->PTPageCpuVAddr);
-#if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
+#if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
+
pui32Tmp[ui32PTIndex] = (psMMUHeap->psMMUContext->psDevInfo->sDummyDataDevPAddr.uiAddr>>SGX_MMU_PTE_ADDR_ALIGNSHIFT)
| SGX_MMU_PTE_VALID;
#else
-
+
#if defined(FIX_HW_BRN_31620)
BRN31620InvalidatePageTableEntry(psMMUHeap->psMMUContext, ui32PDIndex, ui32PTIndex, &pui32Tmp[ui32PTIndex]);
#else
pui32Tmp[ui32PTIndex] = 0;
#endif
#endif
- MakeKernelPageReadOnly(ppsPTInfoList[0]->PTPageCpuVAddr);
+
CheckPT(ppsPTInfoList[0]);
}
-
+
if (ppsPTInfoList[0] && (ppsPTInfoList[0]->ui32ValidPTECount == 0)
)
#endif
}
-
+
sTmpDevVAddr.uiAddr += psMMUHeap->ui32DataPageSize;
}
psMMUHeap->ui32DataPageSize * ui32PageCount,
IMG_TRUE,
hUniqueTag);
-#endif
+#endif
}
pMMUHeap->psMMUContext = psMMUContext;
pMMUHeap->psDevArena = psDevArena;
-
+
switch(pMMUHeap->psDevArena->ui32DataPageSize)
ui32ScaleSize = 10;
pMMUHeap->ui32PDEPageSizeCtrl = SGX_MMU_PDE_PAGE_SIZE_4M;
break;
-#endif
+#endif
default:
PVR_DPF((PVR_DBG_ERROR, "MMU_Create: invalid data page size"));
goto ErrorFreeHeap;
}
-
+
pMMUHeap->ui32DataPageSize = psDevArena->ui32DataPageSize;
pMMUHeap->ui32DataPageBitWidth = SGX_MMU_PAGE_SHIFT + ui32ScaleSize;
pMMUHeap->ui32DataPageMask = pMMUHeap->ui32DataPageSize - 1;
-
+
pMMUHeap->ui32PTShift = pMMUHeap->ui32DataPageBitWidth;
pMMUHeap->ui32PTBitWidth = SGX_MMU_PT_SHIFT - ui32ScaleSize;
pMMUHeap->ui32PTMask = SGX_MMU_PT_MASK & (SGX_MMU_PT_MASK<<ui32ScaleSize);
pMMUHeap->ui32PTSize = (IMG_UINT32)(1UL<<pMMUHeap->ui32PTBitWidth) * sizeof(IMG_UINT32);
-
+
if(pMMUHeap->ui32PTSize < 4 * sizeof(IMG_UINT32))
{
pMMUHeap->ui32PTSize = 4 * sizeof(IMG_UINT32);
}
pMMUHeap->ui32PTNumEntriesAllocated = pMMUHeap->ui32PTSize >> 2;
-
+
pMMUHeap->ui32PTNumEntriesUsable = (IMG_UINT32)(1UL << pMMUHeap->ui32PTBitWidth);
-
+
pMMUHeap->ui32PDShift = pMMUHeap->ui32PTBitWidth + pMMUHeap->ui32PTShift;
pMMUHeap->ui32PDBitWidth = SGX_FEATURE_ADDRESS_SPACE_SIZE - pMMUHeap->ui32PTBitWidth - pMMUHeap->ui32DataPageBitWidth;
pMMUHeap->ui32PDMask = SGX_MMU_PD_MASK & (SGX_MMU_PD_MASK>>(32-SGX_FEATURE_ADDRESS_SPACE_SIZE));
-
+
#if !defined (SUPPORT_EXTERNAL_SYSTEM_CACHE)
-
+
if(psDevArena->BaseDevVAddr.uiAddr > (pMMUHeap->ui32DataPageMask | pMMUHeap->ui32PTMask))
{
-
+
PVR_ASSERT ((psDevArena->BaseDevVAddr.uiAddr
| pMMUHeap->ui32PTMask)) == 0);
}
#endif
-
+
pMMUHeap->ui32PTETotalUsable = pMMUHeap->psDevArena->ui32Size >> pMMUHeap->ui32PTShift;
-
+
pMMUHeap->ui32PDBaseIndex = (pMMUHeap->psDevArena->BaseDevVAddr.uiAddr & pMMUHeap->ui32PDMask) >> pMMUHeap->ui32PDShift;
-
+
pMMUHeap->ui32PageTableCount = (pMMUHeap->ui32PTETotalUsable + pMMUHeap->ui32PTNumEntriesUsable - 1)
>> pMMUHeap->ui32PTBitWidth;
PVR_ASSERT(pMMUHeap->ui32PageTableCount > 0);
-
+
pMMUHeap->psVMArena = RA_Create(psDevArena->pszName,
psDevArena->BaseDevVAddr.uiAddr,
psDevArena->ui32Size,
}
#if defined(PDUMP)
-
+
MMU_SetPDumpAttribs(&pMMUHeap->sMMUAttrib,
psMMUContext->psDeviceNode,
pMMUHeap->ui32DataPageMask,
psDevArena->ui32Size,
pMMUHeap->ui32DataPageSize,
psDevArena->BaseDevVAddr.uiAddr);
-#endif
-
-#if 0
+#endif
+#if 0
+
if(psDevArena->ui32HeapID == SGX_TILED_HEAP_ID)
{
IMG_UINT32 ui32RegVal;
IMG_UINT32 ui32XTileStride;
-
+
}
#endif
-
+
*ppsVMArena = pMMUHeap->psVMArena;
return pMMUHeap;
-
+
ErrorFreePagetables:
_DeferredFreePageTables (pMMUHeap);
ErrorFreeHeap:
OSFreeMem (PVRSRV_OS_PAGEABLE_HEAP, sizeof(MMU_HEAP), pMMUHeap, IMG_NULL);
-
+
return IMG_NULL;
}
pMMUHeap->psDevArena->pszName,
pMMUHeap->psDevArena->BaseDevVAddr.uiAddr,
pMMUHeap->ui32PageTableCount);
-#endif
+#endif
#ifdef SUPPORT_SGX_MMU_BYPASS
EnableHostAccess(pMMUHeap->psMMUContext);
#endif
OSFreeMem (PVRSRV_OS_PAGEABLE_HEAP, sizeof(MMU_HEAP), pMMUHeap, IMG_NULL);
-
+
}
}
"MMU_Alloc: uSize=0x%x, flags=0x%x, align=0x%x",
uSize, uFlags, uDevVAddrAlignment));
-
+
if((uFlags & PVRSRV_MEM_USER_SUPPLIED_DEVVADDR) == 0)
{
EnableHostAccess(pMMUHeap->psMMUContext);
#endif
-
+
bStatus = _DeferredAllocPagetables(pMMUHeap, *psDevVAddr, (IMG_UINT32)uSize);
#ifdef SUPPORT_SGX_MMU_BYPASS
pMMUHeap->psDevArena->ui32HeapID));
if((uFlags & PVRSRV_MEM_USER_SUPPLIED_DEVVADDR) == 0)
{
-
+
RA_Free (pMMUHeap->psVMArena, psDevVAddr->uiAddr, IMG_FALSE);
}
}
MMU_Enable (MMU_HEAP *pMMUHeap)
{
PVR_UNREFERENCED_PARAMETER(pMMUHeap);
-
+
}
IMG_VOID
MMU_Disable (MMU_HEAP *pMMUHeap)
{
PVR_UNREFERENCED_PARAMETER(pMMUHeap);
-
+
}
#if defined(FIX_HW_BRN_31620)
{
pui32RangeMask[i] = pMMUContext->ui32PDChangeMask[i];
-
+
pMMUContext->ui32PDChangeMask[i] = 0;
}
}
IMG_UINT32 ui32PDIndex;
IMG_UINT32 ui32PTDumpCount;
-
+
ui32NumPTEntries = (IMG_UINT32)((uSize + pMMUHeap->ui32DataPageMask) >> pMMUHeap->ui32PTShift);
-
+
ui32PDIndex = DevVAddr.uiAddr >> pMMUHeap->ui32PDShift;
-
+
ppsPTInfoList = &pMMUHeap->psMMUContext->apsPTInfoList[ui32PDIndex];
-
+
ui32PTIndex = (DevVAddr.uiAddr & pMMUHeap->ui32PTMask) >> pMMUHeap->ui32PTShift;
-
+
PDUMPCOMMENT("Page table mods (num entries == %08X) %s", ui32NumPTEntries, bForUnmap ? "(for unmap)" : "");
-
+
while(ui32NumPTEntries > 0)
{
MMU_PT_INFO* psPTInfo = *ppsPTInfoList++;
PDUMPMEMPTENTRIES(&pMMUHeap->sMMUAttrib, psPTInfo->hPTPageOSMemHandle, (IMG_VOID *) &pui32PTEntry[ui32PTIndex], ui32PTDumpCount * sizeof(IMG_UINT32), ui32Flags, IMG_FALSE, PDUMP_PT_UNIQUETAG, hUniqueTag);
}
-
+
ui32NumPTEntries -= ui32PTDumpCount;
-
+
ui32PTIndex = 0;
}
PDUMPCOMMENT("Finished page table mods %s", bForUnmap ? "(for unmap)" : "");
}
-#endif
+#endif
static IMG_VOID
IMG_UINT32 ui32MMUFlags = 0;
MMU_PT_INFO **ppsPTInfoList;
-
+
PVR_ASSERT((DevPAddr.uiAddr & pMMUHeap->ui32DataPageMask) == 0);
-
+
if(((PVRSRV_MEM_READ|PVRSRV_MEM_WRITE) & ui32MemFlags) == (PVRSRV_MEM_READ|PVRSRV_MEM_WRITE))
{
-
+
ui32MMUFlags = 0;
}
else if(PVRSRV_MEM_READ & ui32MemFlags)
{
-
+
ui32MMUFlags |= SGX_MMU_PTE_READONLY;
}
else if(PVRSRV_MEM_WRITE & ui32MemFlags)
{
-
+
ui32MMUFlags |= SGX_MMU_PTE_WRITEONLY;
}
-
+
if(PVRSRV_MEM_CACHE_CONSISTENT & ui32MemFlags)
{
ui32MMUFlags |= SGX_MMU_PTE_CACHECONSISTENT;
}
#if !defined(FIX_HW_BRN_25503)
-
+
if(PVRSRV_MEM_EDM_PROTECT & ui32MemFlags)
{
ui32MMUFlags |= SGX_MMU_PTE_EDMPROTECT;
}
#endif
+
-
-
+
ui32Index = DevVAddr.uiAddr >> pMMUHeap->ui32PDShift;
-
+
ppsPTInfoList = &pMMUHeap->psMMUContext->apsPTInfoList[ui32Index];
CheckPT(ppsPTInfoList[0]);
-
+
ui32Index = (DevVAddr.uiAddr & pMMUHeap->ui32PTMask) >> pMMUHeap->ui32PTShift;
-
+
pui32Tmp = (IMG_UINT32*)ppsPTInfoList[0]->PTPageCpuVAddr;
#if !defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
{
IMG_UINT32 uTmp = pui32Tmp[ui32Index];
-
-
+
+
#if defined(FIX_HW_BRN_31620)
if ((uTmp & SGX_MMU_PTE_VALID) && ((DevVAddr.uiAddr & BRN31620_PDE_CACHE_FILL_MASK) != BRN31620_DUMMY_PAGE_OFFSET))
#else
}
#endif
-
+
ppsPTInfoList[0]->ui32ValidPTECount++;
- MakeKernelPageReadWrite(ppsPTInfoList[0]->PTPageCpuVAddr);
-
+
pui32Tmp[ui32Index] = ((DevPAddr.uiAddr>>SGX_MMU_PTE_ADDR_ALIGNSHIFT)
& ((~pMMUHeap->ui32DataPageMask)>>SGX_MMU_PTE_ADDR_ALIGNSHIFT))
| SGX_MMU_PTE_VALID
| ui32MMUFlags;
- MakeKernelPageReadOnly(ppsPTInfoList[0]->PTPageCpuVAddr);
+
CheckPT(ppsPTInfoList[0]);
}
{
#if defined(PDUMP)
IMG_DEV_VIRTADDR MapBaseDevVAddr;
-#endif
+#endif
IMG_UINT32 uCount, i;
IMG_DEV_PHYADDR DevPAddr;
MapBaseDevVAddr = DevVAddr;
#else
PVR_UNREFERENCED_PARAMETER(hUniqueTag);
-#endif
+#endif
for (i=0, uCount=0; uCount<uSize; i++, uCount+=pMMUHeap->ui32DataPageSize)
{
sSysAddr = psSysAddr[i];
-
+
PVR_ASSERT((sSysAddr.uiAddr & pMMUHeap->ui32DataPageMask) == 0);
DevPAddr = SysSysPAddrToDevPAddr(PVRSRV_DEVICE_TYPE_SGX, sSysAddr);
#if defined(PDUMP)
MMU_PDumpPageTables (pMMUHeap, MapBaseDevVAddr, uSize, IMG_FALSE, hUniqueTag);
-#endif
+#endif
}
IMG_VOID
IMG_DEV_PHYADDR DevPAddr;
#if defined(PDUMP)
IMG_DEV_VIRTADDR MapBaseDevVAddr;
-#endif
+#endif
IMG_UINT32 uCount;
IMG_UINT32 ui32VAdvance;
IMG_UINT32 ui32PAdvance;
PVR_DPF ((PVR_DBG_MESSAGE, "MMU_MapPages: heap:%s, heap_id:%d devVAddr=%08X, SysPAddr=%08X, size=0x%x",
pMMUHeap->psDevArena->pszName,
pMMUHeap->psDevArena->ui32HeapID,
- DevVAddr.uiAddr,
+ DevVAddr.uiAddr,
SysPAddr.uiAddr,
uSize));
-
+
ui32VAdvance = pMMUHeap->ui32DataPageSize;
ui32PAdvance = pMMUHeap->ui32DataPageSize;
MapBaseDevVAddr = DevVAddr;
#else
PVR_UNREFERENCED_PARAMETER(hUniqueTag);
-#endif
+#endif
DevPAddr = SysSysPAddrToDevPAddr(PVRSRV_DEVICE_TYPE_SGX, SysPAddr);
-
+
PVR_ASSERT((DevPAddr.uiAddr & pMMUHeap->ui32DataPageMask) == 0);
#if defined(FIX_HW_BRN_23281)
}
#endif
-
+
if(ui32MemFlags & PVRSRV_MEM_DUMMY)
#if defined(PDUMP)
MMU_PDumpPageTables (pMMUHeap, MapBaseDevVAddr, uSize, IMG_FALSE, hUniqueTag);
-#endif
+#endif
}
IMG_VOID
uByteSize,
(IMG_UINTPTR_T)CpuVAddr));
-
+
ui32VAdvance = pMMUHeap->ui32DataPageSize;
ui32PAdvance = pMMUHeap->ui32DataPageSize;
-
+
PVR_ASSERT(((IMG_UINTPTR_T)CpuVAddr & (SGX_MMU_PAGE_SIZE - 1)) == 0);
PVR_ASSERT(((IMG_UINT32)uByteSize & pMMUHeap->ui32DataPageMask) == 0);
pDevVAddr->uiAddr = MapBaseDevVAddr.uiAddr;
}
#endif
-
+
if(ui32MemFlags & PVRSRV_MEM_DUMMY)
ui32PAdvance = 0;
}
-
+
MapDevVAddr = MapBaseDevVAddr;
for (i=0; i<uByteSize; i+=ui32VAdvance)
{
}
DevPAddr = SysCpuPAddrToDevPAddr (PVRSRV_DEVICE_TYPE_SGX, CpuPAddr);
-
+
PVR_ASSERT((DevPAddr.uiAddr & pMMUHeap->ui32DataPageMask) == 0);
PVR_DPF ((PVR_DBG_MESSAGE,
MMU_MapPage (pMMUHeap, MapDevVAddr, DevPAddr, ui32MemFlags);
-
+
MapDevVAddr.uiAddr += ui32VAdvance;
uOffset += ui32PAdvance;
}
#if defined(PDUMP)
MMU_PDumpPageTables (pMMUHeap, MapBaseDevVAddr, uByteSize, IMG_FALSE, hUniqueTag);
-#endif
+#endif
}
PVR_UNREFERENCED_PARAMETER(hUniqueTag);
#endif
-
+
sTmpDevVAddr = sDevVAddr;
for(i=0; i<ui32PageCount; i++)
{
MMU_PT_INFO **ppsPTInfoList;
-
+
ui32PDIndex = sTmpDevVAddr.uiAddr >> psMMUHeap->ui32PDShift;
-
+
ppsPTInfoList = &psMMUHeap->psMMUContext->apsPTInfoList[ui32PDIndex];
-
+
ui32PTIndex = (sTmpDevVAddr.uiAddr & psMMUHeap->ui32PTMask) >> psMMUHeap->ui32PTShift;
-
+
if (!ppsPTInfoList[0])
{
PVR_DPF((PVR_DBG_ERROR, "MMU_UnmapPages: ERROR Invalid PT for alloc at VAddr:0x%08X (VaddrIni:0x%08X AllocPage:%u) PDIdx:%u PTIdx:%u",
ui32PDIndex,
ui32PTIndex));
-
+
sTmpDevVAddr.uiAddr += uPageSize;
-
+
continue;
}
CheckPT(ppsPTInfoList[0]);
-
+
pui32Tmp = (IMG_UINT32*)ppsPTInfoList[0]->PTPageCpuVAddr;
-
+
if (pui32Tmp[ui32PTIndex] & SGX_MMU_PTE_VALID)
{
ppsPTInfoList[0]->ui32ValidPTECount--;
PVR_DPF((PVR_DBG_ERROR, "MMU_UnmapPages: Page table entry value: 0x%08X", pui32Tmp[ui32PTIndex]));
}
-
+
PVR_ASSERT((IMG_INT32)ppsPTInfoList[0]->ui32ValidPTECount >= 0);
- MakeKernelPageReadWrite(ppsPTInfoList[0]->PTPageCpuVAddr);
#if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
-
+
pui32Tmp[ui32PTIndex] = (psMMUHeap->psMMUContext->psDevInfo->sDummyDataDevPAddr.uiAddr>>SGX_MMU_PTE_ADDR_ALIGNSHIFT)
| SGX_MMU_PTE_VALID;
#else
-
+
#if defined(FIX_HW_BRN_31620)
BRN31620InvalidatePageTableEntry(psMMUHeap->psMMUContext, ui32PDIndex, ui32PTIndex, &pui32Tmp[ui32PTIndex]);
#else
pui32Tmp[ui32PTIndex] = 0;
#endif
#endif
- MakeKernelPageReadOnly(ppsPTInfoList[0]->PTPageCpuVAddr);
CheckPT(ppsPTInfoList[0]);
-
+
sTmpDevVAddr.uiAddr += uPageSize;
}
#if defined(PDUMP)
MMU_PDumpPageTables (psMMUHeap, sDevVAddr, uPageSize*ui32PageCount, IMG_TRUE, hUniqueTag);
-#endif
+#endif
}
IMG_DEV_PHYADDR sDevPAddr;
MMU_PT_INFO **ppsPTInfoList;
-
+
ui32Index = sDevVPageAddr.uiAddr >> pMMUHeap->ui32PDShift;
-
+
ppsPTInfoList = &pMMUHeap->psMMUContext->apsPTInfoList[ui32Index];
if (!ppsPTInfoList[0])
{
return sDevPAddr;
}
-
+
ui32Index = (sDevVPageAddr.uiAddr & pMMUHeap->ui32PTMask) >> pMMUHeap->ui32PTShift;
-
+
pui32PageTable = (IMG_UINT32*)ppsPTInfoList[0]->PTPageCpuVAddr;
-
+
sDevPAddr.uiAddr = pui32PageTable[ui32Index];
-
+
sDevPAddr.uiAddr &= ~(pMMUHeap->ui32DataPageMask>>SGX_MMU_PTE_ADDR_ALIGNSHIFT);
-
+
sDevPAddr.uiAddr <<= SGX_MMU_PTE_ADDR_ALIGNSHIFT;
return sDevPAddr;
MMU_HEAP *pMMUHeap;
IMG_DEV_PHYADDR DevPAddr;
-
+
pMMUHeap = (MMU_HEAP*)BM_GetMMUHeap(hDevMemHeap);
DevPAddr = MMU_GetPhysPageAddr(pMMUHeap, sDevVAddr);
- pCpuPAddr->uiAddr = DevPAddr.uiAddr;
+ pCpuPAddr->uiAddr = DevPAddr.uiAddr;
pDevPAddr->uiAddr = DevPAddr.uiAddr;
return (pDevPAddr->uiAddr != 0) ? PVRSRV_OK : PVRSRV_ERROR_INVALID_PARAMS;
return PVRSRV_ERROR_INVALID_PARAMS;
}
-
+
*psPDDevPAddr = ((BM_CONTEXT*)hDevMemContext)->psMMUContext->sPDDevPAddr;
return PVRSRV_OK;
psLocalDevMemArena = psSysData->apsLocalDevMemArena[0];
-
+
if(psLocalDevMemArena == IMG_NULL)
{
-
+
eError = OSAllocPages(PVRSRV_HAP_WRITECOMBINE | PVRSRV_HAP_KERNEL_ONLY,
3 * SGX_MMU_PAGE_SIZE,
SGX_MMU_PAGE_SIZE,
return eError;
}
-
+
if(pui8MemBlock)
{
sMemBlockCpuPAddr = OSMapLinToCPUPhys(hOSMemHandle,
}
else
{
-
+
sMemBlockCpuPAddr = OSMemHandleToCpuPAddr(hOSMemHandle, 0);
}
}
else
{
-
+
if(RA_Alloc(psLocalDevMemArena,
3 * SGX_MMU_PAGE_SIZE,
return PVRSRV_ERROR_OUT_OF_MEMORY;
}
-
+
sMemBlockCpuPAddr = SysSysPAddrToCpuPAddr(sMemBlockSysPAddr);
pui8MemBlock = OSMapPhysToLin(sMemBlockCpuPAddr,
SGX_MMU_PAGE_SIZE * 3,
psDevInfo->sBIFResetPDDevPAddr = SysCpuPAddrToDevPAddr(PVRSRV_DEVICE_TYPE_SGX, sMemBlockCpuPAddr);
psDevInfo->sBIFResetPTDevPAddr.uiAddr = psDevInfo->sBIFResetPDDevPAddr.uiAddr + SGX_MMU_PAGE_SIZE;
psDevInfo->sBIFResetPageDevPAddr.uiAddr = psDevInfo->sBIFResetPTDevPAddr.uiAddr + SGX_MMU_PAGE_SIZE;
-
-
+
+
psDevInfo->pui32BIFResetPD = (IMG_UINT32 *)pui8MemBlock;
psDevInfo->pui32BIFResetPT = (IMG_UINT32 *)(pui8MemBlock + SGX_MMU_PAGE_SIZE);
-
+
OSMemSet(psDevInfo->pui32BIFResetPD, 0, SGX_MMU_PAGE_SIZE);
OSMemSet(psDevInfo->pui32BIFResetPT, 0, SGX_MMU_PAGE_SIZE);
-
+
OSMemSet(pui8MemBlock + (2 * SGX_MMU_PAGE_SIZE), 0xDB, SGX_MMU_PAGE_SIZE);
return PVRSRV_OK;
psLocalDevMemArena = psSysData->apsLocalDevMemArena[0];
-
+
if(psLocalDevMemArena == IMG_NULL)
{
OSFreePages(PVRSRV_HAP_WRITECOMBINE | PVRSRV_HAP_KERNEL_ONLY,
psLocalDevMemArena = psSysData->apsLocalDevMemArena[0];
-
+
if(psLocalDevMemArena == IMG_NULL)
{
-
+
eError = OSAllocPages(PVRSRV_HAP_WRITECOMBINE | PVRSRV_HAP_KERNEL_ONLY,
SGX_MMU_PAGE_SIZE,
SGX_MMU_PAGE_SIZE,
}
ui32PDOffset = 0;
-
+
if(pui32PT)
{
sCpuPAddr = OSMapLinToCPUPhys(hPTPageOSMemHandle,
}
else
{
-
+
sCpuPAddr = OSMemHandleToCpuPAddr(hPTPageOSMemHandle, 0);
}
sPTDevPAddr = SysCpuPAddrToDevPAddr(PVRSRV_DEVICE_TYPE_SGX, sCpuPAddr);
}
else
{
-
+
sCpuPAddr = OSMemHandleToCpuPAddr(hPDPageOSMemHandle, 0);
}
sPDDevPAddr = SysCpuPAddrToDevPAddr(PVRSRV_DEVICE_TYPE_SGX, sCpuPAddr);
}
else
{
-
+
if(RA_Alloc(psLocalDevMemArena,
SGX_MMU_PAGE_SIZE * 2,
return PVRSRV_ERROR_OUT_OF_MEMORY;
}
-
+
sCpuPAddr = SysSysPAddrToCpuPAddr(psDevInfo->sBRN22997SysPAddr);
pui32PT = OSMapPhysToLin(sCpuPAddr,
SGX_MMU_PAGE_SIZE * 2,
}
ui32PTOffset = 0;
-
+
sPTDevPAddr = SysCpuPAddrToDevPAddr(PVRSRV_DEVICE_TYPE_SGX, sCpuPAddr);
-
+
pui32PD = pui32PT + SGX_MMU_PAGE_SIZE/sizeof(IMG_UINT32);
ui32PDOffset = SGX_MMU_PAGE_SIZE;
hPDPageOSMemHandle = hPTPageOSMemHandle;
OSMemSet(pui32PD, 0, SGX_MMU_PAGE_SIZE);
OSMemSet(pui32PT, 0, SGX_MMU_PAGE_SIZE);
-
+
PDUMPMALLOCPAGETABLE(&psDeviceNode->sDevId, hPDPageOSMemHandle, ui32PDOffset, pui32PD, SGX_MMU_PAGE_SIZE, 0, PDUMP_PD_UNIQUETAG);
PDUMPMALLOCPAGETABLE(&psDeviceNode->sDevId, hPTPageOSMemHandle, ui32PTOffset, pui32PT, SGX_MMU_PAGE_SIZE, 0, PDUMP_PT_UNIQUETAG);
PDUMPMEMPTENTRIES(&psDevInfo->sMMUAttrib, hPDPageOSMemHandle, pui32PD, SGX_MMU_PAGE_SIZE, 0, IMG_TRUE, PDUMP_PD_UNIQUETAG, PDUMP_PT_UNIQUETAG);
volatile IMG_UINT32 *pui32HostPort;
IMG_UINT32 ui32BIFCtrl;
-
-
-
+
+
+
pui32HostPort = (volatile IMG_UINT32*)(((IMG_UINT8*)psDevInfo->pvHostPortBaseKM) + SYS_SGX_HOSTPORT_BRN23030_OFFSET);
-
+
sDevVAddr.uiAddr = SYS_SGX_HOSTPORT_BASE_DEVVADDR + SYS_SGX_HOSTPORT_BRN23030_OFFSET;
ui32PDIndex = (sDevVAddr.uiAddr & SGX_MMU_PD_MASK) >> (SGX_MMU_PAGE_SHIFT + SGX_MMU_PT_SHIFT);
ui32PTIndex = (sDevVAddr.uiAddr & SGX_MMU_PT_MASK) >> SGX_MMU_PAGE_SHIFT;
-
+
pui32PD[ui32PDIndex] = (psDevInfo->sBRN22997PTDevPAddr.uiAddr>>SGX_MMU_PDE_ADDR_ALIGNSHIFT)
| SGX_MMU_PDE_VALID;
-
+
pui32PT[ui32PTIndex] = (psDevInfo->sBRN22997PTDevPAddr.uiAddr>>SGX_MMU_PTE_ADDR_ALIGNSHIFT)
| SGX_MMU_PTE_VALID;
PDUMPMEMPTENTRIES(&psDevInfo->sMMUAttrib, psDevInfo->hBRN22997PDPageOSMemHandle, pui32PD, SGX_MMU_PAGE_SIZE, 0, IMG_TRUE, PDUMP_PD_UNIQUETAG, PDUMP_PT_UNIQUETAG);
PDUMPMEMPTENTRIES(&psDevInfo->sMMUAttrib, psDevInfo->hBRN22997PTPageOSMemHandle, pui32PT, SGX_MMU_PAGE_SIZE, 0, IMG_TRUE, PDUMP_PT_UNIQUETAG, PDUMP_PD_UNIQUETAG);
-
+
OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_DIR_LIST_BASE0,
psDevInfo->sBRN22997PDDevPAddr.uiAddr);
PDUMPPDREG(&psDevInfo->sMMUAttrib, EUR_CR_BIF_DIR_LIST_BASE0, psDevInfo->sBRN22997PDDevPAddr.uiAddr, PDUMP_PD_UNIQUETAG);
-
+
ui32BIFCtrl = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_CTRL);
OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_CTRL, ui32BIFCtrl | EUR_CR_BIF_CTRL_INVALDC_MASK);
PDUMPREG(SGX_PDUMPREG_NAME, EUR_CR_BIF_CTRL, ui32BIFCtrl | EUR_CR_BIF_CTRL_INVALDC_MASK);
OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_CTRL, ui32BIFCtrl);
PDUMPREG(SGX_PDUMPREG_NAME, EUR_CR_BIF_CTRL, ui32BIFCtrl);
-
+
if (pui32HostPort)
{
-
+
IMG_UINT32 ui32Tmp;
ui32Tmp = *pui32HostPort;
}
PVR_DPF((PVR_DBG_ERROR,"Host Port not present for BRN22997 workaround"));
}
+
-
-
+
PDUMPCOMMENT("RDW :SGXMEM:v4:%08X\r\n", sDevVAddr.uiAddr);
-
+
PDUMPCOMMENT("SAB :SGXMEM:v4:%08X 4 0 hostport.bin", sDevVAddr.uiAddr);
-
+
pui32PD[ui32PDIndex] = 0;
pui32PT[ui32PTIndex] = 0;
-
+
PDUMPMEMPTENTRIES(&psDevInfo->sMMUAttrib, psDevInfo->hBRN22997PDPageOSMemHandle, pui32PD, SGX_MMU_PAGE_SIZE, 0, IMG_TRUE, PDUMP_PD_UNIQUETAG, PDUMP_PT_UNIQUETAG);
PDUMPMEMPTENTRIES(&psDevInfo->sMMUAttrib, psDevInfo->hBRN22997PTPageOSMemHandle, pui32PT, SGX_MMU_PAGE_SIZE, 0, IMG_TRUE, PDUMP_PT_UNIQUETAG, PDUMP_PD_UNIQUETAG);
PDUMPFREEPAGETABLE(&psDeviceNode->sDevId, psDevInfo->hBRN22997PDPageOSMemHandle, psDevInfo->pui32BRN22997PD, SGX_MMU_PAGE_SIZE, 0, PDUMP_PD_UNIQUETAG);
PDUMPFREEPAGETABLE(&psDeviceNode->sDevId, psDevInfo->hBRN22997PTPageOSMemHandle, psDevInfo->pui32BRN22997PT, SGX_MMU_PAGE_SIZE, 0, PDUMP_PT_UNIQUETAG);
-
+
if(psLocalDevMemArena == IMG_NULL)
{
if (psDevInfo->pui32BRN22997PD != IMG_NULL)
}
}
}
-#endif
+#endif
#if defined(SUPPORT_EXTERNAL_SYSTEM_CACHE)
pui32PT = (IMG_UINT32 *) psDeviceNode->sDevMemoryInfo.pBMKernelContext->psMMUContext->apsPTInfoList[ui32PDIndex]->PTPageCpuVAddr;
- MakeKernelPageReadWrite(pui32PT);
-
+
pui32PT[ui32PTIndex] = (psDevInfo->sExtSysCacheRegsDevPBase.uiAddr>>SGX_MMU_PTE_ADDR_ALIGNSHIFT)
| SGX_MMU_PTE_VALID;
- MakeKernelPageReadOnly(pui32PT);
-#if defined(PDUMP)
+#if defined(PDUMP)
+
{
IMG_DEV_PHYADDR sDevPAddr;
IMG_CPU_PHYADDR sCpuPAddr;
psLocalDevMemArena = psSysData->apsLocalDevMemArena[0];
-
+
ui32PDIndex = (SGX_EXT_SYSTEM_CACHE_REGS_DEVVADDR_BASE & SGX_MMU_PD_MASK) >> (SGX_MMU_PAGE_SHIFT + SGX_MMU_PT_SHIFT);
ui32PTIndex = (SGX_EXT_SYSTEM_CACHE_REGS_DEVVADDR_BASE & SGX_MMU_PT_MASK) >> SGX_MMU_PAGE_SHIFT;
-
+
if (psDeviceNode->sDevMemoryInfo.pBMKernelContext->psMMUContext->apsPTInfoList[ui32PDIndex])
{
if (psDeviceNode->sDevMemoryInfo.pBMKernelContext->psMMUContext->apsPTInfoList[ui32PDIndex]->PTPageCpuVAddr)
}
}
- MakeKernelPageReadWrite(pui32PT);
pui32PT[ui32PTIndex] = 0;
- MakeKernelPageReadOnly(pui32PT);
PDUMPMEMPTENTRIES(&sMMUAttrib, psDeviceNode->sDevMemoryInfo.pBMKernelContext->psMMUContext->hPDOSMemHandle, &pui32PT[ui32PTIndex], sizeof(IMG_UINT32), 0, IMG_FALSE, PDUMP_PD_UNIQUETAG, PDUMP_PT_UNIQUETAG);
if (ui32WriteData != ui32ReadData)
{
-
+
PVR_DPF ((PVR_DBG_ERROR, "Error - memory page test failed at device phys address 0x%08X", sDevPAddr.uiAddr + (n<<2) ));
PVR_DBG_BREAK;
bOK = IMG_FALSE;
if (ui32WriteData != ui32ReadData)
{
-
+
PVR_DPF ((PVR_DBG_ERROR, "Error - memory page test failed at device phys address 0x%08X", sDevPAddr.uiAddr + (n<<2) ));
PVR_DBG_BREAK;
bOK = IMG_FALSE;
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
IMG_DEV_VIRTADDR DevVAddr,
IMG_UINT32 ui32Size);
-IMG_VOID
+IMG_VOID
MMU_Enable (MMU_HEAP *pMMUHeap);
-IMG_VOID
+IMG_VOID
MMU_Disable (MMU_HEAP *pMMUHeap);
IMG_VOID
IMG_VOID
MMU_MapShadow (MMU_HEAP * pMMUHeap,
IMG_DEV_VIRTADDR MapBaseDevVAddr,
- IMG_SIZE_T uByteSize,
+ IMG_SIZE_T uByteSize,
IMG_CPU_VIRTADDR CpuVAddr,
IMG_HANDLE hOSMemHandle,
IMG_DEV_VIRTADDR * pDevVAddr,
IMG_VOID WorkaroundBRN22997ReadHostPort(PVRSRV_SGXDEV_INFO *psDevInfo);
IMG_VOID WorkaroundBRN22997Free(PVRSRV_DEVICE_NODE *psDeviceNode);
-#endif
+#endif
#if defined(SUPPORT_EXTERNAL_SYSTEM_CACHE)
PVRSRV_ERROR MMU_MapExtSystemCacheRegs(PVRSRV_DEVICE_NODE *psDeviceNode);
PVRSRV_ERROR MMU_UnmapExtSystemCacheRegs(PVRSRV_DEVICE_NODE *psDeviceNode);
-#endif
+#endif
IMG_BOOL MMU_IsHeapShared(MMU_HEAP* pMMU_Heap);
#if defined(PDUMP)
IMG_UINT32 MMU_GetPDumpContextID(IMG_HANDLE hDevMemContext);
-#endif
+#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
sizeof(PVRSRV_KERNEL_MEM_INFO *) * psStubPBDesc->ui32SubKernelMemInfosCount,
ppsSharedPBDescSubKernelMemInfos,
0);
-
+
PVR_DPF((PVR_DBG_ERROR, "SGXFindSharedPBDescKM: ResManRegisterRes failed"));
static PVRSRV_ERROR
SGXCleanupSharedPBDescKM(PVRSRV_STUB_PBDESC *psStubPBDescIn)
{
-
+
IMG_UINT32 i;
PVRSRV_DEVICE_NODE *psDeviceNode;
psDeviceNode = (PVRSRV_DEVICE_NODE*)psStubPBDescIn->hDevCookie;
+
-
-
+
psStubPBDescIn->ui32RefCount--;
if (psStubPBDescIn->ui32RefCount == 0)
{
List_PVRSRV_STUB_PBDESC_Remove(psStubPBDescIn);
for(i=0 ; i<psStubPBDescIn->ui32SubKernelMemInfosCount; i++)
{
-
+
PVRSRVFreeDeviceMemKM(psStubPBDescIn->hDevCookie,
psStubPBDescIn->ppsSubKernelMemInfos[i]);
}
sizeof(PVRSRV_STUB_PBDESC),
psStubPBDescIn,
0);
+
-
-
+
SGXCleanupRequest(psDeviceNode,
&sHWPBDescDevVAddr,
PVRSRV_CLEANUPCMD_PB,
CLEANUP_WITH_POLL);
}
return PVRSRV_OK;
-
+
}
static PVRSRV_ERROR SGXCleanupSharedPBDescCallback(IMG_PVOID pvParam, IMG_UINT32 ui32Param, IMG_BOOL bDummy)
PVRSRV_SGXDEV_INFO *psSGXDevInfo;
PRESMAN_ITEM psResItem;
-
+
if (psPerProcCreateSharedPB != psPerProc)
{
goto NoAdd;
}
-
+
psResItem = ResManRegisterRes(psPerProc->hResManContext,
RESMAN_TYPE_SHARED_PB_DESC,
psStubPBDesc,
goto NoAddKeepPB;
}
-
+
psStubPBDesc->ui32RefCount++;
*phSharedPBDesc = (IMG_HANDLE)psResItem;
}
psStubPBDesc->hDevCookie = hDevCookie;
-
+
List_PVRSRV_STUB_PBDESC_Insert(&(psSGXDevInfo->psStubPBDescListKM),
psStubPBDesc);
sizeof(PVRSRV_STUB_PBDESC),
psStubPBDesc,
0);
-
+
}
NoAddKeepPB:
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
}
#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#define SGX_GENERAL_HEAP_BASE 0x08000000
#define SGX_GENERAL_HEAP_SIZE (0xB8000000-0x00001000)
-
+
#define SGX_3DPARAMETERS_HEAP_SIZE 0x10000000
-
+
#if !defined(HYBRID_SHARED_PB_SIZE)
#define HYBRID_SHARED_PB_SIZE (SGX_3DPARAMETERS_HEAP_SIZE >> 1)
#endif
#endif
#define SGX_SHARED_3DPARAMETERS_HEAP_BASE 0xC0000000
-
+
#define SGX_PERCONTEXT_3DPARAMETERS_HEAP_BASE (SGX_SHARED_3DPARAMETERS_HEAP_BASE + SGX_SHARED_3DPARAMETERS_SIZE)
-
+
#define SGX_TADATA_HEAP_BASE 0xD0000000
#define SGX_TADATA_HEAP_SIZE (0x0D000000-0x00001000)
#define SGX_KERNEL_DATA_HEAP_BASE 0xF0000000
#define SGX_KERNEL_DATA_HEAP_SIZE (0x03000000-(0x00001000+SGX_KERNEL_DATA_HEAP_OFFSET))
-
+
#define SGX_PIXELSHADER_HEAP_BASE 0xF4000000
#define SGX_PIXELSHADER_HEAP_SIZE (0x05000000-0x00001000)
-
+
#define SGX_VERTEXSHADER_HEAP_BASE 0xFC000000
#define SGX_VERTEXSHADER_HEAP_SIZE (0x02000000-0x00001000)
-#else
+#else
#if defined(SGX_FEATURE_2D_HARDWARE)
#define SGX_2D_HEAP_BASE 0x00100000
#define SGX_2D_HEAP_SIZE (0x08000000-0x00100000-0x00001000)
#define SGX_GENERAL_HEAP_SIZE (0xC2000000-0x00001000)
#else
#include <sgx_msvdx_defs.h>
-
-
+
+
#define SGX_GENERAL_HEAP_BASE 0x10000000
#define SGX_GENERAL_HEAP_SIZE (0xB5000000-0x00001000)
#define SGX_VPB_TILED_HEAP_BASE 0xC5000000
#define SGX_VPB_TILED_HEAP_SIZE (0x0D000000-0x00001000)
-
+
#if((SGX_VPB_TILED_HEAP_BASE & SGX_BIF_TILING_ADDR_INV_MASK) != 0)
#error "sgxconfig.h: SGX_VPB_TILED_HEAP has insufficient alignment"
#endif
- #endif
-
+ #endif
+
#define SGX_3DPARAMETERS_HEAP_SIZE 0x10000000
-
+
#if !defined(HYBRID_SHARED_PB_SIZE)
#define HYBRID_SHARED_PB_SIZE (SGX_3DPARAMETERS_HEAP_SIZE >> 1)
#endif
#endif
#define SGX_SHARED_3DPARAMETERS_HEAP_BASE 0xD2000000
-
+
#define SGX_PERCONTEXT_3DPARAMETERS_HEAP_BASE (SGX_SHARED_3DPARAMETERS_HEAP_BASE + SGX_SHARED_3DPARAMETERS_SIZE)
-
+
#define SGX_TADATA_HEAP_BASE 0xE2000000
#define SGX_TADATA_HEAP_SIZE (0x0D000000-0x00001000)
#define SGX_KERNEL_DATA_HEAP_BASE 0xF4000000
#define SGX_KERNEL_DATA_HEAP_SIZE (0x05000000-(0x00001000+SGX_KERNEL_DATA_HEAP_OFFSET))
-
+
#define SGX_PIXELSHADER_HEAP_BASE 0xF9000000
#define SGX_PIXELSHADER_HEAP_SIZE (0x05000000-0x00001000)
-
+
#define SGX_VERTEXSHADER_HEAP_BASE 0xFE000000
#define SGX_VERTEXSHADER_HEAP_SIZE (0x02000000-0x00001000)
-#endif
-
+#endif
+
#define SGX_CORE_IDENTIFIED
-#endif
+#endif
#if SGX_FEATURE_ADDRESS_SPACE_SIZE == 28
#define SGX_GENERAL_HEAP_SIZE (0x08800000-0x00001000-0x00001000)
#endif
#endif
-
+
#if defined(SUPPORT_LARGE_GENERAL_HEAP)
#define SGX_3DPARAMETERS_HEAP_SIZE 0x01000000
#else
#define SGX_3DPARAMETERS_HEAP_SIZE 0x04000000
#endif
-
+
#if !defined(HYBRID_SHARED_PB_SIZE)
#define HYBRID_SHARED_PB_SIZE (SGX_3DPARAMETERS_HEAP_SIZE >> 1)
#endif
#define SGX_SHARED_3DPARAMETERS_HEAP_BASE 0x08800000
#endif
-
+
#define SGX_PERCONTEXT_3DPARAMETERS_HEAP_BASE (SGX_SHARED_3DPARAMETERS_HEAP_BASE + SGX_SHARED_3DPARAMETERS_SIZE)
-
+
#define SGX_TADATA_HEAP_BASE 0x0C800000
#define SGX_TADATA_HEAP_SIZE (0x01000000-0x00001000)
#define SGX_VERTEXSHADER_HEAP_BASE 0x0FC00000
#define SGX_VERTEXSHADER_HEAP_SIZE (0x00200000-0x00001000)
-
+
#define SGX_CORE_IDENTIFIED
-#endif
+#endif
#if !defined(SGX_CORE_IDENTIFIED)
#error "sgxconfig.h: ERROR: unspecified SGX Core version"
#if ((SGX_KERNEL_CODE_HEAP_BASE + SGX_KERNEL_CODE_HEAP_SIZE - SGX_PDSPIXEL_CODEDATA_HEAP_BASE) > 0x4000000)
#error "sgxconfig.h: ERROR: SGX_KERNEL_CODE_HEAP_BASE out of range of SGX_PDSPIXEL_CODEDATA_HEAP_BASE"
#endif
-
+
#if ((SGX_PDSVERTEX_CODEDATA_HEAP_BASE + SGX_PDSVERTEX_CODEDATA_HEAP_SIZE - SGX_PDSPIXEL_CODEDATA_HEAP_BASE) > 0x4000000)
#error "sgxconfig.h: ERROR: SGX_PDSVERTEX_CODEDATA_HEAP_BASE out of range of SGX_PDSPIXEL_CODEDATA_HEAP_BASE"
#endif
-#endif
+#endif
#if defined(SGX_FEATURE_2D_HARDWARE) && defined(SUPPORT_SGX_GENERAL_MAPPING_HEAP)
#if ((SGX_GENERAL_MAPPING_HEAP_BASE + SGX_GENERAL_MAPPING_HEAP_SIZE - SGX_2D_HEAP_BASE) >= EUR_CR_BIF_TWOD_REQ_BASE_ADDR_MASK)
#error "sgxconfig.h: ERROR: SGX_VERTEXSHADER_HEAP_BASE size cause wraparound"
#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
IMG_UINT32 ui32CoreConfig;
IMG_UINT32 ui32CoreFlags;
-
+
IMG_PVOID pvRegsBaseKM;
#if defined(SGX_FEATURE_HOST_PORT)
-
+
IMG_PVOID pvHostPortBaseKM;
-
+
IMG_UINT32 ui32HPSize;
-
+
IMG_SYS_PHYADDR sHPSysPAddr;
#endif
-
+
IMG_HANDLE hRegMapping;
-
+
IMG_SYS_PHYADDR sRegsPhysBase;
-
+
IMG_UINT32 ui32RegSize;
#if defined(SUPPORT_EXTERNAL_SYSTEM_CACHE)
-
+
IMG_UINT32 ui32ExtSysCacheRegsSize;
-
+
IMG_DEV_PHYADDR sExtSysCacheRegsDevPBase;
-
+
IMG_UINT32 *pui32ExtSystemCacheRegsPT;
-
+
IMG_HANDLE hExtSystemCacheRegsPTPageOSMemHandle;
-
+
IMG_SYS_PHYADDR sExtSystemCacheRegsPTSysPAddr;
#endif
-
+
IMG_UINT32 ui32CoreClockSpeed;
IMG_UINT32 ui32uKernelTimerClock;
IMG_BOOL bSGXIdle;
PVRSRV_STUB_PBDESC *psStubPBDescListKM;
-
+
IMG_DEV_PHYADDR sKernelPDDevPAddr;
IMG_UINT32 ui32HeapCount;
IMG_VOID *pvDeviceMemoryHeap;
- PPVRSRV_KERNEL_MEM_INFO psKernelCCBMemInfo;
- PVRSRV_SGX_KERNEL_CCB *psKernelCCB;
- PPVRSRV_SGX_CCB_INFO psKernelCCBInfo;
- PPVRSRV_KERNEL_MEM_INFO psKernelCCBCtlMemInfo;
- PVRSRV_SGX_CCB_CTL *psKernelCCBCtl;
- PPVRSRV_KERNEL_MEM_INFO psKernelCCBEventKickerMemInfo;
- IMG_UINT32 *pui32KernelCCBEventKicker;
+ PPVRSRV_KERNEL_MEM_INFO psKernelCCBMemInfo;
+ PVRSRV_SGX_KERNEL_CCB *psKernelCCB;
+ PPVRSRV_SGX_CCB_INFO psKernelCCBInfo;
+ PPVRSRV_KERNEL_MEM_INFO psKernelCCBCtlMemInfo;
+ PVRSRV_SGX_CCB_CTL *psKernelCCBCtl;
+ PPVRSRV_KERNEL_MEM_INFO psKernelCCBEventKickerMemInfo;
+ IMG_UINT32 *pui32KernelCCBEventKicker;
#if defined(PDUMP)
- IMG_UINT32 ui32KernelCCBEventKickerDumpVal;
-#endif
- PVRSRV_KERNEL_MEM_INFO *psKernelSGXMiscMemInfo;
- IMG_UINT32 aui32HostKickAddr[SGXMKIF_CMD_MAX];
+ IMG_UINT32 ui32KernelCCBEventKickerDumpVal;
+#endif
+ PVRSRV_KERNEL_MEM_INFO *psKernelSGXMiscMemInfo;
+ IMG_UINT32 aui32HostKickAddr[SGXMKIF_CMD_MAX];
#if defined(SGX_SUPPORT_HWPROFILING)
PPVRSRV_KERNEL_MEM_INFO psKernelHWProfilingMemInfo;
#endif
- PPVRSRV_KERNEL_MEM_INFO psKernelHWPerfCBMemInfo;
- PPVRSRV_KERNEL_MEM_INFO psKernelTASigBufferMemInfo;
- PPVRSRV_KERNEL_MEM_INFO psKernel3DSigBufferMemInfo;
+ PPVRSRV_KERNEL_MEM_INFO psKernelHWPerfCBMemInfo;
+ PPVRSRV_KERNEL_MEM_INFO psKernelTASigBufferMemInfo;
+ PPVRSRV_KERNEL_MEM_INFO psKernel3DSigBufferMemInfo;
#if defined(FIX_HW_BRN_29702)
- PPVRSRV_KERNEL_MEM_INFO psKernelCFIMemInfo;
+ PPVRSRV_KERNEL_MEM_INFO psKernelCFIMemInfo;
#endif
#if defined(FIX_HW_BRN_29823)
- PPVRSRV_KERNEL_MEM_INFO psKernelDummyTermStreamMemInfo;
+ PPVRSRV_KERNEL_MEM_INFO psKernelDummyTermStreamMemInfo;
#endif
#if defined(SGX_FEATURE_VDM_CONTEXT_SWITCH) && defined(FIX_HW_BRN_31425)
PPVRSRV_KERNEL_MEM_INFO psKernelVDMSnapShotBufferMemInfo;
PPVRSRV_KERNEL_MEM_INFO psKernelVDMStateUpdateBufferMemInfo;
#endif
#if defined(PVRSRV_USSE_EDM_STATUS_DEBUG)
- PPVRSRV_KERNEL_MEM_INFO psKernelEDMStatusBufferMemInfo;
+ PPVRSRV_KERNEL_MEM_INFO psKernelEDMStatusBufferMemInfo;
#endif
#if defined(SGX_FEATURE_OVERLAPPED_SPM)
- PPVRSRV_KERNEL_MEM_INFO psKernelTmpRgnHeaderMemInfo;
+ PPVRSRV_KERNEL_MEM_INFO psKernelTmpRgnHeaderMemInfo;
#endif
-
+
IMG_UINT32 ui32ClientRefCount;
-
+
IMG_UINT32 ui32CacheControl;
-
+
IMG_UINT32 ui32ClientBuildOptions;
-
+
SGX_MISCINFO_STRUCT_SIZES sSGXStructSizes;
-
+
IMG_VOID *pvMMUContextList;
-
+
IMG_BOOL bForcePTOff;
IMG_UINT32 ui32EDMTaskReg0;
IMG_UINT32 ui32MasterClkGateStatusMask;
IMG_UINT32 ui32MasterClkGateStatus2Reg;
IMG_UINT32 ui32MasterClkGateStatus2Mask;
-#endif
+#endif
SGX_INIT_SCRIPTS sScripts;
-
+
IMG_HANDLE hBIFResetPDOSMemHandle;
IMG_DEV_PHYADDR sBIFResetPDDevPAddr;
IMG_DEV_PHYADDR sBIFResetPTDevPAddr;
IMG_UINT32 *pui32BIFResetPT;
#if defined(FIX_HW_BRN_22997) && defined(FIX_HW_BRN_23030) && defined(SGX_FEATURE_HOST_PORT)
-
+
IMG_HANDLE hBRN22997PTPageOSMemHandle;
IMG_HANDLE hBRN22997PDPageOSMemHandle;
IMG_DEV_PHYADDR sBRN22997PTDevPAddr;
IMG_UINT32 *pui32BRN22997PT;
IMG_UINT32 *pui32BRN22997PD;
IMG_SYS_PHYADDR sBRN22997SysPAddr;
-#endif
+#endif
#if defined(SUPPORT_HW_RECOVERY)
-
+
IMG_HANDLE hTimer;
-
+
IMG_UINT32 ui32TimeStamp;
#endif
-
+
IMG_UINT32 ui32NumResets;
-
+
PVRSRV_KERNEL_MEM_INFO *psKernelSGXHostCtlMemInfo;
SGXMKIF_HOST_CTL *psSGXHostCtl;
-
+
PVRSRV_KERNEL_MEM_INFO *psKernelSGXTA3DCtlMemInfo;
#if defined(FIX_HW_BRN_31272) || defined(FIX_HW_BRN_31780) || defined(FIX_HW_BRN_33920)
IMG_UINT32 ui32Flags;
-
+
IMG_UINT32 ui32MemTilingUsage;
#if defined(PDUMP)
#endif
#if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
-
+
IMG_VOID *pvDummyPTPageCpuVAddr;
IMG_DEV_PHYADDR sDummyPTDevPAddr;
IMG_HANDLE hDummyPTPageOSMemHandle;
IMG_UINT32 asSGXDevData[SGX_MAX_DEV_DATA];
#if defined(FIX_HW_BRN_31620)
-
+
IMG_VOID *pvBRN31620DummyPageCpuVAddr;
IMG_HANDLE hBRN31620DummyPageOSMemHandle;
IMG_DEV_PHYADDR sBRN31620DummyPageDevPAddr;
-
+
IMG_VOID *pvBRN31620DummyPTCpuVAddr;
IMG_HANDLE hBRN31620DummyPTOSMemHandle;
IMG_DEV_PHYADDR sBRN31620DummyPTDevPAddr;
{
IMG_UINT32 ui32Flags;
-
+
IMG_SYS_PHYADDR sRegsSysPBase;
IMG_CPU_PHYADDR sRegsCpuPBase;
IMG_CPU_VIRTADDR pvRegsCpuVBase;
IMG_UINT32 ui32HPSize;
#endif
-
+
IMG_SYS_PHYADDR sLocalMemSysPBase;
IMG_DEV_PHYADDR sLocalMemDevPBase;
IMG_CPU_PHYADDR sLocalMemCpuPBase;
IMG_DEV_PHYADDR sExtSysCacheRegsDevPBase;
#endif
-
+
IMG_UINT32 ui32IRQ;
#if !defined(SGX_DYNAMIC_TIMING_INFO)
-
+
SGX_TIMING_INFORMATION sTimingInfo;
#endif
#if defined(PDUMP)
-
+
IMG_CHAR *pszPDumpDevName;
#endif
} SGX_DEVICE_MAP;
typedef struct _PVRSRV_SGX_CCB_INFO_
{
- PVRSRV_KERNEL_MEM_INFO *psCCBMemInfo;
- PVRSRV_KERNEL_MEM_INFO *psCCBCtlMemInfo;
- SGXMKIF_COMMAND *psCommands;
- IMG_UINT32 *pui32WriteOffset;
- volatile IMG_UINT32 *pui32ReadOffset;
+ PVRSRV_KERNEL_MEM_INFO *psCCBMemInfo;
+ PVRSRV_KERNEL_MEM_INFO *psCCBCtlMemInfo;
+ SGXMKIF_COMMAND *psCommands;
+ IMG_UINT32 *pui32WriteOffset;
+ volatile IMG_UINT32 *pui32ReadOffset;
#if defined(PDUMP)
- IMG_UINT32 ui32CCBDumpWOff;
+ IMG_UINT32 ui32CCBDumpWOff;
#endif
} PVRSRV_SGX_CCB_INFO;
IMG_UINT32 ui32ClkGateStatusReg;
IMG_UINT32 ui32ClkGateStatusMask;
#if defined(SGX_FEATURE_MP)
-#endif
+#endif
IMG_UINT32 ui32CacheControl;
IMG_UINT32 ui32NumDstSyncObjects;
IMG_HANDLE hKernelHWSyncListMemInfo;
-
+
IMG_HANDLE *pahDstSyncHandles;
IMG_UINT32 ui32NumTAStatusVals;
IMG_BOOL bTerminateOrAbort;
#endif
-
+
IMG_UINT32 ui32CCBOffset;
#if defined(SUPPORT_SGX_GENERALISED_SYNCOBJECTS)
-
+
IMG_UINT32 ui32NumTASrcSyncs;
IMG_HANDLE ahTASrcKernelSyncInfo[SGX_MAX_TA_SRC_SYNCS];
IMG_UINT32 ui32NumTADstSyncs;
IMG_UINT32 ui32Num3DSrcSyncs;
IMG_HANDLE ah3DSrcKernelSyncInfo[SGX_MAX_3D_SRC_SYNCS];
#else
-
+
IMG_UINT32 ui32NumSrcSyncs;
IMG_HANDLE ahSrcKernelSyncInfo[SGX_MAX_SRC_SYNCS];
#endif
-
+
IMG_BOOL bTADependency;
IMG_HANDLE hTA3DSyncInfo;
IMG_UINT32 ui32NumSrcSync;
IMG_HANDLE ahSrcSyncInfo[SGX_MAX_2D_SRC_SYNC_OPS];
-
+
IMG_HANDLE hDstSyncInfo;
-
+
IMG_HANDLE hTASyncInfo;
-
+
IMG_HANDLE h3DSyncInfo;
IMG_UINT32 ui32PDumpFlags;
IMG_UINT32 ui32CCBDumpWOff;
#endif
} PVRSRV_2D_SGX_KICK_KM, *PPVRSRV_2D_SGX_KICK_KM;
-#endif
-#endif
+#endif
+#endif
PVRSRV_ERROR SGXRegisterDevice (PVRSRV_DEVICE_NODE *psDeviceNode);
IMG_BOOL bHardwareRecovery);
PVRSRV_ERROR SGXDeinitialise(IMG_HANDLE hDevCookie);
-PVRSRV_ERROR SGXPrePowerState(IMG_HANDLE hDevHandle,
- PVRSRV_DEV_POWER_STATE eNewPowerState,
+PVRSRV_ERROR SGXPrePowerState(IMG_HANDLE hDevHandle,
+ PVRSRV_DEV_POWER_STATE eNewPowerState,
PVRSRV_DEV_POWER_STATE eCurrentPowerState);
-PVRSRV_ERROR SGXPostPowerState(IMG_HANDLE hDevHandle,
- PVRSRV_DEV_POWER_STATE eNewPowerState,
+PVRSRV_ERROR SGXPostPowerState(IMG_HANDLE hDevHandle,
+ PVRSRV_DEV_POWER_STATE eNewPowerState,
PVRSRV_DEV_POWER_STATE eCurrentPowerState);
PVRSRV_ERROR SGXPreClockSpeedChange(IMG_HANDLE hDevHandle,
}
#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#include "lists.h"
#include "srvkm.h"
#include "ttrace.h"
-#define VAR(x) #x
+#define VAR(x) #x
+
#define CHECK_SIZE(NAME) \
{ \
if (psSGXStructSizes->ui32Sizeof_##NAME != psDevInfo->sSGXStructSizes.ui32Sizeof_##NAME) \
#if defined(OS_SUPPORTS_IN_LISR)
if (OSInLISR(psDeviceNode->psSysData))
{
-
+
psDeviceNode->bReProcessDeviceCommandComplete = IMG_TRUE;
}
else
{
if (psDevInfo->psKernelCCBInfo != IMG_NULL)
{
-
+
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_SGX_CCB_INFO), psDevInfo->psKernelCCBInfo, IMG_NULL);
}
#if defined(SGX_FEATURE_OVERLAPPED_SPM)
psDevInfo->psKernelTmpRgnHeaderMemInfo = (PVRSRV_KERNEL_MEM_INFO *)psInitInfo->hKernelTmpRgnHeaderMemInfo;
#endif
-
+
psDevInfo->ui32ClientBuildOptions = psInitInfo->ui32ClientBuildOptions;
-
+
psDevInfo->sSGXStructSizes = psInitInfo->sSGXStructSizes;
-
+
eError = OSAllocMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
sizeof(PVRSRV_SGX_CCB_INFO),
psKernelCCBInfo->pui32ReadOffset = &psDevInfo->psKernelCCBCtl->ui32ReadOffset;
psDevInfo->psKernelCCBInfo = psKernelCCBInfo;
-
+
OSMemCopy(psDevInfo->aui32HostKickAddr, psInitInfo->aui32HostKickAddr,
SGXMKIF_CMD_MAX * sizeof(psDevInfo->aui32HostKickAddr[0]));
psDevInfo->ui32MasterClkGateStatusMask = psInitInfo->ui32MasterClkGateStatusMask;
psDevInfo->ui32MasterClkGateStatus2Reg = psInitInfo->ui32MasterClkGateStatus2Reg;
psDevInfo->ui32MasterClkGateStatus2Mask = psInitInfo->ui32MasterClkGateStatus2Mask;
-#endif
-
+#endif
+
OSMemCopy(&psDevInfo->asSGXDevData, &psInitInfo->asInitDevData, sizeof(psDevInfo->asSGXDevData));
return PVRSRV_OK;
return PVRSRV_OK;
}
case SGX_INIT_OP_ILLEGAL:
-
+
default:
{
PVR_DPF((PVR_DBG_ERROR,"SGXRunScript: PC %d: Illegal command: %d", ui32PC, psComm->eOp));
static IMG_BOOL bFirstTime = IMG_TRUE;
#if defined(PDUMP)
IMG_BOOL bPDumpIsSuspended = PDumpIsSuspended();
-#endif
+#endif
#if defined(SGX_FEATURE_MP)
-
+
#else
SGXInitClocks(psDevInfo, PDUMP_FLAGS_CONTINUOUS);
-#endif
-
-
+#endif
+
+
PDUMPCOMMENTWITHFLAGS(PDUMP_FLAGS_CONTINUOUS, "SGX initialisation script part 1\n");
eError = SGXRunScript(psDevInfo, psDevInfo->sScripts.asInitCommandsPart1, SGX_MAX_INIT_COMMANDS);
}
PDUMPCOMMENTWITHFLAGS(PDUMP_FLAGS_CONTINUOUS, "End of SGX initialisation script part 1\n");
-
+
psDevInfo->ui32NumResets++;
SGXReset(psDevInfo, bFirstTime || bHardwareRecovery, PDUMP_FLAGS_CONTINUOUS);
#if defined(EUR_CR_POWER)
#if defined(SGX531)
-
+
OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_POWER, 1);
PDUMPREG(SGX_PDUMPREG_NAME, EUR_CR_POWER, 1);
#else
-
+
OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_POWER, 0);
PDUMPREG(SGX_PDUMPREG_NAME, EUR_CR_POWER, 0);
#endif
#endif
-
+
*psDevInfo->pui32KernelCCBEventKicker = 0;
#if defined(PDUMP)
if (!bPDumpIsSuspended)
sizeof(*psDevInfo->pui32KernelCCBEventKicker), PDUMP_FLAGS_CONTINUOUS,
MAKEUNIQUETAG(psDevInfo->psKernelCCBEventKickerMemInfo));
}
-#endif
+#endif
#if defined(SUPPORT_MEMORY_TILING)
{
}
#endif
-
+
PDUMPCOMMENTWITHFLAGS(PDUMP_FLAGS_CONTINUOUS, "SGX initialisation script part 2\n");
eError = SGXRunScript(psDevInfo, psDevInfo->sScripts.asInitCommandsPart2, SGX_MAX_INIT_COMMANDS);
}
PDUMPCOMMENTWITHFLAGS(PDUMP_FLAGS_CONTINUOUS, "End of SGX initialisation script part 2\n");
-
+
psSGXHostCtl->ui32HostClock = OSClockus();
psSGXHostCtl->ui32InitStatus = 0;
MAKEUNIQUETAG(psSGXHostCtlMemInfo));
PDUMPCOMMENTWITHFLAGS(PDUMP_FLAGS_CONTINUOUS,
"Initialise the microkernel\n");
-#endif
+#endif
#if defined(SGX_FEATURE_MULTI_EVENT_KICK)
OSWriteMemoryBarrier();
OSWriteHWReg(psDevInfo->pvRegsBaseKM,
SGX_MP_CORE_SELECT(EUR_CR_EVENT_KICK, 0),
EUR_CR_EVENT_KICK_NOW_MASK);
-#endif
+#endif
OSMemoryBarrier();
#if defined(PDUMP)
-
+
if (!bPDumpIsSuspended)
{
PDUMP_FLAGS_CONTINUOUS,
MAKEUNIQUETAG(psDevInfo->psKernelCCBEventKickerMemInfo));
PDUMPREG(SGX_PDUMPREG_NAME, SGX_MP_CORE_SELECT(EUR_CR_EVENT_KICK, 0), EUR_CR_EVENT_KICK_NOW_MASK);
-#endif
+#endif
}
-#endif
+#endif
#if !defined(NO_HARDWARE)
-
+
if (PollForValueKM(&psSGXHostCtl->ui32InitStatus,
PVRSRV_USSE_EDM_INIT_COMPLETE,
#if !defined(FIX_HW_BRN_23281)
SGXDumpDebugInfo(psDevInfo, IMG_FALSE);
PVR_DBG_BREAK;
- #endif
+ #endif
return PVRSRV_ERROR_RETRY;
}
-#endif
+#endif
#if defined(PDUMP)
PDUMPCOMMENTWITHFLAGS(PDUMP_FLAGS_CONTINUOUS,
PDUMP_POLL_OPERATOR_EQUAL,
PDUMP_FLAGS_CONTINUOUS,
MAKEUNIQUETAG(psSGXHostCtlMemInfo));
-#endif
+#endif
#if defined(FIX_HW_BRN_22997) && defined(FIX_HW_BRN_23030) && defined(SGX_FEATURE_HOST_PORT)
-
+
WorkaroundBRN22997ReadHostPort(psDevInfo);
-#endif
+#endif
PVR_ASSERT(psDevInfo->psKernelCCBCtl->ui32ReadOffset == psDevInfo->psKernelCCBCtl->ui32WriteOffset);
bFirstTime = IMG_FALSE;
-
+
return PVRSRV_OK;
}
PVRSRV_SGXDEV_INFO *psDevInfo = (PVRSRV_SGXDEV_INFO *) hDevCookie;
PVRSRV_ERROR eError;
-
+
if (psDevInfo->pvRegsBaseKM == IMG_NULL)
{
return PVRSRV_OK;
DEVICE_MEMORY_HEAP_INFO *psDeviceMemoryHeap = psDeviceNode->sDevMemoryInfo.psDeviceMemoryHeap;
PVRSRV_ERROR eError;
-
+
PDUMPCOMMENT("SGX Core Version Information: %s", SGX_CORE_FRIENDLY_NAME);
-
+
#if defined(SGX_FEATURE_MP)
#if !defined(SGX_FEATURE_MP_PLUS)
PDUMPCOMMENT("SGX Multi-processor: %d cores", SGX_FEATURE_MP_CORE_COUNT);
#else
PDUMPCOMMENT("SGX Multi-processor: %d TA cores, %d 3D cores", SGX_FEATURE_MP_CORE_COUNT_TA, SGX_FEATURE_MP_CORE_COUNT_3D);
#endif
- #endif
+ #endif
#if (SGX_CORE_REV == 0)
PDUMPCOMMENT("SGX Core Revision Information: head RTL");
PDUMPCOMMENT("SGX System Level Cache is present\r\n");
#if defined(SGX_BYPASS_SYSTEM_CACHE)
PDUMPCOMMENT("SGX System Level Cache is bypassed\r\n");
- #endif
- #endif
+ #endif
+ #endif
PDUMPCOMMENT("SGX Initialisation Part 1");
-
+
if(OSAllocMem( PVRSRV_OS_NON_PAGEABLE_HEAP,
sizeof(PVRSRV_SGXDEV_INFO),
(IMG_VOID **)&psDevInfo, IMG_NULL,
}
OSMemSet (psDevInfo, 0, sizeof(PVRSRV_SGXDEV_INFO));
-
+
psDevInfo->eDeviceType = DEV_DEVICE_TYPE;
psDevInfo->eDeviceClass = DEV_DEVICE_CLASS;
-
+
psDeviceNode->pvDevice = (IMG_PVOID)psDevInfo;
-
+
psDevInfo->ui32HeapCount = psDeviceNode->sDevMemoryInfo.ui32HeapCount;
psDevInfo->pvDeviceMemoryHeap = (IMG_VOID*)psDeviceMemoryHeap;
-
+
hKernelDevMemContext = BM_CreateContext(psDeviceNode,
&sPDDevPAddr,
IMG_NULL,
psDevInfo->sKernelPDDevPAddr = sPDDevPAddr;
-
+
for(i=0; i<psDeviceNode->sDevMemoryInfo.ui32HeapCount; i++)
{
switch(psDeviceMemoryHeap[i].DevMemHeapType)
case DEVICE_MEMORY_HEAP_SHARED:
case DEVICE_MEMORY_HEAP_SHARED_EXPORTED:
{
-
+
if (psDeviceMemoryHeap[i].ui32HeapSize > 0)
{
hDevMemHeap = BM_CreateHeap (hKernelDevMemContext,
&psDeviceMemoryHeap[i]);
-
+
psDeviceMemoryHeap[i].hDevMemHeap = hDevMemHeap;
#if defined(PDUMP)
if(hDevMemHeap)
{
-
+
psDevInfo->sMMUAttrib = *((BM_HEAP*)hDevMemHeap)->psMMUAttrib;
}
#endif
psDeviceNode = (PVRSRV_DEVICE_NODE *)hDevHandle;
psDevInfo = (PVRSRV_SGXDEV_INFO *)psDeviceNode->pvDevice;
-
+
eError = InitDevInfo(psPerProc, psDeviceNode, psInitInfo);
if (eError != PVRSRV_OK)
return PVRSRV_ERROR_INIT_FAILURE;
}
-
+
if (psSGXDeviceMap->pvRegsCpuVBase)
{
psDevInfo->pvRegsBaseKM = psSGXDeviceMap->pvRegsCpuVBase;
}
else
{
-
+
psDevInfo->pvRegsBaseKM = OSMapPhysToLin(psSGXDeviceMap->sRegsCpuPBase,
psSGXDeviceMap->ui32RegsSize,
PVRSRV_HAP_KERNEL_ONLY|PVRSRV_HAP_UNCACHED,
#if defined(SGX_FEATURE_HOST_PORT)
if (psSGXDeviceMap->ui32Flags & SGX_HOSTPORT_PRESENT)
{
-
+
psDevInfo->pvHostPortBaseKM = OSMapPhysToLin(psSGXDeviceMap->sHPCpuPBase,
psSGXDeviceMap->ui32HPSize,
PVRSRV_HAP_KERNEL_ONLY|PVRSRV_HAP_UNCACHED,
#if defined (SYS_USING_INTERRUPTS)
-
+
psDeviceNode->pvISRData = psDeviceNode;
-
+
PVR_ASSERT(psDeviceNode->pfnDeviceISR == SGX_ISRHandler);
-#endif
-
+#endif
+
psDevInfo->psSGXHostCtl->ui32PowerStatus |= PVRSRV_USSE_EDM_POWMAN_NO_WORK;
eDefaultPowerState = PVRSRV_DEV_POWER_STATE_OFF;
-
+
eError = PVRSRVRegisterPowerDevice (psDeviceNode->sDevId.ui32DeviceIndex,
&SGXPrePowerState, &SGXPostPowerState,
&SGXPreClockSpeedChange, &SGXPostClockSpeedChange,
PVR_DPF((PVR_DBG_ERROR,"SGXInitialise : Failed to alloc memory for BRN22997 workaround"));
return eError;
}
-#endif
+#endif
#if defined(SUPPORT_EXTERNAL_SYSTEM_CACHE)
-
+
psDevInfo->ui32ExtSysCacheRegsSize = psSGXDeviceMap->ui32ExtSysCacheRegsSize;
psDevInfo->sExtSysCacheRegsDevPBase = psSGXDeviceMap->sExtSysCacheRegsDevPBase;
eError = MMU_MapExtSystemCacheRegs(psDeviceNode);
PVR_DPF((PVR_DBG_ERROR,"SGXInitialise : Failed to map external system cache registers"));
return eError;
}
-#endif
-
+#endif
+
OSMemSet(psDevInfo->psKernelCCB, 0, sizeof(PVRSRV_SGX_KERNEL_CCB));
OSMemSet(psDevInfo->psKernelCCBCtl, 0, sizeof(PVRSRV_SGX_CCB_CTL));
if (!psDevInfo)
{
-
+
PVR_DPF((PVR_DBG_ERROR,"DevDeInitSGX: Null DevInfo"));
return PVRSRV_OK;
}
}
psDevInfo->hTimer = IMG_NULL;
}
-#endif
+#endif
#if defined(SUPPORT_EXTERNAL_SYSTEM_CACHE)
-
+
eError = MMU_UnmapExtSystemCacheRegs(psDeviceNode);
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR,"DevDeInitSGX: Failed to unmap ext system cache registers"));
return eError;
}
-#endif
+#endif
#if defined(FIX_HW_BRN_22997) && defined(FIX_HW_BRN_23030) && defined(SGX_FEATURE_HOST_PORT)
WorkaroundBRN22997Free(psDeviceNode);
-#endif
+#endif
MMU_BIFResetPDFree(psDevInfo);
-
+
DeinitDevInfo(psDevInfo);
-
+
psDeviceMemoryHeap = (DEVICE_MEMORY_HEAP_INFO *)psDevInfo->pvDeviceMemoryHeap;
for(ui32Heap=0; ui32Heap<psDeviceNode->sDevMemoryInfo.ui32HeapCount; ui32Heap++)
{
}
}
-
+
eError = BM_DestroyContext(psDeviceNode->sDevMemoryInfo.pBMKernelContext, IMG_NULL);
if (eError != PVRSRV_OK)
{
return eError;
}
-
+
eError = PVRSRVRemovePowerDevice (((PVRSRV_DEVICE_NODE*)pvDeviceNode)->sDevId.ui32DeviceIndex);
if (eError != PVRSRV_OK)
{
return eError;
}
-
+
if (!psSGXDeviceMap->pvRegsCpuVBase)
{
-
+
if (psDevInfo->pvRegsBaseKM != IMG_NULL)
{
OSUnMapPhysToLin(psDevInfo->pvRegsBaseKM,
#if defined(SGX_FEATURE_HOST_PORT)
if (psSGXDeviceMap->ui32Flags & SGX_HOSTPORT_PRESENT)
{
-
+
if (psDevInfo->pvHostPortBaseKM != IMG_NULL)
{
OSUnMapPhysToLin(psDevInfo->pvHostPortBaseKM,
IMG_NULL);
}
}
-#endif
-
+#endif
+
OSFreeMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
sizeof(PVRSRV_SGXDEV_INFO),
psDevInfo,
if (psDeviceMemoryHeap != IMG_NULL)
{
-
+
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP,
sizeof(DEVICE_MEMORY_HEAP_INFO) * SGX_MAX_HEAP_ID,
psDeviceMemoryHeap,
}
-#if defined(RESTRICTED_REGISTERS) && defined(SGX_FEATURE_MP)
-
-static IMG_VOID SGXDumpMasterDebugReg (PVRSRV_SGXDEV_INFO *psDevInfo,
- IMG_CHAR *pszName,
- IMG_UINT32 ui32RegAddr)
-{
- IMG_UINT32 ui32RegVal;
- ui32RegVal = OSReadHWReg(psDevInfo->pvRegsBaseKM, ui32RegAddr);
- PVR_LOG(("(HYD) %s%08X", pszName, ui32RegVal));
-}
-
-#endif
-
static IMG_VOID SGXDumpDebugReg (PVRSRV_SGXDEV_INFO *psDevInfo,
IMG_UINT32 ui32CoreNum,
IMG_CHAR *pszName,
SGXDumpDebugReg(psDevInfo, 0, "EUR_CR_CORE_ID: ", EUR_CR_CORE_ID);
SGXDumpDebugReg(psDevInfo, 0, "EUR_CR_CORE_REVISION: ", EUR_CR_CORE_REVISION);
-#if defined(RESTRICTED_REGISTERS) && defined(SGX_FEATURE_MP)
- SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_BIF_INT_STAT: ", EUR_CR_MASTER_BIF_INT_STAT);
- SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_BIF_FAULT: ",EUR_CR_MASTER_BIF_FAULT);
- SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_CLKGATESTATUS2: ",EUR_CR_MASTER_CLKGATESTATUS2 );
- SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_VDM_PIM_STATUS: ",EUR_CR_MASTER_VDM_PIM_STATUS);
- SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_BIF_BANK_SET: ",EUR_CR_MASTER_BIF_BANK_SET);
-
- SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_EVENT_STATUS: ",EUR_CR_MASTER_EVENT_STATUS);
- SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_EVENT_STATUS2: ",EUR_CR_MASTER_EVENT_STATUS2);
- SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_MP_PRIMITIVE: ",EUR_CR_MASTER_MP_PRIMITIVE);
- SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_DPM_DPLIST_STATUS: ",EUR_CR_MASTER_DPM_DPLIST_STATUS);
- SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_DPM_PROACTIVE_PIM_SPEC: ",EUR_CR_MASTER_DPM_PROACTIVE_PIM_SPEC);
- SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_PAGE_MANAGEOP: ",EUR_CR_MASTER_DPM_PAGE_MANAGEOP);
- SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_VDM_CONTEXT_STORE_SNAPSHOT: ",EUR_CR_MASTER_VDM_CONTEXT_STORE_SNAPSHOT);
- SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_VDM_CONTEXT_LOAD_STATUS: ",EUR_CR_MASTER_VDM_CONTEXT_LOAD_STATUS);
- SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_VDM_CONTEXT_STORE_STREAM: ",EUR_CR_MASTER_VDM_CONTEXT_STORE_STREAM);
- SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_VDM_CONTEXT_STORE_STATUS: ",EUR_CR_MASTER_VDM_CONTEXT_STORE_STATUS);
- SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_VDM_CONTEXT_STORE_STATE0: ",EUR_CR_MASTER_VDM_CONTEXT_STORE_STATE0);
- SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_VDM_CONTEXT_STORE_STATE1: ",EUR_CR_MASTER_VDM_CONTEXT_STORE_STATE1);
- SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_VDM_WAIT_FOR_KICK: ",EUR_CR_MASTER_VDM_WAIT_FOR_KICK);
-#endif
+
for (ui32CoreNum = 0; ui32CoreNum < SGX_FEATURE_MP_CORE_COUNT_3D; ui32CoreNum++)
{
-
+
SGXDumpDebugReg(psDevInfo, ui32CoreNum, "EUR_CR_EVENT_STATUS: ", EUR_CR_EVENT_STATUS);
SGXDumpDebugReg(psDevInfo, ui32CoreNum, "EUR_CR_EVENT_STATUS2: ", EUR_CR_EVENT_STATUS2);
SGXDumpDebugReg(psDevInfo, ui32CoreNum, "EUR_CR_BIF_CTRL: ", EUR_CR_BIF_CTRL);
}
}
-
+
QueueDumpDebugInfo();
{
-
+
SGXMKIF_HOST_CTL *psSGXHostCtl = psDevInfo->psSGXHostCtl;
IMG_UINT32 *pui32HostCtlBuffer = (IMG_UINT32 *)psSGXHostCtl;
}
{
-
+
IMG_UINT32 *pui32TA3DCtlBuffer = psDevInfo->psKernelSGXTA3DCtlMemInfo->pvLinAddrKM;
IMG_UINT32 ui32LoopCounter;
PVR_LOG(("Last SGX microkernel status code: %08X", ui32LastStatusCode));
#if defined(PVRSRV_DUMP_MK_TRACE)
-
+
{
IMG_UINT32 ui32LoopCounter;
pui32BufPtr[2], pui32BufPtr[3], pui32BufPtr[1], pui32BufPtr[0]));
}
}
- #endif
+ #endif
}
- #endif
+ #endif
{
-
+
PVR_LOG(("SGX Kernel CCB WO:0x%X RO:0x%X",
psDevInfo->psKernelCCBCtl->ui32WriteOffset,
psCommand->ui32Data[2], psCommand->ui32Data[3]));
}
}
- #endif
+ #endif
}
#if defined (TTRACE)
PVRSRVDumpTimeTraceBuffers();
PVR_UNREFERENCED_PARAMETER(ui32Component);
-
+
eError = PVRSRVPowerLock(ui32CallerID, IMG_FALSE);
if(eError != PVRSRV_OK)
{
-
+
PVR_DPF((PVR_DBG_WARNING,"HWRecoveryResetSGX: Power transition in progress"));
SGXDumpDebugInfo(psDeviceNode->pvDevice, IMG_TRUE);
-
+
PDUMPSUSPEND();
-
+
#if defined(FIX_HW_BRN_23281)
-
+
for (eError = PVRSRV_ERROR_RETRY; eError == PVRSRV_ERROR_RETRY;)
-#endif
+#endif
{
eError = SGXInitialise(psDevInfo, IMG_TRUE);
}
PVR_DPF((PVR_DBG_ERROR,"HWRecoveryResetSGX: SGXInitialise failed (%d)", eError));
}
-
+
PDUMPRESUME();
PVRSRVPowerUnlock(ui32CallerID);
-
+
SGXScheduleProcessQueuesKM(psDeviceNode);
-
-
+
+
PVRSRVProcessQueues(IMG_TRUE);
}
-#endif
+#endif
#if defined(SUPPORT_HW_RECOVERY)
PVRSRV_DEVICE_NODE *psDeviceNode = pvData;
PVRSRV_SGXDEV_INFO *psDevInfo = psDeviceNode->pvDevice;
static IMG_UINT32 ui32EDMTasks = 0;
- static IMG_UINT32 ui32LockupCounter = 0;
+ static IMG_UINT32 ui32LockupCounter = 0;
static IMG_UINT32 ui32OpenCLDelayCounter = 0;
static IMG_UINT32 ui32NumResets = 0;
#if defined(FIX_HW_BRN_31093)
IMG_BOOL bLockup = IMG_FALSE;
IMG_BOOL bPoweredDown;
-
+
psDevInfo->ui32TimeStamp++;
#if defined(NO_HARDWARE)
bPoweredDown = IMG_TRUE;
#else
bPoweredDown = (SGXIsDevicePowered(psDeviceNode)) ? IMG_FALSE : IMG_TRUE;
-#endif
-
-
+#endif
+
+
if (bPoweredDown)
{
ui32LockupCounter = 0;
}
else
{
-
+
ui32CurrentEDMTasks = OSReadHWReg(psDevInfo->pvRegsBaseKM, psDevInfo->ui32EDMTaskReg0);
if (psDevInfo->ui32EDMTaskReg1 != 0)
{
#if defined(FIX_HW_BRN_31093)
if (bBRN31093Inval == IMG_FALSE)
{
-
+
#if defined(FIX_HW_BRN_29997)
IMG_UINT32 ui32BIFCtrl;
ui32BIFCtrl = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_CTRL);
OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_CTRL, ui32BIFCtrl | EUR_CR_BIF_CTRL_PAUSE_MASK);
-
- SGXWaitClocks(psDevInfo, 200);
+
+ OSWaitus(200 * 1000000 / psDevInfo->ui32CoreClockSpeed);
#endif
-
+
bBRN31093Inval = IMG_TRUE;
-
+
OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_CTRL_INVAL, EUR_CR_BIF_CTRL_INVAL_PTE_MASK);
-
- SGXWaitClocks(psDevInfo, 200);
-
- #if defined(FIX_HW_BRN_29997)
-
+
+ OSWaitus(200 * 1000000 / psDevInfo->ui32CoreClockSpeed);
+
+ #if defined(FIX_HW_BRN_29997)
+
OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_CTRL, ui32BIFCtrl);
#endif
}
{
SGXMKIF_HOST_CTL *psSGXHostCtl = (SGXMKIF_HOST_CTL *)psDevInfo->psSGXHostCtl;
-
+
psSGXHostCtl->ui32HostDetectedLockups ++;
-
+
HWRecoveryResetSGX(psDeviceNode, 0, ISR_ID);
}
}
-#endif
+#endif
IMG_BOOL bInterruptProcessed = IMG_FALSE;
-
+
{
IMG_UINT32 ui32EventStatus, ui32EventEnable;
IMG_UINT32 ui32EventClear = 0;
#if defined(SGX_FEATURE_DATA_BREAKPOINTS)
IMG_UINT32 ui32EventStatus2, ui32EventEnable2;
-#endif
+#endif
IMG_UINT32 ui32EventClear2 = 0;
PVRSRV_DEVICE_NODE *psDeviceNode;
PVRSRV_SGXDEV_INFO *psDevInfo;
-
+
if(pvData == IMG_NULL)
{
PVR_DPF((PVR_DBG_ERROR, "SGX_ISRHandler: Invalid params\n"));
ui32EventStatus = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_STATUS);
ui32EventEnable = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_HOST_ENABLE);
-
+
ui32EventStatus &= ui32EventEnable;
#if defined(SGX_FEATURE_DATA_BREAKPOINTS)
ui32EventStatus2 = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_STATUS2);
ui32EventEnable2 = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_HOST_ENABLE2);
-
+
ui32EventStatus2 &= ui32EventEnable2;
-#endif
-
+#endif
+
if (ui32EventStatus & EUR_CR_EVENT_STATUS_SW_EVENT_MASK)
{
{
ui32EventClear2 |= EUR_CR_EVENT_HOST_CLEAR2_DATA_BREAKPOINT_TRAPPED_MASK;
}
-#endif
+#endif
if (ui32EventClear || ui32EventClear2)
{
bInterruptProcessed = IMG_TRUE;
-
+
ui32EventClear |= EUR_CR_EVENT_HOST_CLEAR_MASTER_INTERRUPT_MASK;
-
+
OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_HOST_CLEAR, ui32EventClear);
OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_HOST_CLEAR2, ui32EventClear2);
}
SGXTestActivePowerEvent(psDeviceNode, ISR_ID);
}
-#endif
+#endif
#if defined(SUPPORT_MEMORY_TILING)
return PVRSRV_ERROR_INVALID_PARAMS;
}
-
+
psDevInfo->ui32MemTilingUsage &= ~(1<<ui32RangeIndex);
-
+
ui32Offset = EUR_CR_BIF_TILE0 + (ui32RangeIndex<<2);
ui32Val = 0;
-
+
OSWriteHWReg(psDevInfo->pvRegsBaseKM, ui32Offset, ui32Val);
PDUMPREG(SGX_PDUMPREG_NAME, ui32Offset, ui32Val);
psDevInfo->ui32CacheControl |= SGXMKIF_CC_INVAL_BIF_SL;
#else
PVR_UNREFERENCED_PARAMETER(psDevInfo);
- #endif
+ #endif
}
PVRSRV_ERROR SGXRegisterDevice (PVRSRV_DEVICE_NODE *psDeviceNode)
DEVICE_MEMORY_INFO *psDevMemoryInfo;
DEVICE_MEMORY_HEAP_INFO *psDeviceMemoryHeap;
-
+
psDeviceNode->sDevId.eDeviceType = DEV_DEVICE_TYPE;
psDeviceNode->sDevId.eDeviceClass = DEV_DEVICE_CLASS;
#if defined(PDUMP)
{
-
+
SGX_DEVICE_MAP *psSGXDeviceMemMap;
SysGetDeviceMemoryMap(PVRSRV_DEVICE_TYPE_SGX,
(IMG_VOID**)&psSGXDeviceMemMap);
psDeviceNode->sDevId.pszPDumpDevName = psSGXDeviceMemMap->pszPDumpDevName;
PVR_ASSERT(psDeviceNode->sDevId.pszPDumpDevName != IMG_NULL);
}
-
+
psDeviceNode->sDevId.pszPDumpRegName = SGX_PDUMPREG_NAME;
-#endif
+#endif
psDeviceNode->pfnInitDevice = &DevInitSGXPart1;
psDeviceNode->pfnDeInitDevice = &DevDeInitSGX;
psDeviceNode->pfnPDumpInitDevice = &SGXResetPDump;
psDeviceNode->pfnMMUGetContextID = &MMU_GetPDumpContextID;
#endif
-
+
psDeviceNode->pfnMMUInitialise = &MMU_Initialise;
psDeviceNode->pfnMMUFinalise = &MMU_Finalise;
psDeviceNode->pfnMMUGetPDPhysAddr = IMG_NULL;
#endif
#if defined (SYS_USING_INTERRUPTS)
-
+
psDeviceNode->pfnDeviceISR = SGX_ISRHandler;
psDeviceNode->pfnDeviceMISR = SGX_MISRHandler;
psDeviceNode->pfnFreeMemTilingRange = SGX_FreeMemTilingRange;
#endif
-
+
psDeviceNode->pfnDeviceCommandComplete = &SGXCommandComplete;
psDeviceNode->pfnCacheInvalidate = SGXCacheInvalidate;
-
+
psDevMemoryInfo = &psDeviceNode->sDevMemoryInfo;
-
+
psDevMemoryInfo->ui32AddressSpaceSizeLog2 = SGX_FEATURE_ADDRESS_SPACE_SIZE;
-
+
psDevMemoryInfo->ui32Flags = 0;
-
+
if(OSAllocMem( PVRSRV_OS_PAGEABLE_HEAP,
sizeof(DEVICE_MEMORY_HEAP_INFO) * SGX_MAX_HEAP_ID,
(IMG_VOID **)&psDevMemoryInfo->psDeviceMemoryHeap, 0,
psDeviceMemoryHeap = psDevMemoryInfo->psDeviceMemoryHeap;
-
+
psDeviceMemoryHeap->ui32DataPageSize = SGX_MMU_PAGE_SIZE;
#if !defined(SUPPORT_SGX_GENERAL_MAPPING_HEAP)
-
+
psDevMemoryInfo->ui32MappingHeapID = (IMG_UINT32)(psDeviceMemoryHeap - psDevMemoryInfo->psDeviceMemoryHeap);
#endif
psDeviceMemoryHeap++;
psDeviceMemoryHeap++;
#endif
-
+
psDeviceMemoryHeap->ui32HeapID = HEAP_ID( PVRSRV_DEVICE_TYPE_SGX, SGX_TADATA_HEAP_ID);
psDeviceMemoryHeap->sDevVAddrBase.uiAddr = SGX_TADATA_HEAP_BASE;
psDeviceMemoryHeap->ui32HeapSize = SGX_TADATA_HEAP_SIZE;
psDeviceMemoryHeap->pszName = "TA Data";
psDeviceMemoryHeap->pszBSName = "TA Data BS";
psDeviceMemoryHeap->DevMemHeapType = DEVICE_MEMORY_HEAP_PERCONTEXT;
-
+
psDeviceMemoryHeap->ui32DataPageSize = SGX_MMU_PAGE_SIZE;
psDeviceMemoryHeap++;
-
+
psDeviceMemoryHeap->ui32HeapID = HEAP_ID( PVRSRV_DEVICE_TYPE_SGX, SGX_KERNEL_CODE_HEAP_ID);
psDeviceMemoryHeap->sDevVAddrBase.uiAddr = SGX_KERNEL_CODE_HEAP_BASE;
psDeviceMemoryHeap->ui32HeapSize = SGX_KERNEL_CODE_HEAP_SIZE;
psDeviceMemoryHeap->pszName = "Kernel Code";
psDeviceMemoryHeap->pszBSName = "Kernel Code BS";
psDeviceMemoryHeap->DevMemHeapType = DEVICE_MEMORY_HEAP_SHARED_EXPORTED;
-
+
psDeviceMemoryHeap->ui32DataPageSize = SGX_MMU_PAGE_SIZE;
psDeviceMemoryHeap++;
-
+
psDeviceMemoryHeap->ui32HeapID = HEAP_ID( PVRSRV_DEVICE_TYPE_SGX, SGX_KERNEL_DATA_HEAP_ID);
psDeviceMemoryHeap->sDevVAddrBase.uiAddr = SGX_KERNEL_DATA_HEAP_BASE;
psDeviceMemoryHeap->ui32HeapSize = SGX_KERNEL_DATA_HEAP_SIZE;
psDeviceMemoryHeap->pszName = "KernelData";
psDeviceMemoryHeap->pszBSName = "KernelData BS";
psDeviceMemoryHeap->DevMemHeapType = DEVICE_MEMORY_HEAP_SHARED_EXPORTED;
-
+
psDeviceMemoryHeap->ui32DataPageSize = SGX_MMU_PAGE_SIZE;
psDeviceMemoryHeap++;
-
+
psDeviceMemoryHeap->ui32HeapID = HEAP_ID( PVRSRV_DEVICE_TYPE_SGX, SGX_PIXELSHADER_HEAP_ID);
psDeviceMemoryHeap->sDevVAddrBase.uiAddr = SGX_PIXELSHADER_HEAP_BASE;
-
+
psDeviceMemoryHeap->pszName = "PixelShaderUSSE";
psDeviceMemoryHeap->pszBSName = "PixelShaderUSSE BS";
psDeviceMemoryHeap->DevMemHeapType = DEVICE_MEMORY_HEAP_PERCONTEXT;
-
+
psDeviceMemoryHeap->ui32DataPageSize = SGX_MMU_PAGE_SIZE;
psDeviceMemoryHeap++;
-
+
psDeviceMemoryHeap->ui32HeapID = HEAP_ID( PVRSRV_DEVICE_TYPE_SGX, SGX_VERTEXSHADER_HEAP_ID);
psDeviceMemoryHeap->sDevVAddrBase.uiAddr = SGX_VERTEXSHADER_HEAP_BASE;
-
+
psDeviceMemoryHeap->ui32HeapSize = ((4 << SGX_USE_CODE_SEGMENT_RANGE_BITS) - 0x00001000);
PVR_ASSERT(psDeviceMemoryHeap->ui32HeapSize <= SGX_VERTEXSHADER_HEAP_SIZE);
psDeviceMemoryHeap->ui32Attribs = PVRSRV_HAP_WRITECOMBINE
psDeviceMemoryHeap->pszName = "VertexShaderUSSE";
psDeviceMemoryHeap->pszBSName = "VertexShaderUSSE BS";
psDeviceMemoryHeap->DevMemHeapType = DEVICE_MEMORY_HEAP_PERCONTEXT;
-
+
psDeviceMemoryHeap->ui32DataPageSize = SGX_MMU_PAGE_SIZE;
psDeviceMemoryHeap++;
-
+
psDeviceMemoryHeap->ui32HeapID = HEAP_ID( PVRSRV_DEVICE_TYPE_SGX, SGX_PDSPIXEL_CODEDATA_HEAP_ID);
psDeviceMemoryHeap->sDevVAddrBase.uiAddr = SGX_PDSPIXEL_CODEDATA_HEAP_BASE;
psDeviceMemoryHeap->ui32HeapSize = SGX_PDSPIXEL_CODEDATA_HEAP_SIZE;
psDeviceMemoryHeap->pszName = "PDSPixelCodeData";
psDeviceMemoryHeap->pszBSName = "PDSPixelCodeData BS";
psDeviceMemoryHeap->DevMemHeapType = DEVICE_MEMORY_HEAP_PERCONTEXT;
-
+
psDeviceMemoryHeap->ui32DataPageSize = SGX_MMU_PAGE_SIZE;
psDeviceMemoryHeap++;
-
+
psDeviceMemoryHeap->ui32HeapID = HEAP_ID( PVRSRV_DEVICE_TYPE_SGX, SGX_PDSVERTEX_CODEDATA_HEAP_ID);
psDeviceMemoryHeap->sDevVAddrBase.uiAddr = SGX_PDSVERTEX_CODEDATA_HEAP_BASE;
psDeviceMemoryHeap->ui32HeapSize = SGX_PDSVERTEX_CODEDATA_HEAP_SIZE;
psDeviceMemoryHeap->pszName = "PDSVertexCodeData";
psDeviceMemoryHeap->pszBSName = "PDSVertexCodeData BS";
psDeviceMemoryHeap->DevMemHeapType = DEVICE_MEMORY_HEAP_PERCONTEXT;
-
+
psDeviceMemoryHeap->ui32DataPageSize = SGX_MMU_PAGE_SIZE;
psDeviceMemoryHeap++;
-
+
psDeviceMemoryHeap->ui32HeapID = HEAP_ID( PVRSRV_DEVICE_TYPE_SGX, SGX_SYNCINFO_HEAP_ID);
psDeviceMemoryHeap->sDevVAddrBase.uiAddr = SGX_SYNCINFO_HEAP_BASE;
psDeviceMemoryHeap->ui32HeapSize = SGX_SYNCINFO_HEAP_SIZE;
psDeviceMemoryHeap->pszName = "CacheCoherent";
psDeviceMemoryHeap->pszBSName = "CacheCoherent BS";
psDeviceMemoryHeap->DevMemHeapType = DEVICE_MEMORY_HEAP_SHARED_EXPORTED;
-
+
psDeviceMemoryHeap->ui32DataPageSize = SGX_MMU_PAGE_SIZE;
-
+
psDevMemoryInfo->ui32SyncHeapID = (IMG_UINT32)(psDeviceMemoryHeap - psDevMemoryInfo->psDeviceMemoryHeap);
psDeviceMemoryHeap++;
-
+
psDeviceMemoryHeap->ui32HeapID = HEAP_ID( PVRSRV_DEVICE_TYPE_SGX, SGX_SHARED_3DPARAMETERS_HEAP_ID);
psDeviceMemoryHeap->sDevVAddrBase.uiAddr = SGX_SHARED_3DPARAMETERS_HEAP_BASE;
psDeviceMemoryHeap->ui32HeapSize = SGX_SHARED_3DPARAMETERS_HEAP_SIZE;
| PVRSRV_HAP_MULTI_PROCESS;
psDeviceMemoryHeap->DevMemHeapType = DEVICE_MEMORY_HEAP_SHARED_EXPORTED;
-
+
psDeviceMemoryHeap->ui32DataPageSize = SGX_MMU_PAGE_SIZE;
psDeviceMemoryHeap++;
-
+
psDeviceMemoryHeap->ui32HeapID = HEAP_ID( PVRSRV_DEVICE_TYPE_SGX, SGX_PERCONTEXT_3DPARAMETERS_HEAP_ID);
psDeviceMemoryHeap->sDevVAddrBase.uiAddr = SGX_PERCONTEXT_3DPARAMETERS_HEAP_BASE;
psDeviceMemoryHeap->ui32HeapSize = SGX_PERCONTEXT_3DPARAMETERS_HEAP_SIZE;
| PVRSRV_MEM_RAM_BACKED_ALLOCATION
| PVRSRV_HAP_SINGLE_PROCESS;
psDeviceMemoryHeap->DevMemHeapType = DEVICE_MEMORY_HEAP_PERCONTEXT;
-
+
psDeviceMemoryHeap->ui32DataPageSize = SGX_MMU_PAGE_SIZE;
psDeviceMemoryHeap++;
#if defined(SUPPORT_SGX_GENERAL_MAPPING_HEAP)
-
+
psDeviceMemoryHeap->ui32HeapID = HEAP_ID( PVRSRV_DEVICE_TYPE_SGX, SGX_GENERAL_MAPPING_HEAP_ID);
psDeviceMemoryHeap->sDevVAddrBase.uiAddr = SGX_GENERAL_MAPPING_HEAP_BASE;
psDeviceMemoryHeap->ui32HeapSize = SGX_GENERAL_MAPPING_HEAP_SIZE;
psDeviceMemoryHeap->pszName = "GeneralMapping";
psDeviceMemoryHeap->pszBSName = "GeneralMapping BS";
#if defined(SGX_FEATURE_MULTIPLE_MEM_CONTEXTS) && defined(FIX_HW_BRN_23410)
-
+
psDeviceMemoryHeap->DevMemHeapType = DEVICE_MEMORY_HEAP_SHARED_EXPORTED;
- #else
+ #else
psDeviceMemoryHeap->DevMemHeapType = DEVICE_MEMORY_HEAP_PERCONTEXT;
- #endif
-
+ #endif
+
psDeviceMemoryHeap->ui32DataPageSize = SGX_MMU_PAGE_SIZE;
-
+
psDevMemoryInfo->ui32MappingHeapID = (IMG_UINT32)(psDeviceMemoryHeap - psDevMemoryInfo->psDeviceMemoryHeap);
psDeviceMemoryHeap++;
-#endif
+#endif
#if defined(SGX_FEATURE_2D_HARDWARE)
-
+
psDeviceMemoryHeap->ui32HeapID = HEAP_ID( PVRSRV_DEVICE_TYPE_SGX, SGX_2D_HEAP_ID);
psDeviceMemoryHeap->sDevVAddrBase.uiAddr = SGX_2D_HEAP_BASE;
psDeviceMemoryHeap->ui32HeapSize = SGX_2D_HEAP_SIZE;
| PVRSRV_HAP_SINGLE_PROCESS;
psDeviceMemoryHeap->pszName = "2D";
psDeviceMemoryHeap->pszBSName = "2D BS";
-
+
psDeviceMemoryHeap->DevMemHeapType = DEVICE_MEMORY_HEAP_SHARED_EXPORTED;
-
+
psDeviceMemoryHeap->ui32DataPageSize = SGX_MMU_PAGE_SIZE;
psDeviceMemoryHeap++;
-#endif
+#endif
#if defined(FIX_HW_BRN_26915)
-
-
+
+
psDeviceMemoryHeap->ui32HeapID = HEAP_ID( PVRSRV_DEVICE_TYPE_SGX, SGX_CGBUFFER_HEAP_ID);
psDeviceMemoryHeap->sDevVAddrBase.uiAddr = SGX_CGBUFFER_HEAP_BASE;
psDeviceMemoryHeap->ui32HeapSize = SGX_CGBUFFER_HEAP_SIZE;
psDeviceMemoryHeap->pszBSName = "CGBuffer BS";
psDeviceMemoryHeap->DevMemHeapType = DEVICE_MEMORY_HEAP_PERCONTEXT;
-
+
psDeviceMemoryHeap->ui32DataPageSize = SGX_MMU_PAGE_SIZE;
psDeviceMemoryHeap++;
-#endif
-
+#endif
+
psDevMemoryInfo->ui32HeapCount = (IMG_UINT32)(psDeviceMemoryHeap - psDevMemoryInfo->psDeviceMemoryHeap);
return PVRSRV_OK;
PVRSRV_SGXDEV_INFO *psDevInfo = (PVRSRV_SGXDEV_INFO *)(psDeviceNode->pvDevice);
psDevInfo->psKernelCCBInfo->ui32CCBDumpWOff = 0;
PVR_DPF((PVR_DBG_MESSAGE, "Reset pdump CCB write offset."));
-
+
return PVRSRV_OK;
}
-#endif
+#endif
IMG_EXPORT
{
PVRSRV_SGXDEV_INFO *psDevInfo = (PVRSRV_SGXDEV_INFO *)((PVRSRV_DEVICE_NODE *)hDevCookie)->pvDevice;
-
+
psDevInfo->ui32ClientRefCount++;
-
+
psClientInfo->ui32ProcessID = OSGetCurrentProcessIDKM();
-
+
OSMemCopy(&psClientInfo->asDevData, &psDevInfo->asSGXDevData, sizeof(psClientInfo->asDevData));
-
+
return PVRSRV_OK;
}
IMG_UINT32 ui32BuildOptions, ui32BuildOptionsMismatch;
#if !defined(NO_HARDWARE)
PPVRSRV_KERNEL_MEM_INFO psMemInfo;
- PVRSRV_SGX_MISCINFO_INFO *psSGXMiscInfoInt;
+ PVRSRV_SGX_MISCINFO_INFO *psSGXMiscInfoInt;
PVRSRV_SGX_MISCINFO_FEATURES *psSGXFeatures;
- SGX_MISCINFO_STRUCT_SIZES *psSGXStructSizes;
+ SGX_MISCINFO_STRUCT_SIZES *psSGXStructSizes;
IMG_BOOL bStructSizesFailed;
-
+
IMG_BOOL bCheckCoreRev;
const IMG_UINT32 aui32CoreRevExceptions[] =
{
IMG_UINT i;
#endif
-
+
if(psDeviceNode->sDevId.eDeviceType != PVRSRV_DEVICE_TYPE_SGX)
{
PVR_LOG(("(FAIL) SGXInit: Device not of type SGX"));
psDevInfo = psDeviceNode->pvDevice;
-
-
+
+
ui32BuildOptions = (SGX_BUILD_OPTIONS);
if (ui32BuildOptions != psDevInfo->ui32ClientBuildOptions)
{
#if !defined (NO_HARDWARE)
psMemInfo = psDevInfo->psKernelSGXMiscMemInfo;
-
+
psSGXMiscInfoInt = psMemInfo->pvLinAddrKM;
psSGXMiscInfoInt->ui32MiscInfoFlags = 0;
psSGXMiscInfoInt->ui32MiscInfoFlags |= PVRSRV_USSE_MISCINFO_GET_STRUCT_SIZES;
eError = SGXGetMiscInfoUkernel(psDevInfo, psDeviceNode, IMG_NULL);
-
+
if(eError != PVRSRV_OK)
{
PVR_LOG(("(FAIL) SGXInit: Unable to validate device DDK version"));
PVRVERSION_BUILD, psSGXFeatures->ui32DDKBuild));
}
-
+
if (psSGXFeatures->ui32CoreRevSW == 0)
{
-
+
PVR_LOG(("SGXInit: HW core rev (%x) check skipped.",
psSGXFeatures->ui32CoreRev));
}
else
{
-
+
bCheckCoreRev = IMG_TRUE;
for(i=0; i<ui32NumCoreExceptions; i+=2)
{
}
}
-
+
psSGXStructSizes = &((PVRSRV_SGX_MISCINFO_INFO*)(psMemInfo->pvLinAddrKM))->sSGXStructSizes;
bStructSizesFailed = IMG_FALSE;
PVR_DPF((PVR_DBG_MESSAGE, "SGXInit: SGXMKIF structure sizes match. [ OK ]"));
}
-
+
ui32BuildOptions = psSGXFeatures->ui32BuildOptions;
if (ui32BuildOptions != (SGX_BUILD_OPTIONS))
{
{
PVR_DPF((PVR_DBG_MESSAGE, "SGXInit: Driver and microkernel build options match. [ OK ]"));
}
-#endif
+#endif
eError = PVRSRV_OK;
chk_exit:
IMG_HANDLE hDevMemContext)
{
PVRSRV_ERROR eError;
- SGXMKIF_COMMAND sCommandData;
- PVRSRV_SGX_MISCINFO_INFO *psSGXMiscInfoInt;
- PVRSRV_SGX_MISCINFO_FEATURES *psSGXFeatures;
- SGX_MISCINFO_STRUCT_SIZES *psSGXStructSizes;
+ SGXMKIF_COMMAND sCommandData;
+ PVRSRV_SGX_MISCINFO_INFO *psSGXMiscInfoInt;
+ PVRSRV_SGX_MISCINFO_FEATURES *psSGXFeatures;
+ SGX_MISCINFO_STRUCT_SIZES *psSGXStructSizes;
PPVRSRV_KERNEL_MEM_INFO psMemInfo = psDevInfo->psKernelSGXMiscMemInfo;
psSGXMiscInfoInt->ui32MiscInfoFlags &= ~PVRSRV_USSE_MISCINFO_READY;
-
+
OSMemSet(psSGXFeatures, 0, sizeof(*psSGXFeatures));
OSMemSet(psSGXStructSizes, 0, sizeof(*psSGXStructSizes));
-
- sCommandData.ui32Data[1] = psMemInfo->sDevVAddr.uiAddr;
+
+ sCommandData.ui32Data[1] = psMemInfo->sDevVAddr.uiAddr;
PDUMPCOMMENT("Microkernel kick for SGXGetMiscInfo");
eError = SGXScheduleCCBCommandKM(psDeviceNode,
return eError;
}
-
+
#if !defined(NO_HARDWARE)
{
IMG_BOOL bExit;
}
} END_LOOP_UNTIL_TIMEOUT();
-
+
if (!bExit)
{
PVR_DPF((PVR_DBG_ERROR, "SGXGetMiscInfoUkernel: Timeout occurred waiting for misc info."));
return PVRSRV_ERROR_TIMEOUT;
}
}
-#endif
+#endif
return PVRSRV_OK;
}
PPVRSRV_KERNEL_MEM_INFO psMemInfo = psDevInfo->psKernelSGXMiscMemInfo;
IMG_UINT32 *pui32MiscInfoFlags = &((PVRSRV_SGX_MISCINFO_INFO*)(psMemInfo->pvLinAddrKM))->ui32MiscInfoFlags;
-
+
*pui32MiscInfoFlags = 0;
#if !defined(SUPPORT_SGX_EDM_MEMORY_DEBUG)
IMG_UINT32 ui32EndRegVal;
SGXMKIF_COMMAND sCommandData;
-
+
if(psMiscInfo->uData.sSGXBreakpointInfo.bBPEnable)
{
-
+
IMG_DEV_VIRTADDR sBPDevVAddr = psMiscInfo->uData.sSGXBreakpointInfo.sBPDevVAddr;
IMG_DEV_VIRTADDR sBPDevVAddrEnd = psMiscInfo->uData.sSGXBreakpointInfo.sBPDevVAddrEnd;
-
+
ui32StartRegVal = sBPDevVAddr.uiAddr & EUR_CR_BREAKPOINT0_START_ADDRESS_MASK;
ui32EndRegVal = sBPDevVAddrEnd.uiAddr & EUR_CR_BREAKPOINT0_END_ADDRESS_MASK;
ui32CtrlREnable = psMiscInfo->uData.sSGXBreakpointInfo.bRead;
ui32CtrlTrapEnable = psMiscInfo->uData.sSGXBreakpointInfo.bTrapped;
-
+
ui32RegVal = ((ui32MaskDM<<EUR_CR_BREAKPOINT0_MASK_DM_SHIFT) & EUR_CR_BREAKPOINT0_MASK_DM_MASK) |
((ui32CtrlWEnable<<EUR_CR_BREAKPOINT0_CTRL_WENABLE_SHIFT) & EUR_CR_BREAKPOINT0_CTRL_WENABLE_MASK) |
((ui32CtrlREnable<<EUR_CR_BREAKPOINT0_CTRL_RENABLE_SHIFT) & EUR_CR_BREAKPOINT0_CTRL_RENABLE_MASK) |
}
else
{
-
+
ui32RegVal = ui32StartRegVal = ui32EndRegVal = 0;
}
-
+
sCommandData.ui32Data[0] = psMiscInfo->uData.sSGXBreakpointInfo.ui32BPIndex;
sCommandData.ui32Data[1] = ui32StartRegVal;
sCommandData.ui32Data[2] = ui32EndRegVal;
sCommandData.ui32Data[3] = ui32RegVal;
-
+
psDevInfo->psSGXHostCtl->ui32BPSetClearSignal = 0;
PDUMPCOMMENT("Microkernel kick for setting a data breakpoint");
}
#if defined(NO_HARDWARE)
-
+
psDevInfo->psSGXHostCtl->ui32BPSetClearSignal = 0;
#else
{
if (psDevInfo->psSGXHostCtl->ui32BPSetClearSignal != 0)
{
bExit = IMG_TRUE;
-
+
psDevInfo->psSGXHostCtl->ui32BPSetClearSignal = 0;
break;
}
} END_LOOP_UNTIL_TIMEOUT();
-
+
if (!bExit)
{
PVR_DPF((PVR_DBG_ERROR, "SGXGetMiscInfoKM: Timeout occurred waiting BP set/clear"));
return PVRSRV_ERROR_TIMEOUT;
}
}
-#endif
+#endif
return PVRSRV_OK;
}
case SGX_MISC_INFO_REQUEST_POLL_BREAKPOINT:
{
+
-
-
+
#if !defined(NO_HARDWARE)
#if defined(SGX_FEATURE_MP)
#define NUM_PIPES_PLUS_ONE (SGX_FEATURE_PERPIPE_BKPT_REGS_NUMPIPES+1)
#endif
IMG_BOOL bTrappedBPAny;
-#endif
+#endif
IMG_BOOL bFoundOne;
#if defined(SGX_FEATURE_MP)
bTrappedBPMaster = !!(EUR_CR_MASTER_BREAKPOINT_TRAPPED_MASK & OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_MASTER_BREAKPOINT));
bTrappedBPAny = bTrappedBPMaster;
#if defined(SGX_FEATURE_PERPIPE_BKPT_REGS)
- ui32TrappedBPPipeNum = 0;
+ ui32TrappedBPPipeNum = 0;
#endif
for (ui32CoreNum = 0; ui32CoreNum < SGX_FEATURE_MP_CORE_COUNT_3D; ui32CoreNum++)
{
#if defined(SGX_FEATURE_PERPIPE_BKPT_REGS)
-
+
#define SGX_MP_CORE_PIPE_SELECT(r,c,p) \
for (ui32PipeNum = 0; ui32PipeNum < NUM_PIPES_PLUS_ONE; ui32PipeNum++)
{
bFoundOne =
- 0 != (EUR_CR_PARTITION_BREAKPOINT_TRAPPED_MASK &
- OSReadHWReg(psDevInfo->pvRegsBaseKM,
+ 0 != (EUR_CR_PARTITION_BREAKPOINT_TRAPPED_MASK &
+ OSReadHWReg(psDevInfo->pvRegsBaseKM,
SGX_MP_CORE_PIPE_SELECT(BREAKPOINT,
ui32CoreNum,
ui32PipeNum)));
ui32TrappedBPPipeNum = ui32PipeNum;
}
}
-#else
+#else
bFoundOne = !!(EUR_CR_BREAKPOINT_TRAPPED_MASK & OSReadHWReg(psDevInfo->pvRegsBaseKM, SGX_MP_CORE_SELECT(EUR_CR_BREAKPOINT, ui32CoreNum)));
if (bFoundOne)
{
bTrappedBPAny = IMG_TRUE;
ui32TrappedBPCoreNum = ui32CoreNum;
}
-#endif
+#endif
}
psMiscInfo->uData.sSGXBreakpointInfo.bTrappedBP = bTrappedBPAny;
-#else
+#else
#if defined(SGX_FEATURE_PERPIPE_BKPT_REGS)
#error Not yet considered the case for per-pipe regs in non-mp case
#endif
psMiscInfo->uData.sSGXBreakpointInfo.bTrappedBP = 0 != (EUR_CR_BREAKPOINT_TRAPPED_MASK & OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BREAKPOINT));
-#endif
+#endif
if (psMiscInfo->uData.sSGXBreakpointInfo.bTrappedBP)
{
#if defined(SGX_FEATURE_PERPIPE_BKPT_REGS)
ui32Info0 = OSReadHWReg(psDevInfo->pvRegsBaseKM, bTrappedBPMaster?EUR_CR_MASTER_BREAKPOINT_TRAP_INFO0:SGX_MP_CORE_PIPE_SELECT(BREAKPOINT_TRAP_INFO0, ui32TrappedBPCoreNum, ui32TrappedBPPipeNum));
ui32Info1 = OSReadHWReg(psDevInfo->pvRegsBaseKM, bTrappedBPMaster?EUR_CR_MASTER_BREAKPOINT_TRAP_INFO1:SGX_MP_CORE_PIPE_SELECT(BREAKPOINT_TRAP_INFO1, ui32TrappedBPCoreNum, ui32TrappedBPPipeNum));
-#else
+#else
ui32Info0 = OSReadHWReg(psDevInfo->pvRegsBaseKM, bTrappedBPMaster?EUR_CR_MASTER_BREAKPOINT_TRAP_INFO0:SGX_MP_CORE_SELECT(EUR_CR_BREAKPOINT_TRAP_INFO0, ui32TrappedBPCoreNum));
ui32Info1 = OSReadHWReg(psDevInfo->pvRegsBaseKM, bTrappedBPMaster?EUR_CR_MASTER_BREAKPOINT_TRAP_INFO1:SGX_MP_CORE_SELECT(EUR_CR_BREAKPOINT_TRAP_INFO1, ui32TrappedBPCoreNum));
-#endif
-#else
+#endif
+#else
ui32Info0 = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BREAKPOINT_TRAP_INFO0);
ui32Info1 = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BREAKPOINT_TRAP_INFO1);
-#endif
+#endif
#ifdef SGX_FEATURE_PERPIPE_BKPT_REGS
psMiscInfo->uData.sSGXBreakpointInfo.ui32BPIndex = (ui32Info1 & EUR_CR_PARTITION_BREAKPOINT_TRAP_INFO1_NUMBER_MASK) >> EUR_CR_PARTITION_BREAKPOINT_TRAP_INFO1_NUMBER_SHIFT;
psMiscInfo->uData.sSGXBreakpointInfo.bTrappedBPRead = !!(ui32Info1 & EUR_CR_PARTITION_BREAKPOINT_TRAP_INFO1_RNW_MASK);
psMiscInfo->uData.sSGXBreakpointInfo.ui32TrappedBPDataMaster = (ui32Info1 & EUR_CR_PARTITION_BREAKPOINT_TRAP_INFO1_DATA_MASTER_MASK) >> EUR_CR_PARTITION_BREAKPOINT_TRAP_INFO1_DATA_MASTER_SHIFT;
psMiscInfo->uData.sSGXBreakpointInfo.ui32TrappedBPTag = (ui32Info1 & EUR_CR_PARTITION_BREAKPOINT_TRAP_INFO1_TAG_MASK) >> EUR_CR_PARTITION_BREAKPOINT_TRAP_INFO1_TAG_SHIFT;
-#else
+#else
psMiscInfo->uData.sSGXBreakpointInfo.ui32BPIndex = (ui32Info1 & EUR_CR_BREAKPOINT_TRAP_INFO1_NUMBER_MASK) >> EUR_CR_BREAKPOINT_TRAP_INFO1_NUMBER_SHIFT;
psMiscInfo->uData.sSGXBreakpointInfo.sTrappedBPDevVAddr.uiAddr = ui32Info0 & EUR_CR_BREAKPOINT_TRAP_INFO0_ADDRESS_MASK;
psMiscInfo->uData.sSGXBreakpointInfo.ui32TrappedBPBurstLength = (ui32Info1 & EUR_CR_BREAKPOINT_TRAP_INFO1_SIZE_MASK) >> EUR_CR_BREAKPOINT_TRAP_INFO1_SIZE_SHIFT;
psMiscInfo->uData.sSGXBreakpointInfo.bTrappedBPRead = !!(ui32Info1 & EUR_CR_BREAKPOINT_TRAP_INFO1_RNW_MASK);
psMiscInfo->uData.sSGXBreakpointInfo.ui32TrappedBPDataMaster = (ui32Info1 & EUR_CR_BREAKPOINT_TRAP_INFO1_DATA_MASTER_MASK) >> EUR_CR_BREAKPOINT_TRAP_INFO1_DATA_MASTER_SHIFT;
psMiscInfo->uData.sSGXBreakpointInfo.ui32TrappedBPTag = (ui32Info1 & EUR_CR_BREAKPOINT_TRAP_INFO1_TAG_MASK) >> EUR_CR_BREAKPOINT_TRAP_INFO1_TAG_SHIFT;
-#endif
+#endif
#if defined(SGX_FEATURE_MP)
#if defined(SGX_FEATURE_PERPIPE_BKPT_REGS)
-
+
psMiscInfo->uData.sSGXBreakpointInfo.ui32CoreNum = bTrappedBPMaster?65535:(ui32TrappedBPCoreNum + (ui32TrappedBPPipeNum<<10));
-#else
-
+#else
+
psMiscInfo->uData.sSGXBreakpointInfo.ui32CoreNum = bTrappedBPMaster?65535:ui32TrappedBPCoreNum;
-#endif
-#else
+#endif
+#else
#if defined(SGX_FEATURE_PERPIPE_BKPT_REGS)
-
+
#error non-mp perpipe regs not yet supported
-#else
-
+#else
+
psMiscInfo->uData.sSGXBreakpointInfo.ui32CoreNum = 65534;
-#endif
-#endif
+#endif
+#endif
}
-#endif
+#endif
return PVRSRV_OK;
}
case SGX_MISC_INFO_REQUEST_RESUME_BREAKPOINT:
{
-
-
-
+
+
+
#if !defined(NO_HARDWARE)
#if defined(SGX_FEATURE_MP)
IMG_UINT32 ui32CoreNum;
#if defined(SGX_FEATURE_PERPIPE_BKPT_REGS)
IMG_UINT32 ui32PipeNum;
#endif
-#endif
+#endif
IMG_UINT32 ui32OldSeqNum, ui32NewSeqNum;
#if defined(SGX_FEATURE_MP)
ui32PipeNum = psMiscInfo->uData.sSGXBreakpointInfo.ui32CoreNum >> 10;
ui32CoreNum = psMiscInfo->uData.sSGXBreakpointInfo.ui32CoreNum & 1023;
bMaster = psMiscInfo->uData.sSGXBreakpointInfo.ui32CoreNum > 32767;
-#else
+#else
ui32CoreNum = psMiscInfo->uData.sSGXBreakpointInfo.ui32CoreNum;
bMaster = ui32CoreNum > SGX_FEATURE_MP_CORE_COUNT_3D;
-#endif
+#endif
if (bMaster)
{
-
-
+
+
ui32OldSeqNum = 0x1c & OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_MASTER_BREAKPOINT);
OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_MASTER_BREAKPOINT_TRAP, EUR_CR_MASTER_BREAKPOINT_TRAP_WRNOTIFY_MASK | EUR_CR_MASTER_BREAKPOINT_TRAP_CONTINUE_MASK);
do
while (ui32OldSeqNum == ui32NewSeqNum);
}
else
-#endif
+#endif
{
-
+
#if defined(SGX_FEATURE_PERPIPE_BKPT_REGS)
ui32OldSeqNum = 0x1c & OSReadHWReg(psDevInfo->pvRegsBaseKM, SGX_MP_CORE_PIPE_SELECT(BREAKPOINT, ui32CoreNum, ui32PipeNum));
OSWriteHWReg(psDevInfo->pvRegsBaseKM, SGX_MP_CORE_PIPE_SELECT(BREAKPOINT_TRAP, ui32CoreNum, ui32PipeNum), EUR_CR_PARTITION_BREAKPOINT_TRAP_WRNOTIFY_MASK | EUR_CR_PARTITION_BREAKPOINT_TRAP_CONTINUE_MASK);
ui32NewSeqNum = 0x1c & OSReadHWReg(psDevInfo->pvRegsBaseKM, SGX_MP_CORE_PIPE_SELECT(BREAKPOINT, ui32CoreNum, ui32PipeNum));
}
while (ui32OldSeqNum == ui32NewSeqNum);
-#else
+#else
ui32OldSeqNum = 0x1c & OSReadHWReg(psDevInfo->pvRegsBaseKM, SGX_MP_CORE_SELECT(EUR_CR_BREAKPOINT, ui32CoreNum));
OSWriteHWReg(psDevInfo->pvRegsBaseKM, SGX_MP_CORE_SELECT(EUR_CR_BREAKPOINT_TRAP, ui32CoreNum), EUR_CR_BREAKPOINT_TRAP_WRNOTIFY_MASK | EUR_CR_BREAKPOINT_TRAP_CONTINUE_MASK);
do
ui32NewSeqNum = 0x1c & OSReadHWReg(psDevInfo->pvRegsBaseKM, SGX_MP_CORE_SELECT(EUR_CR_BREAKPOINT, ui32CoreNum));
}
while (ui32OldSeqNum == ui32NewSeqNum);
-#endif
+#endif
}
-#endif
+#endif
return PVRSRV_OK;
}
-#endif
+#endif
case SGX_MISC_INFO_REQUEST_CLOCKSPEED:
{
case SGX_MISC_INFO_REQUEST_SPM:
{
-
+
return PVRSRV_OK;
}
}
psSGXFeatures = &((PVRSRV_SGX_MISCINFO_INFO*)(psMemInfo->pvLinAddrKM))->sSGXFeatures;
-
+
psMiscInfo->uData.sSGXFeatures = *psSGXFeatures;
-
+
PVR_DPF((PVR_DBG_MESSAGE, "SGXGetMiscInfoKM: Core 0x%x, sw ID 0x%x, sw Rev 0x%x\n",
psSGXFeatures->ui32CoreRev,
psSGXFeatures->ui32CoreIdSW,
psSGXFeatures->ui32DDKVersion,
psSGXFeatures->ui32DDKBuild));
-
+
return PVRSRV_OK;
}
psSGXFeatures = &((PVRSRV_SGX_MISCINFO_INFO*)(psMemInfo->pvLinAddrKM))->sSGXFeatures;
-
+
OSMemSet(psMemInfo->pvLinAddrKM, 0,
sizeof(PVRSRV_SGX_MISCINFO_INFO));
PVRVERSION_BRANCH;
psSGXFeatures->ui32DDKBuild = PVRVERSION_BUILD;
-
+
psSGXFeatures->ui32BuildOptions = (SGX_BUILD_OPTIONS);
#if defined(PVRSRV_USSE_EDM_STATUS_DEBUG)
-
+
psSGXFeatures->sDevVAEDMStatusBuffer = psDevInfo->psKernelEDMStatusBufferMemInfo->sDevVAddr;
psSGXFeatures->pvEDMStatusBuffer = psDevInfo->psKernelEDMStatusBufferMemInfo->pvLinAddrKM;
#endif
-
+
psMiscInfo->uData.sSGXFeatures = *psSGXFeatures;
return PVRSRV_OK;
}
{
PVRSRV_ERROR eError;
PVRSRV_SGX_MISCINFO_FEATURES *psSGXFeatures;
- PVRSRV_SGX_MISCINFO_MEMACCESS *psSGXMemSrc;
- PVRSRV_SGX_MISCINFO_MEMACCESS *psSGXMemDest;
-
- {
+ PVRSRV_SGX_MISCINFO_MEMACCESS *psSGXMemSrc;
+ PVRSRV_SGX_MISCINFO_MEMACCESS *psSGXMemDest;
+ {
+
*pui32MiscInfoFlags |= PVRSRV_USSE_MISCINFO_MEMREAD;
psSGXMemSrc = &((PVRSRV_SGX_MISCINFO_INFO*)(psMemInfo->pvLinAddrKM))->sSGXMemAccessSrc;
if(psMiscInfo->sDevVAddrSrc.uiAddr != 0)
{
- psSGXMemSrc->sDevVAddr = psMiscInfo->sDevVAddrSrc;
+ psSGXMemSrc->sDevVAddr = psMiscInfo->sDevVAddrSrc;
}
else
{
return PVRSRV_ERROR_INVALID_PARAMS;
- }
+ }
}
if( psMiscInfo->eRequest == SGX_MISC_INFO_REQUEST_MEMCOPY)
- {
-
+ {
+
*pui32MiscInfoFlags |= PVRSRV_USSE_MISCINFO_MEMWRITE;
psSGXMemDest = &((PVRSRV_SGX_MISCINFO_INFO*)(psMemInfo->pvLinAddrKM))->sSGXMemAccessDest;
-
+
if(psMiscInfo->sDevVAddrDest.uiAddr != 0)
{
- psSGXMemDest->sDevVAddr = psMiscInfo->sDevVAddrDest;
+ psSGXMemDest->sDevVAddr = psMiscInfo->sDevVAddrDest;
}
else
{
}
}
-
+
if(psMiscInfo->hDevMemContext != IMG_NULL)
{
SGXGetMMUPDAddrKM( (IMG_HANDLE)psDeviceNode, hDevMemContext, &psSGXMemSrc->sPDDevPAddr);
-
-
+
+
psSGXMemDest->sPDDevPAddr = psSGXMemSrc->sPDDevPAddr;
}
else
return PVRSRV_ERROR_INVALID_PARAMS;
}
-
+
eError = SGXGetMiscInfoUkernel(psDevInfo, psDeviceNode);
if(eError != PVRSRV_OK)
{
return PVRSRV_ERROR_INVALID_MISCINFO;
}
#endif
-
+
psMiscInfo->uData.sSGXFeatures = *psSGXFeatures;
return PVRSRV_OK;
}
-#endif
+#endif
#if defined(SUPPORT_SGX_HWPERF)
case SGX_MISC_INFO_REQUEST_SET_HWPERF_STATUS:
PVRSRV_SGX_HWPERF_STATUS_MK_EXECUTION_ON;
SGXMKIF_COMMAND sCommandData = {0};
-
+
if ((psSetHWPerfStatus->ui32NewHWPerfStatus & ~ui32ValidFlags) != 0)
{
return PVRSRV_ERROR_INVALID_PARAMS;
PDUMPCOMMENTWITHFLAGS(PDUMP_FLAGS_CONTINUOUS,
"SGX ukernel HWPerf status %u\n",
psSetHWPerfStatus->ui32NewHWPerfStatus);
- #endif
-
+ #endif
+
#if defined(SGX_FEATURE_EXTENDED_PERF_COUNTERS)
OSMemCopy(&psDevInfo->psSGXHostCtl->aui32PerfGroup[0],
&psSetHWPerfStatus->aui32PerfGroup[0],
sizeof(psDevInfo->psSGXHostCtl->aui32PerfBit),
PDUMP_FLAGS_CONTINUOUS,
MAKEUNIQUETAG(psDevInfo->psKernelSGXHostCtlMemInfo));
- #endif
+ #endif
#else
psDevInfo->psSGXHostCtl->ui32PerfGroup = psSetHWPerfStatus->ui32PerfGroup;
#if defined(PDUMP)
sizeof(psDevInfo->psSGXHostCtl->ui32PerfGroup),
PDUMP_FLAGS_CONTINUOUS,
MAKEUNIQUETAG(psDevInfo->psKernelSGXHostCtlMemInfo));
- #endif
- #endif
-
+ #endif
+ #endif
+
sCommandData.ui32Data[0] = psSetHWPerfStatus->ui32NewHWPerfStatus;
eError = SGXScheduleCCBCommandKM(psDeviceNode,
SGXMKIF_CMD_SETHWPERFSTATUS,
IMG_FALSE);
return eError;
}
-#endif
+#endif
case SGX_MISC_INFO_DUMP_DEBUG_INFO:
{
PVR_LOG(("User requested SGX debug info"));
-
+
SGXDumpDebugInfo(psDeviceNode->pvDevice, IMG_FALSE);
return PVRSRV_OK;
default:
{
-
+
return PVRSRV_ERROR_INVALID_PARAMS;
}
}
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
-#include <stddef.h>
+#include <stddef.h>
#include "services_headers.h"
#include "sgxinfo.h"
#include "sgxinfokm.h"
PVR_TTRACE(PVRSRV_TRACE_GROUP_KICK, PVRSRV_TRACE_CLASS_FUNCTION_EXIT, KICK_TOKEN_DOKICK);
return PVRSRV_ERROR_INVALID_PARAMS;
}
-
-
+
+
psTACmd = CCB_DATA_FROM_OFFSET(SGXMKIF_CMDTA_SHARED, psCCBMemInfo, psCCBKick, ui32CCBOffset);
PVR_TTRACE(PVRSRV_TRACE_GROUP_KICK, PVRSRV_TRACE_CLASS_CMD_START, KICK_TOKEN_DOKICK);
PVR_TTRACE_UI32(PVRSRV_TRACE_GROUP_KICK, PVRSRV_TRACE_CLASS_CCB,
KICK_TOKEN_CCB_OFFSET, psCCBKick->ui32CCBOffset);
-
+
if (psCCBKick->hTA3DSyncInfo)
{
psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *)psCCBKick->hTA3DSyncInfo;
psTACmd->ui32NumTAStatusVals = psCCBKick->ui32NumTAStatusVals;
if (psCCBKick->ui32NumTAStatusVals != 0)
{
-
+
for (i = 0; i < psCCBKick->ui32NumTAStatusVals; i++)
{
#if defined(SUPPORT_SGX_NEW_STATUS_VALS)
psTACmd->ui32Num3DStatusVals = psCCBKick->ui32Num3DStatusVals;
if (psCCBKick->ui32Num3DStatusVals != 0)
{
-
+
for (i = 0; i < psCCBKick->ui32Num3DStatusVals; i++)
{
#if defined(SUPPORT_SGX_NEW_STATUS_VALS)
#if defined(SUPPORT_SGX_GENERALISED_SYNCOBJECTS)
-
+
psTACmd->ui32NumTASrcSyncs = psCCBKick->ui32NumTASrcSyncs;
for (i=0; i<psCCBKick->ui32NumTASrcSyncs; i++)
{
psTACmd->asTASrcSyncs[i].sWriteOpsCompleteDevVAddr = psSyncInfo->sWriteOpsCompleteDevVAddr;
psTACmd->asTASrcSyncs[i].sReadOpsCompleteDevVAddr = psSyncInfo->sReadOpsCompleteDevVAddr;
-
+
psTACmd->asTASrcSyncs[i].ui32ReadOpsPendingVal = psSyncInfo->psSyncData->ui32ReadOpsPending++;
-
+
psTACmd->asTASrcSyncs[i].ui32WriteOpsPendingVal = psSyncInfo->psSyncData->ui32WriteOpsPending;
}
psTACmd->asTADstSyncs[i].sWriteOpsCompleteDevVAddr = psSyncInfo->sWriteOpsCompleteDevVAddr;
psTACmd->asTADstSyncs[i].sReadOpsCompleteDevVAddr = psSyncInfo->sReadOpsCompleteDevVAddr;
-
+
psTACmd->asTADstSyncs[i].ui32ReadOpsPendingVal = psSyncInfo->psSyncData->ui32ReadOpsPending;
-
+
psTACmd->asTADstSyncs[i].ui32WriteOpsPendingVal = psSyncInfo->psSyncData->ui32WriteOpsPending++;
}
psTACmd->as3DSrcSyncs[i].sWriteOpsCompleteDevVAddr = psSyncInfo->sWriteOpsCompleteDevVAddr;
psTACmd->as3DSrcSyncs[i].sReadOpsCompleteDevVAddr = psSyncInfo->sReadOpsCompleteDevVAddr;
-
+
psTACmd->as3DSrcSyncs[i].ui32ReadOpsPendingVal = psSyncInfo->psSyncData->ui32ReadOpsPending++;
-
+
psTACmd->as3DSrcSyncs[i].ui32WriteOpsPendingVal = psSyncInfo->psSyncData->ui32WriteOpsPending;
}
-#else
-
+#else
+
psTACmd->ui32NumSrcSyncs = psCCBKick->ui32NumSrcSyncs;
for (i=0; i<psCCBKick->ui32NumSrcSyncs; i++)
{
psTACmd->asSrcSyncs[i].sWriteOpsCompleteDevVAddr = psSyncInfo->sWriteOpsCompleteDevVAddr;
psTACmd->asSrcSyncs[i].sReadOpsCompleteDevVAddr = psSyncInfo->sReadOpsCompleteDevVAddr;
-
+
psTACmd->asSrcSyncs[i].ui32ReadOpsPendingVal = psSyncInfo->psSyncData->ui32ReadOpsPending++;
-
+
psTACmd->asSrcSyncs[i].ui32WriteOpsPendingVal = psSyncInfo->psSyncData->ui32WriteOpsPending;
}
#endif
if ((psSyncInfo->psSyncData->ui32LastOpDumpVal == 0) &&
(psSyncInfo->psSyncData->ui32LastReadOpDumpVal == 0))
{
-
+
PDUMPCOMMENT("Init RT ROpsComplete\r\n");
PDUMPMEM(&psSyncInfo->psSyncData->ui32LastReadOpDumpVal,
psSyncInfo->psSyncDataMemInfoKM,
sizeof(psSyncInfo->psSyncData->ui32ReadOpsComplete),
0,
MAKEUNIQUETAG(psSyncInfo->psSyncDataMemInfoKM));
-
+
PDUMPCOMMENT("Init RT WOpsComplete\r\n");
PDUMPMEM(&psSyncInfo->psSyncData->ui32LastOpDumpVal,
psSyncInfo->psSyncDataMemInfoKM,
0,
MAKEUNIQUETAG(psHWDstSyncListMemInfo));
}
- #endif
+ #endif
}
else
{
}
}
}
-
-
+
+
psTACmd->ui32CtrlFlags |= SGXMKIF_CMDTA_CTRLFLAGS_READY;
if ((psSyncInfo->psSyncData->ui32LastOpDumpVal == 0) &&
(psSyncInfo->psSyncData->ui32LastReadOpDumpVal == 0))
{
-
+
PDUMPCOMMENT("Init RT TA-SRC ROpsComplete\r\n", i);
PDUMPMEM(&psSyncInfo->psSyncData->ui32LastReadOpDumpVal,
psSyncInfo->psSyncDataMemInfoKM,
sizeof(psSyncInfo->psSyncData->ui32ReadOpsComplete),
0,
MAKEUNIQUETAG(psSyncInfo->psSyncDataMemInfoKM));
-
+
PDUMPCOMMENT("Init RT TA-SRC WOpsComplete\r\n");
PDUMPMEM(&psSyncInfo->psSyncData->ui32LastOpDumpVal,
psSyncInfo->psSyncDataMemInfoKM,
if ((psSyncInfo->psSyncData->ui32LastOpDumpVal == 0) &&
(psSyncInfo->psSyncData->ui32LastReadOpDumpVal == 0))
{
-
+
PDUMPCOMMENT("Init RT TA-DST ROpsComplete\r\n", i);
PDUMPMEM(&psSyncInfo->psSyncData->ui32LastReadOpDumpVal,
psSyncInfo->psSyncDataMemInfoKM,
sizeof(psSyncInfo->psSyncData->ui32ReadOpsComplete),
0,
MAKEUNIQUETAG(psSyncInfo->psSyncDataMemInfoKM));
-
+
PDUMPCOMMENT("Init RT TA-DST WOpsComplete\r\n");
PDUMPMEM(&psSyncInfo->psSyncData->ui32LastOpDumpVal,
psSyncInfo->psSyncDataMemInfoKM,
if ((psSyncInfo->psSyncData->ui32LastOpDumpVal == 0) &&
(psSyncInfo->psSyncData->ui32LastReadOpDumpVal == 0))
{
-
+
PDUMPCOMMENT("Init RT 3D-SRC ROpsComplete\r\n", i);
PDUMPMEM(&psSyncInfo->psSyncData->ui32LastReadOpDumpVal,
psSyncInfo->psSyncDataMemInfoKM,
sizeof(psSyncInfo->psSyncData->ui32ReadOpsComplete),
0,
MAKEUNIQUETAG(psSyncInfo->psSyncDataMemInfoKM));
-
+
PDUMPCOMMENT("Init RT 3D-SRC WOpsComplete\r\n");
PDUMPMEM(&psSyncInfo->psSyncData->ui32LastOpDumpVal,
psSyncInfo->psSyncDataMemInfoKM,
#endif
}
}
-#endif
+#endif
PVR_TTRACE(PVRSRV_TRACE_GROUP_KICK, PVRSRV_TRACE_CLASS_CMD_END,
KICK_TOKEN_DOKICK);
{
for (i=0; i < psCCBKick->ui32NumDstSyncObjects; i++)
{
-
+
psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *)psCCBKick->pahDstSyncHandles[i];
if (psSyncInfo)
#if defined(NO_HARDWARE)
-
+
if (psCCBKick->hTA3DSyncInfo)
{
psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *)psCCBKick->hTA3DSyncInfo;
psSyncInfo->psSyncData->ui32ReadOpsComplete = psSyncInfo->psSyncData->ui32ReadOpsPending;
}
-
+
for (i = 0; i < psCCBKick->ui32NumTAStatusVals; i++)
{
#if defined(SUPPORT_SGX_NEW_STATUS_VALS)
PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo = (PVRSRV_KERNEL_MEM_INFO*)psCCBKick->asTAStatusUpdate[i].hKernelMemInfo;
-
+
*(IMG_UINT32*)((IMG_UINTPTR_T)psKernelMemInfo->pvLinAddrKM
+ (psTACmd->sCtlTAStatusInfo[i].sStatusDevAddr.uiAddr
- psKernelMemInfo->sDevVAddr.uiAddr)) = psTACmd->sCtlTAStatusInfo[i].ui32StatusValue;
}
#if defined(SUPPORT_SGX_GENERALISED_SYNCOBJECTS)
-
+
for (i=0; i<psCCBKick->ui32NumTASrcSyncs; i++)
{
psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *) psCCBKick->ahTASrcKernelSyncInfo[i];
psSyncInfo->psSyncData->ui32ReadOpsComplete = psSyncInfo->psSyncData->ui32ReadOpsPending;
}
#else
-
+
for (i=0; i<psCCBKick->ui32NumSrcSyncs; i++)
{
psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *) psCCBKick->ahSrcKernelSyncInfo[i];
}
}
-
+
for (i = 0; i < psCCBKick->ui32Num3DStatusVals; i++)
{
#if defined(SUPPORT_SGX_NEW_STATUS_VALS)
PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo = (PVRSRV_KERNEL_MEM_INFO*)psCCBKick->as3DStatusUpdate[i].hKernelMemInfo;
-
+
*(IMG_UINT32*)((IMG_UINTPTR_T)psKernelMemInfo->pvLinAddrKM
+ (psTACmd->sCtl3DStatusInfo[i].sStatusDevAddr.uiAddr
- psKernelMemInfo->sDevVAddr.uiAddr)) = psTACmd->sCtl3DStatusInfo[i].ui32StatusValue;
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
SGX_TIMING_INFORMATION *psSGXTimingInfo,
IMG_HANDLE *phTimer)
{
-
+
*phTimer = OSAddTimer(SGXOSTimer, psDeviceNode,
return PVRSRV_OK;
}
-#endif
+#endif
static PVRSRV_ERROR SGXUpdateTimingInfo(PVRSRV_DEVICE_NODE *psDeviceNode)
ui32OlduKernelFreq = psDevInfo->ui32CoreClockSpeed / psDevInfo->ui32uKernelTimerClock;
if (ui32OlduKernelFreq != psSGXTimingInfo->ui32uKernelFreq)
{
-
+
IMG_HANDLE hNewTimer;
-
+
eError = SGXAddTimer(psDeviceNode, psSGXTimingInfo, &hNewTimer);
if (eError == PVRSRV_OK)
{
}
else
{
-
+
}
}
}
psDevInfo->psSGXHostCtl->ui32HWRecoverySampleRate =
psSGXTimingInfo->ui32uKernelFreq / psSGXTimingInfo->ui32HWRecoveryFreq;
}
-#endif
-
+#endif
+
psDevInfo->ui32CoreClockSpeed = psSGXTimingInfo->ui32CoreClockSpeed;
psDevInfo->ui32uKernelTimerClock = psSGXTimingInfo->ui32CoreClockSpeed / psSGXTimingInfo->ui32uKernelFreq;
-
+
psDevInfo->psSGXHostCtl->ui32uKernelTimerClock = psDevInfo->ui32uKernelTimerClock;
#if defined(PDUMP)
PDUMPCOMMENT("Host Control - Microkernel clock");
offsetof(SGXMKIF_HOST_CTL, ui32uKernelTimerClock),
sizeof(IMG_UINT32), PDUMP_FLAGS_CONTINUOUS,
MAKEUNIQUETAG(psDevInfo->psKernelSGXHostCtlMemInfo));
-#endif
+#endif
if (psSGXTimingInfo->bEnableActivePM)
{
ui32ActivePowManSampleRate =
psSGXTimingInfo->ui32uKernelFreq * psSGXTimingInfo->ui32ActivePowManLatencyms / 1000;
-
+
offsetof(SGXMKIF_HOST_CTL, ui32ActivePowManSampleRate),
sizeof(IMG_UINT32), PDUMP_FLAGS_CONTINUOUS,
MAKEUNIQUETAG(psDevInfo->psKernelSGXHostCtlMemInfo));
-#endif
+#endif
return PVRSRV_OK;
}
}
#else
PVR_UNREFERENCED_PARAMETER(psDevInfo);
- #endif
+ #endif
}
#if !defined(NO_HARDWARE)
PVR_ASSERT(psDevInfo != IMG_NULL);
-
+
if (PollForValueKM((IMG_UINT32 *)psDevInfo->pvRegsBaseKM + (ui32Register >> 2),
0,
ui32RegisterValue,
SGXDumpDebugInfo(psDevInfo, IMG_FALSE);
PVR_DBG_BREAK;
}
- #endif
+ #endif
PDUMPCOMMENT("%s", pszComment);
PDUMPREGPOL(SGX_PDUMPREG_NAME, ui32Register, 0, ui32RegisterValue, PDUMP_POLL_OPERATOR_EQUAL);
IMG_UINT32 ui32CoresEnabled;
#if defined(SUPPORT_HW_RECOVERY)
-
+
eError = OSDisableTimer(psDevInfo->hTimer);
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR,"SGXPrePowerState: Failed to disable timer"));
return eError;
}
- #endif
+ #endif
if (eNewPowerState == PVRSRV_DEV_POWER_STATE_OFF)
{
-
+
ui32PowerCmd = PVRSRV_POWERCMD_POWEROFF;
ui32CompleteStatus = PVRSRV_USSE_EDM_POWMAN_POWEROFF_COMPLETE;
PDUMPCOMMENT("SGX power off request");
}
else
{
-
+
ui32PowerCmd = PVRSRV_POWERCMD_IDLE;
ui32CompleteStatus = PVRSRV_USSE_EDM_POWMAN_IDLE_COMPLETE;
PDUMPCOMMENT("SGX idle request");
return eError;
}
-
+
#if !defined(NO_HARDWARE)
if (PollForValueKM(&psDevInfo->psSGXHostCtl->ui32PowerStatus,
ui32CompleteStatus,
SGXDumpDebugInfo(psDevInfo, IMG_FALSE);
PVR_DBG_BREAK;
}
- #endif
+ #endif
#if defined(PDUMP)
PDUMPCOMMENT("TA/3D CCB Control - Wait for power event on uKernel.");
PDUMP_POLL_OPERATOR_EQUAL,
0,
MAKEUNIQUETAG(psDevInfo->psKernelSGXHostCtlMemInfo));
- #endif
+ #endif
#if defined(SGX_FEATURE_MP)
ui32CoresEnabled = ((OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_MASTER_CORE) & EUR_CR_MASTER_CORE_ENABLE_MASK) >> EUR_CR_MASTER_CORE_ENABLE_SHIFT) + 1;
for (ui32Core = 0; ui32Core < ui32CoresEnabled; ui32Core++)
{
-
+
SGXPollForClockGating(psDevInfo,
SGX_MP_CORE_SELECT(psDevInfo->ui32ClkGateStatusReg, ui32Core),
psDevInfo->ui32ClkGateStatusMask,
}
#if defined(SGX_FEATURE_MP)
-
+
SGXPollForClockGating(psDevInfo,
psDevInfo->ui32MasterClkGateStatusReg,
psDevInfo->ui32MasterClkGateStatusMask,
psDevInfo->ui32MasterClkGateStatus2Reg,
psDevInfo->ui32MasterClkGateStatus2Mask,
"Wait for SGX master clock gating (2)");
- #endif
+ #endif
if (eNewPowerState == PVRSRV_DEV_POWER_STATE_OFF)
{
-
+
eError = SGXDeinitialise(psDevInfo);
if (eError != PVRSRV_OK)
{
PVRSRV_SGXDEV_INFO *psDevInfo = psDeviceNode->pvDevice;
SGXMKIF_HOST_CTL *psSGXHostCtl = psDevInfo->psSGXHostCtl;
-
+
psSGXHostCtl->ui32PowerStatus = 0;
#if defined(PDUMP)
PDUMPCOMMENT("Host Control - Reset power status");
offsetof(SGXMKIF_HOST_CTL, ui32PowerStatus),
sizeof(IMG_UINT32), PDUMP_FLAGS_CONTINUOUS,
MAKEUNIQUETAG(psDevInfo->psKernelSGXHostCtlMemInfo));
- #endif
+ #endif
if (eCurrentPowerState == PVRSRV_DEV_POWER_STATE_OFF)
{
+
-
-
+
eError = SGXUpdateTimingInfo(psDeviceNode);
if (eError != PVRSRV_OK)
return eError;
}
-
+
eError = SGXInitialise(psDevInfo, IMG_FALSE);
if (eError != PVRSRV_OK)
}
else
{
-
+
SGXMKIF_COMMAND sCommand = {0};
{
if (bIdleDevice)
{
-
+
PDUMPSUSPEND();
eError = SGXPrePowerState(hDevHandle, PVRSRV_DEV_POWER_STATE_IDLE,
{
PVRSRV_ERROR eError;
-
+
eError = SGXUpdateTimingInfo(psDeviceNode);
if (eError != PVRSRV_OK)
if (bIdleDevice)
{
-
+
eError = SGXPostPowerState(hDevHandle, PVRSRV_DEV_POWER_STATE_ON,
PVRSRV_DEV_POWER_STATE_IDLE);
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#include "services_headers.h"
#include "sgxinfokm.h"
#include "sgxconfig.h"
-#include "sgxutils.h"
#include "pdump_km.h"
IMG_UINT32 ui32PDUMPFlags)
{
IMG_UINT32 ui32RegVal;
-
+
#if !defined(PDUMP)
PVR_UNREFERENCED_PARAMETER(ui32PDUMPFlags);
-#endif
-
+#endif
+
ui32RegVal = psDevInfo->ui32ClkGateCtl;
OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_CLKGATECTL, ui32RegVal);
PDUMPREGWITHFLAGS(SGX_PDUMPREG_NAME, EUR_CR_CLKGATECTL, ui32RegVal, ui32PDUMPFlags);
#if !defined(PDUMP)
PVR_UNREFERENCED_PARAMETER(ui32PDUMPFlags);
-#endif
+#endif
ui32RegVal = 0;
OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_CTRL, ui32RegVal);
PDUMPREGWITHFLAGS(SGX_PDUMPREG_NAME, EUR_CR_BIF_BANK_SET, ui32RegVal, ui32PDUMPFlags);
OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_BANK0, ui32RegVal);
PDUMPREGWITHFLAGS(SGX_PDUMPREG_NAME, EUR_CR_BIF_BANK0, ui32RegVal, ui32PDUMPFlags);
-#endif
+#endif
PDUMPCOMMENTWITHFLAGS(ui32PDUMPFlags, "Initialise the BIF directory list\r\n");
OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_DIR_LIST_BASE0, ui32RegVal);
PDUMPREGWITHFLAGS(SGX_PDUMPREG_NAME, ui32DirListReg, ui32RegVal, ui32PDUMPFlags);
}
}
-#endif
+#endif
}
#if !defined(PDUMP)
PVR_UNREFERENCED_PARAMETER(ui32PDUMPFlags);
-#endif
-
+#endif
+
#if defined(SGX_FEATURE_MULTIPLE_MEM_CONTEXTS)
-
+
ui32RegVal = (SGX_BIF_DIR_LIST_INDEX_EDM << EUR_CR_BIF_BANK0_INDEX_EDM_SHIFT);
#if defined(SGX_FEATURE_2D_HARDWARE) && !defined(SGX_FEATURE_PTLA)
-
+
ui32RegVal |= (SGX_BIF_DIR_LIST_INDEX_EDM << EUR_CR_BIF_BANK0_INDEX_2D_SHIFT);
- #endif
+ #endif
#if defined(FIX_HW_BRN_23410)
-
+
ui32RegVal |= (SGX_BIF_DIR_LIST_INDEX_EDM << EUR_CR_BIF_BANK0_INDEX_TA_SHIFT);
- #endif
+ #endif
OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_BANK0, ui32RegVal);
PDUMPCOMMENTWITHFLAGS(ui32PDUMPFlags, "Set up EDM requestor page table in BIF\r\n");
PDUMPREGWITHFLAGS(SGX_PDUMPREG_NAME, EUR_CR_BIF_BANK0, ui32RegVal, ui32PDUMPFlags);
- #endif
+ #endif
{
IMG_UINT32 ui32EDMDirListReg;
-
+
#if (SGX_BIF_DIR_LIST_INDEX_EDM == 0)
ui32EDMDirListReg = EUR_CR_BIF_DIR_LIST_BASE0;
#else
-
+
ui32EDMDirListReg = EUR_CR_BIF_DIR_LIST_BASE1 + 4 * (SGX_BIF_DIR_LIST_INDEX_EDM - 1);
- #endif
+ #endif
ui32RegVal = psDevInfo->sKernelPDDevPAddr.uiAddr >> SGX_MMU_PDE_ADDR_ALIGNSHIFT;
-
+
#if defined(FIX_HW_BRN_28011)
OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_DIR_LIST_BASE0, ui32RegVal);
PDUMPPDREGWITHFLAGS(&psDevInfo->sMMUAttrib, EUR_CR_BIF_DIR_LIST_BASE0, ui32RegVal, ui32PDUMPFlags, PDUMP_PD_UNIQUETAG);
ui32ReadRegister = EUR_CR_MASTER_SOFT_RESET;
#else
ui32ReadRegister = EUR_CR_SOFT_RESET;
- #endif
+ #endif
#endif
#if !defined(PDUMP)
PVR_UNREFERENCED_PARAMETER(ui32PDUMPFlags);
-#endif
-
+#endif
- SGXWaitClocks(psDevInfo, 100);
+
+ OSWaitus(100 * 1000000 / psDevInfo->ui32CoreClockSpeed);
if (bPDump)
{
PDUMPIDLWITHFLAGS(30, ui32PDUMPFlags);
IMG_UINT32 ui32SoftResetRegVal;
ui32SoftResetRegVal =
-
+
EUR_CR_SOFT_RESET_DPM_RESET_MASK |
EUR_CR_SOFT_RESET_TA_RESET_MASK |
EUR_CR_SOFT_RESET_USE_RESET_MASK |
#if !defined(PDUMP)
PVR_UNREFERENCED_PARAMETER(ui32PDUMPFlags);
-#endif
+#endif
if (bResetBIF)
{
{
IMG_UINT32 ui32RegVal;
-
+
#if defined(EUR_CR_BIF_CTRL_INVAL)
ui32RegVal = EUR_CR_BIF_CTRL_INVAL_ALL_MASK;
OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_CTRL_INVAL, ui32RegVal);
#if !defined(SGX_FEATURE_MULTIPLE_MEM_CONTEXTS)
{
-
+
if (PollForValueKM((IMG_UINT32 *)((IMG_UINT8*)psDevInfo->pvRegsBaseKM + EUR_CR_BIF_MEM_REQ_STAT),
PDUMPREGPOLWITHFLAGS(SGX_PDUMPREG_NAME, EUR_CR_BIF_MEM_REQ_STAT, 0, EUR_CR_BIF_MEM_REQ_STAT_READS_MASK, ui32PDUMPFlags, PDUMP_POLL_OPERATOR_EQUAL);
}
}
-#endif
+#endif
}
-#endif
+#endif
IMG_VOID SGXReset(PVRSRV_SGXDEV_INFO *psDevInfo,
#if !defined(PDUMP)
PVR_UNREFERENCED_PARAMETER(ui32PDUMPFlags);
-#endif
+#endif
PDUMPCOMMENTWITHFLAGS(ui32PDUMPFlags, "Start of SGX reset sequence\r\n");
#if defined(FIX_HW_BRN_23944)
-
+
ui32RegVal = EUR_CR_BIF_CTRL_PAUSE_MASK;
OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_CTRL, ui32RegVal);
PDUMPREGWITHFLAGS(SGX_PDUMPREG_NAME, EUR_CR_BIF_CTRL, ui32RegVal, ui32PDUMPFlags);
ui32RegVal = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_INT_STAT);
if (ui32RegVal & ui32BifFaultMask)
{
-
+
ui32RegVal = EUR_CR_BIF_CTRL_PAUSE_MASK | EUR_CR_BIF_CTRL_CLEAR_FAULT_MASK;
OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_CTRL, ui32RegVal);
PDUMPREGWITHFLAGS(SGX_PDUMPREG_NAME, EUR_CR_BIF_CTRL, ui32RegVal, ui32PDUMPFlags);
SGXResetSleep(psDevInfo, ui32PDUMPFlags, IMG_TRUE);
}
-#endif
-
+#endif
+
SGXResetSoftReset(psDevInfo, IMG_TRUE, ui32PDUMPFlags, IMG_TRUE);
SGXResetSleep(psDevInfo, ui32PDUMPFlags, IMG_TRUE);
-
+
#if defined(SGX_FEATURE_36BIT_MMU)
-
+
OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_36BIT_ADDRESSING, EUR_CR_BIF_36BIT_ADDRESSING_ENABLE_MASK);
PDUMPREGWITHFLAGS(SGX_PDUMPREG_NAME, EUR_CR_BIF_36BIT_ADDRESSING, EUR_CR_BIF_36BIT_ADDRESSING_ENABLE_MASK, ui32PDUMPFlags);
#endif
SGXResetInitBIFContexts(psDevInfo, ui32PDUMPFlags);
#if defined(EUR_CR_BIF_MEM_ARB_CONFIG)
-
+
ui32RegVal = (12UL << EUR_CR_BIF_MEM_ARB_CONFIG_PAGE_SIZE_SHIFT) |
(7UL << EUR_CR_BIF_MEM_ARB_CONFIG_BEST_CNT_SHIFT) |
(12UL << EUR_CR_BIF_MEM_ARB_CONFIG_TTE_THRESH_SHIFT);
OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_MEM_ARB_CONFIG, ui32RegVal);
PDUMPREGWITHFLAGS(SGX_PDUMPREG_NAME, EUR_CR_BIF_MEM_ARB_CONFIG, ui32RegVal, ui32PDUMPFlags);
-#endif
+#endif
#if defined(SGX_FEATURE_SYSTEM_CACHE)
#if defined(SGX_BYPASS_SYSTEM_CACHE)
-
+
ui32RegVal = MNE_CR_CTRL_BYPASS_ALL_MASK;
#else
#if defined(FIX_HW_BRN_26620)
ui32RegVal = 0;
#else
-
+
ui32RegVal = MNE_CR_CTRL_BYP_CC_MASK;
#endif
#if defined(FIX_HW_BRN_34028)
ui32RegVal |= (8 << MNE_CR_CTRL_BYPASS_SHIFT);
#endif
- #endif
+ #endif
OSWriteHWReg(psDevInfo->pvRegsBaseKM, MNE_CR_CTRL, ui32RegVal);
PDUMPREG(SGX_PDUMPREG_NAME, MNE_CR_CTRL, ui32RegVal);
-#endif
+#endif
if (bHardwareRecovery)
{
-
+
SGXResetSleep(psDevInfo, ui32PDUMPFlags, IMG_FALSE);
-
+
SGXResetSoftReset(psDevInfo, IMG_FALSE, ui32PDUMPFlags, IMG_TRUE);
SGXResetSleep(psDevInfo, ui32PDUMPFlags, IMG_FALSE);
SGXResetInvalDC(psDevInfo, ui32PDUMPFlags, IMG_FALSE);
-
+
for (;;)
{
break;
}
-
+
sBifFault.uiAddr = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_FAULT);
ui32PDIndex = sBifFault.uiAddr >> (SGX_MMU_PAGE_SHIFT + SGX_MMU_PT_SHIFT);
ui32PTIndex = (sBifFault.uiAddr & SGX_MMU_PT_MASK) >> SGX_MMU_PAGE_SHIFT;
-
+
SGXResetSoftReset(psDevInfo, IMG_TRUE, ui32PDUMPFlags, IMG_FALSE);
-
+
psDevInfo->pui32BIFResetPD[ui32PDIndex] = (psDevInfo->sBIFResetPTDevPAddr.uiAddr
>>SGX_MMU_PDE_ADDR_ALIGNSHIFT)
| SGX_MMU_PDE_PAGE_SIZE_4K
>>SGX_MMU_PTE_ADDR_ALIGNSHIFT)
| SGX_MMU_PTE_VALID;
-
+
ui32RegVal = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_STATUS);
OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_HOST_CLEAR, ui32RegVal);
ui32RegVal = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_STATUS2);
SGXResetSleep(psDevInfo, ui32PDUMPFlags, IMG_FALSE);
-
+
SGXResetSoftReset(psDevInfo, IMG_FALSE, ui32PDUMPFlags, IMG_FALSE);
SGXResetSleep(psDevInfo, ui32PDUMPFlags, IMG_FALSE);
-
+
SGXResetInvalDC(psDevInfo, ui32PDUMPFlags, IMG_FALSE);
-
+
psDevInfo->pui32BIFResetPD[ui32PDIndex] = 0;
psDevInfo->pui32BIFResetPT[ui32PTIndex] = 0;
}
}
else
{
-
+
SGXResetSoftReset(psDevInfo, IMG_FALSE, ui32PDUMPFlags, IMG_TRUE);
SGXResetSleep(psDevInfo, ui32PDUMPFlags, IMG_FALSE);
- }
-
+ }
+
SGXResetSetupBIFContexts(psDevInfo, ui32PDUMPFlags);
#if defined(SGX_FEATURE_2D_HARDWARE) && !defined(SGX_FEATURE_PTLA)
-
+
#if ((SGX_2D_HEAP_BASE & ~EUR_CR_BIF_TWOD_REQ_BASE_ADDR_MASK) != 0)
#error "SGXReset: SGX_2D_HEAP_BASE doesn't match EUR_CR_BIF_TWOD_REQ_BASE_ADDR_MASK alignment"
#endif
-
+
OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_TWOD_REQ_BASE, SGX_2D_HEAP_BASE);
PDUMPREGWITHFLAGS(SGX_PDUMPREG_NAME, EUR_CR_BIF_TWOD_REQ_BASE, SGX_2D_HEAP_BASE, ui32PDUMPFlags);
#endif
-
+
SGXResetInvalDC(psDevInfo, ui32PDUMPFlags, IMG_TRUE);
PVR_DPF((PVR_DBG_MESSAGE,"Soft Reset of SGX"));
-
+
ui32RegVal = 0;
OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_SOFT_RESET, ui32RegVal);
PDUMPREGWITHFLAGS(SGX_PDUMPREG_NAME, EUR_CR_SOFT_RESET, ui32RegVal, ui32PDUMPFlags);
-
+
SGXResetSleep(psDevInfo, ui32PDUMPFlags, IMG_TRUE);
PDUMPCOMMENTWITHFLAGS(ui32PDUMPFlags, "End of SGX reset sequence\r\n");
{
IMG_UINT32 ui32RegVal;
-
+
PVR_UNREFERENCED_PARAMETER(bHardwareRecovery);
#if !defined(PDUMP)
PVR_UNREFERENCED_PARAMETER(ui32PDUMPFlags);
-#endif
+#endif
PDUMPCOMMENTWITHFLAGS(ui32PDUMPFlags, "Start of SGX MP reset sequence\r\n");
-
+
ui32RegVal = EUR_CR_MASTER_SOFT_RESET_BIF_RESET_MASK |
EUR_CR_MASTER_SOFT_RESET_IPF_RESET_MASK |
EUR_CR_MASTER_SOFT_RESET_DPM_RESET_MASK |
ui32RegVal |= EUR_CR_MASTER_SOFT_RESET_SLC_RESET_MASK;
#endif
-
+
ui32RegVal |= EUR_CR_MASTER_SOFT_RESET_CORE_RESET_MASK(0) |
EUR_CR_MASTER_SOFT_RESET_CORE_RESET_MASK(1) |
EUR_CR_MASTER_SOFT_RESET_CORE_RESET_MASK(2) |
#if defined(SGX_FEATURE_SYSTEM_CACHE)
#if defined(SGX_BYPASS_SYSTEM_CACHE)
- ui32RegVal = EUR_CR_MASTER_SLC_CTRL_BYPASS_ALL_MASK;
+ #error SGX_BYPASS_SYSTEM_CACHE not supported
#else
ui32RegVal = EUR_CR_MASTER_SLC_CTRL_USSE_INVAL_REQ0_MASK |
#if defined(FIX_HW_BRN_30954)
EUR_CR_MASTER_SLC_CTRL_BYPASS_REQ_USE3_MASK |
EUR_CR_MASTER_SLC_CTRL_BYPASS_REQ_TA_MASK;
#endif
- #endif
OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_MASTER_SLC_CTRL_BYPASS, ui32RegVal);
PDUMPCOMMENTWITHFLAGS(ui32PDUMPFlags, "Initialise the hydra SLC bypass control\r\n");
PDUMPREG(SGX_PDUMPREG_NAME, EUR_CR_MASTER_SLC_CTRL_BYPASS, ui32RegVal);
-#endif
+ #endif
+#endif
SGXResetSleep(psDevInfo, ui32PDUMPFlags, IMG_TRUE);
-
+
ui32RegVal = 0;
OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_MASTER_SOFT_RESET, ui32RegVal);
PDUMPCOMMENTWITHFLAGS(ui32PDUMPFlags, "Remove the resets from all of SGX\r\n");
PDUMPREGWITHFLAGS(SGX_PDUMPREG_NAME, EUR_CR_MASTER_SOFT_RESET, ui32RegVal, ui32PDUMPFlags);
-
+
SGXResetSleep(psDevInfo, ui32PDUMPFlags, IMG_TRUE);
PDUMPCOMMENTWITHFLAGS(ui32PDUMPFlags, "Turn on the slave cores' clock gating\r\n");
#if defined(FIX_HW_BRN_31278) || defined(FIX_HW_BRN_31620) || defined(FIX_HW_BRN_31671) || defined(FIX_HW_BRN_32085)
#if defined(FIX_HW_BRN_31278) || defined(FIX_HW_BRN_32085)
-
+
ui32RegVal = (1<<EUR_CR_MASTER_BIF_MMU_CTRL_ADDR_HASH_MODE_SHIFT);
#else
- ui32RegVal = (1<<EUR_CR_MASTER_BIF_MMU_CTRL_ADDR_HASH_MODE_SHIFT) | EUR_CR_MASTER_BIF_MMU_CTRL_PREFETCHING_ON_MASK;
+ ui32RegVal = (1<<EUR_CR_MASTER_BIF_MMU_CTRL_ADDR_HASH_MODE_SHIFT) | EUR_CR_MASTER_BIF_MMU_CTRL_PREFETCHING_ON_MASK;
#endif
#if !defined(FIX_HW_BRN_31620) && !defined(FIX_HW_BRN_31671)
-
+
ui32RegVal |= EUR_CR_MASTER_BIF_MMU_CTRL_ENABLE_DC_TLB_MASK;
#endif
-
+
OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_MASTER_BIF_MMU_CTRL, ui32RegVal);
PDUMPREGWITHFLAGS(SGX_PDUMPREG_NAME, EUR_CR_MASTER_BIF_MMU_CTRL, ui32RegVal, ui32PDUMPFlags);
#if defined(FIX_HW_BRN_31278) || defined(FIX_HW_BRN_32085)
-
+
ui32RegVal = (1<<EUR_CR_BIF_MMU_CTRL_ADDR_HASH_MODE_SHIFT);
#else
- ui32RegVal = (1<<EUR_CR_BIF_MMU_CTRL_ADDR_HASH_MODE_SHIFT) | EUR_CR_BIF_MMU_CTRL_PREFETCHING_ON_MASK;
+ ui32RegVal = (1<<EUR_CR_BIF_MMU_CTRL_ADDR_HASH_MODE_SHIFT) | EUR_CR_BIF_MMU_CTRL_PREFETCHING_ON_MASK;
#endif
#if !defined(FIX_HW_BRN_31620) && !defined(FIX_HW_BRN_31671)
-
+
ui32RegVal |= EUR_CR_BIF_MMU_CTRL_ENABLE_DC_TLB_MASK;
#endif
-
+
{
IMG_UINT32 ui32Core;
SGXResetInitBIFContexts(psDevInfo, ui32PDUMPFlags);
SGXResetSetupBIFContexts(psDevInfo, ui32PDUMPFlags);
-
+
PDUMPCOMMENTWITHFLAGS(ui32PDUMPFlags, "End of SGX MP reset sequence\r\n");
-}
-#endif
+}
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#if defined(PDUMP)
IMG_BOOL bPersistentProcess = IMG_FALSE;
-
+
{
PVRSRV_PER_PROCESS_DATA* psPerProc = PVRSRVFindPerProcessData();
if(psPerProc != IMG_NULL)
bPersistentProcess = psPerProc->bPDumpPersistent;
}
}
-#endif
+#endif
#if defined(FIX_HW_BRN_31620)
hDevMemContext = psKick->hDevMemContext;
#endif
TRANSFER_TOKEN_SUBMIT);
return PVRSRV_ERROR_INVALID_PARAMS;
}
-
-
+
+
psSharedTransferCmd = CCB_DATA_FROM_OFFSET(SGXMKIF_TRANSFERCMD_SHARED, psCCBMemInfo, psKick, ui32SharedCmdCCBOffset);
PVR_TTRACE(PVRSRV_TRACE_GROUP_TRANSFER, PVRSRV_TRACE_CLASS_CMD_START, TRANSFER_TOKEN_SUBMIT);
psSharedTransferCmd->s3DSyncReadOpsCompleteDevVAddr.uiAddr = 0;
}
-
+
for (loop = 0; loop < MIN(SGX_MAX_TRANSFER_SYNC_OPS, psKick->ui32NumSrcSync); loop++)
{
IMG_UINT32 i;
PVRSRV_KERNEL_SYNC_INFO * psMySyncInfo = (PVRSRV_KERNEL_SYNC_INFO *)psKick->ahSrcSyncInfo[loop];
-
- for (i = 0; i < loop; i++)
+
+ for (i = 0; i < loop; i++)
{
if (abSrcSyncEnable[i])
{
IMG_UINT32 i;
PVRSRV_KERNEL_SYNC_INFO * psMySyncInfo = (PVRSRV_KERNEL_SYNC_INFO *)psKick->ahDstSyncInfo[loop];
-
- for (i = 0; i < loop; i++)
+
+ for (i = 0; i < loop; i++)
{
if (abDstSyncEnable[i])
{
}
}
- psSharedTransferCmd->ui32NumSrcSyncs = ui32RealSrcSyncNum;
- psSharedTransferCmd->ui32NumDstSyncs = ui32RealDstSyncNum;
+ psSharedTransferCmd->ui32NumSrcSyncs = ui32RealSrcSyncNum;
+ psSharedTransferCmd->ui32NumDstSyncs = ui32RealDstSyncNum;
if ((psKick->ui32Flags & SGXMKIF_TQFLAGS_KEEPPENDING) == 0UL)
{
psSharedTransferCmd->asSrcSyncs[i].ui32WriteOpsPendingVal = psSyncInfo->psSyncData->ui32WriteOpsPending;
psSharedTransferCmd->asSrcSyncs[i].ui32ReadOpsPendingVal = psSyncInfo->psSyncData->ui32ReadOpsPending;
- psSharedTransferCmd->asSrcSyncs[i].sWriteOpsCompleteDevVAddr = psSyncInfo->sWriteOpsCompleteDevVAddr;
+ psSharedTransferCmd->asSrcSyncs[i].sWriteOpsCompleteDevVAddr = psSyncInfo->sWriteOpsCompleteDevVAddr;
psSharedTransferCmd->asSrcSyncs[i].sReadOpsCompleteDevVAddr = psSyncInfo->sReadOpsCompleteDevVAddr;
i++;
}
}
PVR_ASSERT(i == ui32RealDstSyncNum);
-
+
for (loop = 0; loop < psKick->ui32NumSrcSync; loop++)
{
if (abSrcSyncEnable[loop])
#if defined(PDUMP)
if ((PDumpIsCaptureFrameKM()
- || ((psKick->ui32PDumpFlags & PDUMP_FLAGS_CONTINUOUS) != 0))
+ || ((psKick->ui32PDumpFlags & PDUMP_FLAGS_CONTINUOUS) != 0))
&& (bPersistentProcess == IMG_FALSE) )
{
PDUMPCOMMENT("Shared part of transfer command\r\n");
}
}
-
+
for (loop = 0; loop < (psKick->ui32NumSrcSync); loop++)
{
if (abSrcSyncEnable[loop])
- {
+ {
psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *)psKick->ahSrcSyncInfo[loop];
psSyncInfo->psSyncData->ui32LastReadOpDumpVal++;
}
psSyncInfo->psSyncData->ui32LastOpDumpVal++;
}
- }
+ }
#endif
sCommand.ui32Data[1] = psKick->sHWTransferContextDevVAddr.uiAddr;
-
+
PVR_TTRACE(PVRSRV_TRACE_GROUP_TRANSFER, PVRSRV_TRACE_CLASS_CMD_END,
TRANSFER_TOKEN_SUBMIT);
if (eError == PVRSRV_ERROR_RETRY)
{
-
+
if ((psKick->ui32Flags & SGXMKIF_TQFLAGS_KEEPPENDING) == 0UL)
{
for (loop = 0; loop < psKick->ui32NumSrcSync; loop++)
}
}
-
+
if (psKick->hTASyncInfo != IMG_NULL)
{
psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *)psKick->hTASyncInfo;
psSyncInfo->psSyncData->ui32WriteOpsPending--;
}
-
+
if (psKick->h3DSyncInfo != IMG_NULL)
{
psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *)psKick->h3DSyncInfo;
TRANSFER_TOKEN_SUBMIT);
return eError;
}
-
+
#if defined(NO_HARDWARE)
if ((psKick->ui32Flags & SGXMKIF_TQFLAGS_NOSYNCUPDATE) == 0)
{
-
+
for (loop = 0; loop < psKick->ui32NumSrcSync; loop++)
{
if (abSrcSyncEnable[loop])
#else
IMG_EXPORT PVRSRV_ERROR SGXSubmit2DKM(IMG_HANDLE hDevHandle, PVRSRV_2D_SGX_KICK *psKick)
#endif
-
+
{
PVRSRV_KERNEL_MEM_INFO *psCCBMemInfo = (PVRSRV_KERNEL_MEM_INFO *)psKick->hCCBMemInfo;
SGXMKIF_COMMAND sCommand = {0};
IMG_HANDLE hDevMemContext = IMG_NULL;
#if defined(PDUMP)
IMG_BOOL bPersistentProcess = IMG_FALSE;
-
+
{
PVRSRV_PER_PROCESS_DATA* psPerProc = PVRSRVFindPerProcessData();
if(psPerProc != IMG_NULL)
bPersistentProcess = psPerProc->bPDumpPersistent;
}
}
-#endif
+#endif
#if defined(FIX_HW_BRN_31620)
hDevMemContext = psKick->hDevMemContext;
#endif
PVR_DPF((PVR_DBG_ERROR, "SGXSubmit2DKM: Invalid CCB offset"));
return PVRSRV_ERROR_INVALID_PARAMS;
}
-
-
+
+
ps2DCmd = CCB_DATA_FROM_OFFSET(SGXMKIF_2DCMD_SHARED, psCCBMemInfo, psKick, ui32SharedCmdCCBOffset);
OSMemSet(ps2DCmd, 0, sizeof(*ps2DCmd));
-
+
if (psKick->hTASyncInfo != IMG_NULL)
{
psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *)psKick->hTASyncInfo;
ps2DCmd->sTASyncData.sReadOpsCompleteDevVAddr = psSyncInfo->sReadOpsCompleteDevVAddr;
}
-
+
if (psKick->h3DSyncInfo != IMG_NULL)
{
psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *)psKick->h3DSyncInfo;
ps2DCmd->s3DSyncData.sReadOpsCompleteDevVAddr = psSyncInfo->sReadOpsCompleteDevVAddr;
}
-
+
ps2DCmd->ui32NumSrcSync = psKick->ui32NumSrcSync;
for (i = 0; i < psKick->ui32NumSrcSync; i++)
{
ps2DCmd->sDstSyncData.sReadOps2CompleteDevVAddr = psSyncInfo->sReadOps2CompleteDevVAddr;
}
-
+
for (i = 0; i < psKick->ui32NumSrcSync; i++)
{
psSyncInfo = psKick->ahSrcSyncInfo[i];
|| ((psKick->ui32PDumpFlags & PDUMP_FLAGS_CONTINUOUS) != 0))
&& (bPersistentProcess == IMG_FALSE) )
{
-
+
PDUMPCOMMENT("Shared part of 2D command\r\n");
PDUMPMEM(ps2DCmd,
psCCBMemInfo,
MAKEUNIQUETAG(psCCBMemInfo));
}
-
+
for (i = 0; i < psKick->ui32NumSrcSync; i++)
{
psSyncInfo = psKick->ahSrcSyncInfo[i];
psSyncInfo = psKick->hDstSyncInfo;
psSyncInfo->psSyncData->ui32LastOpDumpVal++;
}
- }
+ }
#endif
sCommand.ui32Data[1] = psKick->sHW2DContextDevVAddr.uiAddr;
-
- eError = SGXScheduleCCBCommandKM(hDevHandle, SGXMKIF_CMD_2D, &sCommand, KERNEL_ID, psKick->ui32PDumpFlags, hDevMemContext, IMG_FALSE);
+
+ eError = SGXScheduleCCBCommandKM(hDevHandle, SGXMKIF_CMD_2D, &sCommand, KERNEL_ID, psKick->ui32PDumpFlags, hDevMemContext, IMG_FALSE);
if (eError == PVRSRV_ERROR_RETRY)
{
-
+
#if defined(PDUMP)
if (PDumpIsCaptureFrameKM())
psSyncInfo->psSyncData->ui32WriteOpsPending--;
}
-
+
if (psKick->hTASyncInfo != IMG_NULL)
{
psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *)psKick->hTASyncInfo;
psSyncInfo->psSyncData->ui32WriteOpsPending--;
}
-
+
if (psKick->h3DSyncInfo != IMG_NULL)
{
psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *)psKick->h3DSyncInfo;
}
}
-
+
#if defined(NO_HARDWARE)
-
+
for(i = 0; i < psKick->ui32NumSrcSync; i++)
{
psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *)psKick->ahSrcSyncInfo[i];
return eError;
}
-#endif
-#endif
+#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#include "ttrace.h"
#ifdef __linux__
-#include <linux/kernel.h>
-#include <linux/string.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
#else
#include <stdio.h>
#endif
PVRSRV_SGXDEV_INFO *psDevInfo = psDeviceNode->pvDevice;
SGXMKIF_HOST_CTL *psSGXHostCtl = psDevInfo->psSGXHostCtl;
-
+
psSGXHostCtl->ui32NumActivePowerEvents++;
if ((psSGXHostCtl->ui32PowerStatus & PVRSRV_USSE_EDM_POWMAN_POWEROFF_RESTART_IMMEDIATE) != 0)
{
-
+
if (ui32CallerID == ISR_ID)
if (((psSGXHostCtl->ui32InterruptFlags & PVRSRV_USSE_EDM_INTERRUPT_ACTIVE_POWER) != 0) &&
((psSGXHostCtl->ui32InterruptClearFlags & PVRSRV_USSE_EDM_INTERRUPT_ACTIVE_POWER) == 0))
{
-
+
psSGXHostCtl->ui32InterruptClearFlags |= PVRSRV_USSE_EDM_INTERRUPT_ACTIVE_POWER;
-
+
PDUMPSUSPEND();
#if defined(SYS_CUSTOM_POWERDOWN)
-
+
eError = SysPowerDownMISR(psDeviceNode, ui32CallerID);
#endif
if (eError == PVRSRV_ERROR_RETRY)
{
-
+
psSGXHostCtl->ui32InterruptClearFlags &= ~PVRSRV_USSE_EDM_INTERRUPT_ACTIVE_POWER;
eError = PVRSRV_OK;
}
-
+
PDUMPRESUME();
}
OSSleepms(1);
} END_LOOP_UNTIL_TIMEOUT();
-
+
return IMG_NULL;
}
psMMUContext = psDevInfo->hKernelMMUContext;
psDeviceNode->pfnMMUGetCacheFlushRange(psMMUContext, &ui32CacheMasks[0]);
-
+
if (hDevMemContext)
{
BM_CONTEXT *psBMContext = (BM_CONTEXT *) hDevMemContext;
psDeviceNode->pfnMMUGetCacheFlushRange(psMMUContext, &ui32CacheMasks[2]);
}
-
+
if (ui32CacheMasks[0] || ui32CacheMasks[1] || ui32CacheMasks[2] || ui32CacheMasks[3])
{
psDevInfo->ui32CacheControl |= SGXMKIF_CC_INVAL_BIF_PD;
#endif
#if defined(FIX_HW_BRN_28889)
-
+
goto Exit;
}
-
+
#if !defined(NO_HARDWARE)
if(PollForValueKM(&psSGXHostCtl->ui32InvalStatus,
PVRSRV_USSE_EDM_BIF_INVAL_COMPLETE,
#endif
#if defined(PDUMP)
-
+
PDUMPCOMMENTWITHFLAGS(0, "Host Control - Poll for BIF cache invalidate request to complete");
PDUMPMEMPOL(psSGXHostCtlMemInfo,
offsetof(SGXMKIF_HOST_CTL, ui32InvalStatus),
PDUMP_POLL_OPERATOR_EQUAL,
0,
MAKEUNIQUETAG(psSGXHostCtlMemInfo));
- #endif
+ #endif
psSGXHostCtl->ui32InvalStatus &= ~(PVRSRV_USSE_EDM_BIF_INVAL_COMPLETE);
PDUMPMEM(IMG_NULL, psSGXHostCtlMemInfo, offsetof(SGXMKIF_HOST_CTL, ui32CleanupStatus), sizeof(IMG_UINT32), 0, MAKEUNIQUETAG(psSGXHostCtlMemInfo));
SGXMKIF_COMMAND sPDECacheCommand = {0};
IMG_DEV_PHYADDR sDevPAddr;
-
+
psMMUContext = psDevInfo->hKernelMMUContext;
psDeviceNode->pfnMMUGetPDPhysAddr(psMMUContext, &sDevPAddr);
sPDECacheCommand.ui32Data[1] = ui32CacheMasks[0];
sPDECacheCommand.ui32Data[2] = ui32CacheMasks[1];
-
+
if (hDevMemContext)
{
BM_CONTEXT *psBMContext = (BM_CONTEXT *) hDevMemContext;
psMMUContext = psBMContext->psMMUContext;
psDeviceNode->pfnMMUGetPDPhysAddr(psMMUContext, &sDevPAddr);
-
+
sPDECacheCommand.ui32Data[3] = sDevPAddr.uiAddr | 1;
sPDECacheCommand.ui32Data[4] = ui32CacheMasks[2];
sPDECacheCommand.ui32Data[5] = ui32CacheMasks[3];
}
-
+
if (sPDECacheCommand.ui32Data[1] | sPDECacheCommand.ui32Data[2] | sPDECacheCommand.ui32Data[4] |
sPDECacheCommand.ui32Data[5])
{
}
#endif
#if defined(PDUMP)
-
+
{
PVRSRV_PER_PROCESS_DATA* psPerProc = PVRSRVFindPerProcessData();
if(psPerProc != IMG_NULL)
bPersistentProcess = psPerProc->bPDumpPersistent;
}
}
-#endif
+#endif
psKernelCCB = psDevInfo->psKernelCCBInfo;
psSGXCommand = SGXAcquireKernelCCBSlot(psKernelCCB);
-
+
if(!psSGXCommand)
{
PVR_DPF((PVR_DBG_ERROR, "SGXScheduleCCBCommand: Wait for CCB space timed out")) ;
goto Exit;
}
-
+
psCommandData->ui32CacheControl = psDevInfo->ui32CacheControl;
#if defined(PDUMP)
-
+
psDevInfo->sPDContext.ui32CacheControl |= psDevInfo->ui32CacheControl;
#endif
-
+
psDevInfo->ui32CacheControl = 0;
-
+
*psSGXCommand = *psCommandData;
if (eCmdType >= SGXMKIF_CMD_MAX)
}
if (eCmdType == SGXMKIF_CMD_2D ||
- eCmdType == SGXMKIF_CMD_TRANSFER ||
- ((eCmdType == SGXMKIF_CMD_TA) && bLastInScene))
+ eCmdType == SGXMKIF_CMD_TRANSFER ||
+ ((eCmdType == SGXMKIF_CMD_TA) && bLastInScene))
{
SYS_DATA *psSysData;
-
+
SysAcquireData(&psSysData);
if(psSysData->ePendingCacheOpType == PVRSRV_MISC_INFO_CPUCACHEOP_FLUSH)
OSCleanCPUCacheKM();
}
-
+
psSysData->ePendingCacheOpType = PVRSRV_MISC_INFO_CPUCACHEOP_NONE;
}
PVR_ASSERT(eCmdType < SGXMKIF_CMD_MAX);
- psSGXCommand->ui32ServiceAddress = psDevInfo->aui32HostKickAddr[eCmdType];
+ psSGXCommand->ui32ServiceAddress = psDevInfo->aui32HostKickAddr[eCmdType];
#if defined(PDUMP)
if ((ui32CallerID != ISR_ID) && (bPDumpIsSuspended == IMG_FALSE) &&
(bPersistentProcess == IMG_FALSE) )
{
-
+
PDUMPCOMMENTWITHFLAGS(ui32PDumpFlags, "Poll for space in the Kernel CCB\r\n");
PDUMPMEMPOL(psKernelCCB->psCCBCtlMemInfo,
offsetof(PVRSRV_SGX_CCB_CTL, ui32ReadOffset),
ui32PDumpFlags,
MAKEUNIQUETAG(psKernelCCB->psCCBMemInfo));
-
+
PDUMPMEM(&psDevInfo->sPDContext.ui32CacheControl,
psKernelCCB->psCCBMemInfo,
psKernelCCB->ui32CCBDumpWOff * sizeof(SGXMKIF_COMMAND) +
if (PDumpIsCaptureFrameKM()
|| ((ui32PDumpFlags & PDUMP_FLAGS_CONTINUOUS) != 0))
{
-
+
psDevInfo->sPDContext.ui32CacheControl = 0;
}
}
#endif
#if defined(FIX_HW_BRN_26620) && defined(SGX_FEATURE_SYSTEM_CACHE) && !defined(SGX_BYPASS_SYSTEM_CACHE)
-
+
eError = PollForValueKM (psKernelCCB->pui32ReadOffset,
*psKernelCCB->pui32WriteOffset,
0xFF,
}
#endif
-
+
*psKernelCCB->pui32WriteOffset = (*psKernelCCB->pui32WriteOffset + 1) & 255;
OSWriteMemoryBarrier();
-
+
PVR_TTRACE_UI32(PVRSRV_TRACE_GROUP_MKSYNC, PVRSRV_TRACE_CLASS_NONE,
MKSYNC_TOKEN_KERNEL_CCB_OFFSET, *psKernelCCB->pui32WriteOffset);
PVR_TTRACE_UI32(PVRSRV_TRACE_GROUP_MKSYNC, PVRSRV_TRACE_CLASS_NONE,
OSMemoryBarrier();
#if defined(NO_HARDWARE)
-
+
*psKernelCCB->pui32ReadOffset = (*psKernelCCB->pui32ReadOffset + 1) & 255;
#endif
{
PVRSRV_ERROR eError;
-
+
PDUMPSUSPEND();
-
+
eError = PVRSRVSetDevicePowerStateKM(psDeviceNode->sDevId.ui32DeviceIndex,
PVRSRV_DEV_POWER_STATE_ON,
ui32CallerID,
}
else
{
-
+
}
}
ui32PowerStatus = psHostCtl->ui32PowerStatus;
if ((ui32PowerStatus & PVRSRV_USSE_EDM_POWMAN_NO_WORK) != 0)
{
-
+
return PVRSRV_OK;
}
psSGXInternalDevInfo->ui32Flags = psDevInfo->ui32Flags;
psSGXInternalDevInfo->bForcePTOff = (IMG_BOOL)psDevInfo->bForcePTOff;
-
+
psSGXInternalDevInfo->hHostCtlKernelMemInfoHandle =
(IMG_HANDLE)psDevInfo->psKernelSGXHostCtlMemInfo;
sCommand.ui32Data[0] = ui32CleanupType;
sCommand.ui32Data[1] = (psHWDataDevVAddr == IMG_NULL) ? 0 : psHWDataDevVAddr->uiAddr;
PDUMPCOMMENTWITHFLAGS(0, "Request ukernel resource clean-up, Type %u, Data 0x%X", sCommand.ui32Data[0], sCommand.ui32Data[1]);
-
+
eError = SGXScheduleCCBCommandKM(psDeviceNode, SGXMKIF_CMD_CLEANUP, &sCommand, KERNEL_ID, 0, IMG_NULL, IMG_FALSE);
if (eError != PVRSRV_OK)
{
PVR_DBG_BREAK;
return eError;
}
-
-
+
+
#if !defined(NO_HARDWARE)
if(PollForValueKM(&psHostCtl->ui32CleanupStatus,
PVRSRV_USSE_EDM_CLEANUPCMD_COMPLETE,
PVR_DBG_BREAK;
}
#endif
-
+
#if defined(PDUMP)
-
+
PDUMPCOMMENTWITHFLAGS(0, "Host Control - Poll for clean-up request to complete");
PDUMPMEMPOL(psHostCtlMemInfo,
offsetof(SGXMKIF_HOST_CTL, ui32CleanupStatus),
PDUMP_POLL_OPERATOR_EQUAL,
0,
MAKEUNIQUETAG(psHostCtlMemInfo));
- #endif
-
+ #endif
+
if (eError != PVRSRV_OK)
{
return eError;
}
}
-
+
psHostCtl->ui32CleanupStatus &= ~(PVRSRV_USSE_EDM_CLEANUPCMD_COMPLETE);
PDUMPMEM(IMG_NULL, psHostCtlMemInfo, offsetof(SGXMKIF_HOST_CTL, ui32CleanupStatus), sizeof(IMG_UINT32), 0, MAKEUNIQUETAG(psHostCtlMemInfo));
-
+
#if defined(SGX_FEATURE_SYSTEM_CACHE)
psDevInfo->ui32CacheControl |= (SGXMKIF_CC_INVAL_BIF_SL | SGXMKIF_CC_INVAL_DATA);
#else
PVRSRV_CLEANUPCMD_RC,
bForceCleanup);
-
+
PVRSRVFreeDeviceMemKM(psCleanup->psDeviceNode,
psCleanup->psHWRenderContextMemInfo);
-
+
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP,
sizeof(SGX_HW_RENDER_CONTEXT_CLEANUP),
psCleanup,
psCleanup->hBlockAlloc);
-
+
return eError;
}
PVRSRV_CLEANUPCMD_TC,
bForceCleanup);
-
+
PVRSRVFreeDeviceMemKM(psCleanup->psDeviceNode,
psCleanup->psHWTransferContextMemInfo);
-
+
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP,
sizeof(SGX_HW_TRANSFER_CONTEXT_CLEANUP),
psCleanup,
psCleanup->hBlockAlloc);
-
+
return eError;
}
eError = PVRSRVAllocDeviceMemKM(hDeviceNode,
psPerProc,
psHeapInfo->hDevMemHeap,
- PVRSRV_MEM_READ | PVRSRV_MEM_WRITE
- | PVRSRV_MEM_NO_SYNCOBJ | PVRSRV_MEM_EDM_PROTECT
+ PVRSRV_MEM_READ | PVRSRV_MEM_WRITE
+ | PVRSRV_MEM_NO_SYNCOBJ | PVRSRV_MEM_EDM_PROTECT
| PVRSRV_MEM_CACHE_CONSISTENT,
ui32HWRenderContextSize,
32,
goto exit2;
}
-
+
psHWRenderContextDevVAddr->uiAddr = psCleanup->psHWRenderContextMemInfo->sDevVAddr.uiAddr;
-
- eError = PVRSRVLookupHandle(psPerProc->psHandleBase,
+
+ eError = PVRSRVLookupHandle(psPerProc->psHandleBase,
&hDevMemContextInt,
hDevMemContext,
PVRSRV_HANDLE_TYPE_DEV_MEM_CONTEXT);
psMMUContext = BM_GetMMUContextFromMemContext(hDevMemContextInt);
sPDDevPAddr = psDeviceNode->pfnMMUGetPDDevPAddr(psMMUContext);
-
+
}
#if defined(PDUMP)
-
+
PDUMPCOMMENTWITHFLAGS(PDUMP_FLAGS_CONTINUOUS, "HW Render context struct");
PDUMPMEM(
- IMG_NULL,
+ IMG_NULL,
psCleanup->psHWRenderContextMemInfo,
- 0,
- ui32HWRenderContextSize,
- PDUMP_FLAGS_CONTINUOUS,
+ 0,
+ ui32HWRenderContextSize,
+ PDUMP_FLAGS_CONTINUOUS,
MAKEUNIQUETAG(psCleanup->psHWRenderContextMemInfo));
-
+
PDUMPCOMMENT("Page directory address in HW render context");
PDUMPPDDEVPADDR(
psCleanup->psHWRenderContextMemInfo,
sizeof(SGX_HW_RENDER_CONTEXT_CLEANUP),
psCleanup,
psCleanup->hBlockAlloc);
-
+
exit0:
return IMG_NULL;
}
eError = PVRSRVAllocDeviceMemKM(hDeviceNode,
psPerProc,
psHeapInfo->hDevMemHeap,
- PVRSRV_MEM_READ | PVRSRV_MEM_WRITE
- | PVRSRV_MEM_NO_SYNCOBJ | PVRSRV_MEM_EDM_PROTECT
+ PVRSRV_MEM_READ | PVRSRV_MEM_WRITE
+ | PVRSRV_MEM_NO_SYNCOBJ | PVRSRV_MEM_EDM_PROTECT
| PVRSRV_MEM_CACHE_CONSISTENT,
ui32HWTransferContextSize,
32,
goto exit2;
}
-
+
psHWTransferContextDevVAddr->uiAddr = psCleanup->psHWTransferContextMemInfo->sDevVAddr.uiAddr;
-
- eError = PVRSRVLookupHandle(psPerProc->psHandleBase,
+
+ eError = PVRSRVLookupHandle(psPerProc->psHandleBase,
&hDevMemContextInt,
hDevMemContext,
PVRSRV_HANDLE_TYPE_DEV_MEM_CONTEXT);
psMMUContext = BM_GetMMUContextFromMemContext(hDevMemContextInt);
sPDDevPAddr = psDeviceNode->pfnMMUGetPDDevPAddr(psMMUContext);
-
+
}
#if defined(PDUMP)
-
+
PDUMPCOMMENTWITHFLAGS(PDUMP_FLAGS_CONTINUOUS, "HW Transfer context struct");
PDUMPMEM(
- IMG_NULL,
+ IMG_NULL,
psCleanup->psHWTransferContextMemInfo,
- 0,
- ui32HWTransferContextSize,
- PDUMP_FLAGS_CONTINUOUS,
+ 0,
+ ui32HWTransferContextSize,
+ PDUMP_FLAGS_CONTINUOUS,
MAKEUNIQUETAG(psCleanup->psHWTransferContextMemInfo));
-
+
PDUMPCOMMENT("Page directory address in HW transfer context");
PDUMPPDDEVPADDR(
sizeof(SGX_HW_TRANSFER_CONTEXT_CLEANUP),
psCleanup,
psCleanup->hBlockAlloc);
-
+
exit0:
return IMG_NULL;
{
psCleanup = (SGX_HW_TRANSFER_CONTEXT_CLEANUP *)hHWTransferContext;
- if ((ui32OffsetOfPriorityField + sizeof(ui32Priority))
+ if ((ui32OffsetOfPriorityField + sizeof(ui32Priority))
>= psCleanup->psHWTransferContextMemInfo->uAllocSize)
{
PVR_DPF((
- PVR_DBG_ERROR,
+ PVR_DBG_ERROR,
"SGXSetTransferContextPriorityKM: invalid context prioirty offset"));
return PVRSRV_ERROR_INVALID_PARAMS;
}
-
+
pDst = (IMG_UINT8 *)psCleanup->psHWTransferContextMemInfo->pvLinAddrKM;
if (hHWRenderContext != IMG_NULL)
{
psCleanup = (SGX_HW_RENDER_CONTEXT_CLEANUP *)hHWRenderContext;
- if ((ui32OffsetOfPriorityField + sizeof(ui32Priority))
+ if ((ui32OffsetOfPriorityField + sizeof(ui32Priority))
>= psCleanup->psHWRenderContextMemInfo->uAllocSize)
{
PVR_DPF((
- PVR_DBG_ERROR,
+ PVR_DBG_ERROR,
"SGXSetContextPriorityKM: invalid HWRenderContext prioirty offset"));
return PVRSRV_ERROR_INVALID_PARAMS;
}
-
+
pDst = (IMG_UINT8 *)psCleanup->psHWRenderContextMemInfo->pvLinAddrKM;
PVR_UNREFERENCED_PARAMETER(ui32Param);
-
+
eError = SGXCleanupRequest(psCleanup->psDeviceNode,
&psCleanup->psHW2DContextMemInfo->sDevVAddr,
PVRSRV_CLEANUPCMD_2DC,
bForceCleanup);
-
+
PVRSRVFreeDeviceMemKM(psCleanup->psDeviceNode,
psCleanup->psHW2DContextMemInfo);
-
+
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP,
sizeof(SGX_HW_2D_CONTEXT_CLEANUP),
psCleanup,
psCleanup->hBlockAlloc);
-
+
return eError;
}
eError = PVRSRVAllocDeviceMemKM(hDeviceNode,
psPerProc,
psHeapInfo->hDevMemHeap,
- PVRSRV_MEM_READ | PVRSRV_MEM_WRITE
- | PVRSRV_MEM_NO_SYNCOBJ | PVRSRV_MEM_EDM_PROTECT
+ PVRSRV_MEM_READ | PVRSRV_MEM_WRITE
+ | PVRSRV_MEM_NO_SYNCOBJ | PVRSRV_MEM_EDM_PROTECT
| PVRSRV_MEM_CACHE_CONSISTENT,
ui32HW2DContextSize,
32,
PVR_DPF((PVR_DBG_ERROR, "SGXRegisterHW2DContextKM: Couldn't copy user-mode copy of HWContext into device memory"));
goto exit2;
}
-
-
+
+
psHW2DContextDevVAddr->uiAddr = psCleanup->psHW2DContextMemInfo->sDevVAddr.uiAddr;
-
- eError = PVRSRVLookupHandle(psPerProc->psHandleBase,
+
+ eError = PVRSRVLookupHandle(psPerProc->psHandleBase,
&hDevMemContextInt,
hDevMemContext,
PVRSRV_HANDLE_TYPE_DEV_MEM_CONTEXT);
psMMUContext = BM_GetMMUContextFromMemContext(hDevMemContextInt);
sPDDevPAddr = psDeviceNode->pfnMMUGetPDDevPAddr(psMMUContext);
-
+
}
#if defined(PDUMP)
-
+
PDUMPCOMMENTWITHFLAGS(PDUMP_FLAGS_CONTINUOUS, "HW 2D context struct");
PDUMPMEM(
- IMG_NULL,
+ IMG_NULL,
psCleanup->psHW2DContextMemInfo,
- 0,
- ui32HW2DContextSize,
- PDUMP_FLAGS_CONTINUOUS,
+ 0,
+ ui32HW2DContextSize,
+ PDUMP_FLAGS_CONTINUOUS,
MAKEUNIQUETAG(psCleanup->psHW2DContextMemInfo));
-
+
PDUMPCOMMENT("Page directory address in HW 2D transfer context");
PDUMPPDDEVPADDR(
psCleanup->psHW2DContextMemInfo,
sizeof(SGX_HW_2D_CONTEXT_CLEANUP),
psCleanup,
psCleanup->hBlockAlloc);
-
+
exit0:
return IMG_NULL;
}
return eError;
}
-#endif
+#endif
#ifdef INLINE_IS_PRAGMA
#pragma inline(SGX2DQuerySyncOpsComplete)
if(SGX2DQuerySyncOpsComplete(psSyncInfo, ui32ReadOpsPending, ui32WriteOpsPending))
{
-
+
PVR_DPF((PVR_DBG_CALLTRACE, "SGX2DQueryBlitsCompleteKM: No wait. Blits complete."));
return PVRSRV_OK;
}
-
+
if (!bWaitForComplete)
{
-
+
PVR_DPF((PVR_DBG_CALLTRACE, "SGX2DQueryBlitsCompleteKM: No wait. Ops pending."));
return PVRSRV_ERROR_CMD_NOT_PROCESSED;
}
-
+
PVR_DPF((PVR_DBG_MESSAGE, "SGX2DQueryBlitsCompleteKM: Ops pending. Start polling."));
LOOP_UNTIL_TIMEOUT(MAX_HW_TIME_US)
if(SGX2DQuerySyncOpsComplete(psSyncInfo, ui32ReadOpsPending, ui32WriteOpsPending))
{
-
+
PVR_DPF((PVR_DBG_CALLTRACE, "SGX2DQueryBlitsCompleteKM: Wait over. Blits complete."));
return PVRSRV_OK;
}
OSSleepms(1);
} END_LOOP_UNTIL_TIMEOUT();
-
+
PVR_DPF((PVR_DBG_ERROR,"SGX2DQueryBlitsCompleteKM: Timed out. Ops pending."));
#if defined(DEBUG)
ui32Clocksx16 = (IMG_UINT32)(ui64Clocks / 16);
return ui32Clocksx16;
-#endif
-}
-
-
-IMG_VOID SGXWaitClocks(PVRSRV_SGXDEV_INFO *psDevInfo,
- IMG_UINT32 ui32SGXClocks)
-{
-
-
- OSWaitus(1 + (ui32SGXClocks * 1000000 / psDevInfo->ui32CoreClockSpeed));
+#endif
}
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#include "perproc.h"
#include "sgxinfokm.h"
-
+
#define CCB_OFFSET_IS_VALID(type, psCCBMemInfo, psCCBKick, offset) \
((sizeof(type) <= (psCCBMemInfo)->uAllocSize) && \
((psCCBKick)->offset <= (psCCBMemInfo)->uAllocSize - sizeof(type)))
IMG_UINT32 ui32TimeWraps,
IMG_UINT32 ui32Time);
-IMG_VOID SGXWaitClocks(PVRSRV_SGXDEV_INFO *psDevInfo,
- IMG_UINT32 ui32SGXClocks);
-
PVRSRV_ERROR SGXCleanupRequest(PVRSRV_DEVICE_NODE *psDeviceNode,
IMG_DEV_VIRTADDR *psHWDataDevVAddr,
IMG_UINT32 ui32CleanupType,
#
# Copyright (C) Imagination Technologies Ltd. All rights reserved.
-#
+#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
-#
-# This program is distributed in the hope it will be useful but, except
-# as otherwise stated in writing, without any warranty; without even the
-# implied warranty of merchantability or fitness for a particular purpose.
+#
+# This program is distributed in the hope it will be useful but, except
+# as otherwise stated in writing, without any warranty; without even the
+# implied warranty of merchantability or fitness for a particular purpose.
# See the GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-#
+#
# The full GNU General Public License is included in this distribution in
# the file called "COPYING".
#
# Contact Information:
# Imagination Technologies Ltd. <gpl-support@imgtec.com>
-# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
-#
+# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+#
pvrsrvkm-y += \
services4/srvkm/env/linux/osfunc.o \
pvrsrvkm-$(CONFIG_ION_OMAP) += \
services4/srvkm/env/linux/ion.o
-ifeq ($(TTRACE),1)
-pvrsrvkm-y += \
- services4/srvkm/common/ttrace.o
-endif
-
ifneq ($(W),1)
CFLAGS_osfunc.o := -Werror
CFLAGS_mutils.o := -Werror
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#endif
} ENV_DATA;
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
PVRSRV_ERROR LinuxMMapPerProcessConnect(PVRSRV_ENV_PER_PROCESS_DATA *psEnvPerProc);
IMG_VOID LinuxMMapPerProcessDisconnect(PVRSRV_ENV_PER_PROCESS_DATA *psEnvPerProc);
-
+
PVRSRV_ERROR LinuxMMapPerProcessHandleOptions(PVRSRV_HANDLE_BASE *psHandleBase);
IMG_HANDLE LinuxTerminatingProcessPrivateData(IMG_VOID);
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
{
rwlock_t sLock;
struct list_head sList;
-
+
} PVRSRV_LINUX_EVENT_OBJECT_LIST;
#if defined(DEBUG)
IMG_UINT ui32Stats;
#endif
- wait_queue_head_t sWait;
+ wait_queue_head_t sWait;
struct list_head sList;
- IMG_HANDLE hResItem;
+ IMG_HANDLE hResItem;
PVRSRV_LINUX_EVENT_OBJECT_LIST *psLinuxEventObjectList;
} PVRSRV_LINUX_EVENT_OBJECT;
{
PVRSRV_LINUX_EVENT_OBJECT_LIST *psEventObjectList;
- if(OSAllocMem(PVRSRV_OS_NON_PAGEABLE_HEAP, sizeof(PVRSRV_LINUX_EVENT_OBJECT_LIST),
+ if(OSAllocMem(PVRSRV_OS_NON_PAGEABLE_HEAP, sizeof(PVRSRV_LINUX_EVENT_OBJECT_LIST),
(IMG_VOID **)&psEventObjectList, IMG_NULL,
"Linux Event Object List") != PVRSRV_OK)
{
- PVR_DPF((PVR_DBG_ERROR, "LinuxEventObjectCreate: failed to allocate memory for event list"));
- return PVRSRV_ERROR_OUT_OF_MEMORY;
+ PVR_DPF((PVR_DBG_ERROR, "LinuxEventObjectCreate: failed to allocate memory for event list"));
+ return PVRSRV_ERROR_OUT_OF_MEMORY;
}
INIT_LIST_HEAD(&psEventObjectList->sList);
rwlock_init(&psEventObjectList->sLock);
-
+
*phEventObjectList = (IMG_HANDLE *) psEventObjectList;
return PVRSRV_OK;
PVRSRV_LINUX_EVENT_OBJECT_LIST *psEventObjectList = (PVRSRV_LINUX_EVENT_OBJECT_LIST *) hEventObjectList ;
- if(psEventObjectList)
+ if(psEventObjectList)
{
IMG_BOOL bListEmpty;
bListEmpty = list_empty(&psEventObjectList->sList);
read_unlock(&psEventObjectList->sLock);
- if (!bListEmpty)
+ if (!bListEmpty)
{
PVR_DPF((PVR_DBG_ERROR, "LinuxEventObjectListDestroy: Event List is not empty"));
return PVRSRV_ERROR_UNABLE_TO_DESTROY_EVENT;
}
OSFreeMem(PVRSRV_OS_NON_PAGEABLE_HEAP, sizeof(PVRSRV_LINUX_EVENT_OBJECT_LIST), psEventObjectList, IMG_NULL);
-
+
}
return PVRSRV_OK;
{
if(hOSEventObject)
{
- PVRSRV_LINUX_EVENT_OBJECT *psLinuxEventObject = (PVRSRV_LINUX_EVENT_OBJECT *)hOSEventObject;
+ PVRSRV_LINUX_EVENT_OBJECT *psLinuxEventObject = (PVRSRV_LINUX_EVENT_OBJECT *)hOSEventObject;
#if defined(DEBUG)
PVR_DPF((PVR_DBG_MESSAGE, "LinuxEventObjectListDelete: Event object waits: %u", psLinuxEventObject->ui32Stats));
#endif
{
return PVRSRV_ERROR_UNABLE_TO_DESTROY_EVENT;
}
-
+
return PVRSRV_OK;
}
}
#if defined(DEBUG)
PVR_DPF((PVR_DBG_MESSAGE, "LinuxEventObjectDeleteCallback: Event object waits: %u", psLinuxEventObject->ui32Stats));
-#endif
+#endif
OSFreeMem(PVRSRV_OS_NON_PAGEABLE_HEAP, sizeof(PVRSRV_LINUX_EVENT_OBJECT), psLinuxEventObject, IMG_NULL);
-
+
return PVRSRV_OK;
}
PVRSRV_ERROR LinuxEventObjectAdd(IMG_HANDLE hOSEventObjectList, IMG_HANDLE *phOSEventObject)
{
- PVRSRV_LINUX_EVENT_OBJECT *psLinuxEventObject;
- PVRSRV_LINUX_EVENT_OBJECT_LIST *psLinuxEventObjectList = (PVRSRV_LINUX_EVENT_OBJECT_LIST*)hOSEventObjectList;
+ PVRSRV_LINUX_EVENT_OBJECT *psLinuxEventObject;
+ PVRSRV_LINUX_EVENT_OBJECT_LIST *psLinuxEventObjectList = (PVRSRV_LINUX_EVENT_OBJECT_LIST*)hOSEventObjectList;
IMG_UINT32 ui32PID = OSGetCurrentProcessIDKM();
PVRSRV_PER_PROCESS_DATA *psPerProc;
unsigned long ulLockFlags;
return PVRSRV_ERROR_OUT_OF_MEMORY;
}
-
- if(OSAllocMem(PVRSRV_OS_NON_PAGEABLE_HEAP, sizeof(PVRSRV_LINUX_EVENT_OBJECT),
+
+ if(OSAllocMem(PVRSRV_OS_NON_PAGEABLE_HEAP, sizeof(PVRSRV_LINUX_EVENT_OBJECT),
(IMG_VOID **)&psLinuxEventObject, IMG_NULL,
"Linux Event Object") != PVRSRV_OK)
{
- PVR_DPF((PVR_DBG_ERROR, "LinuxEventObjectAdd: failed to allocate memory "));
- return PVRSRV_ERROR_OUT_OF_MEMORY;
+ PVR_DPF((PVR_DBG_ERROR, "LinuxEventObjectAdd: failed to allocate memory "));
+ return PVRSRV_ERROR_OUT_OF_MEMORY;
}
-
+
INIT_LIST_HEAD(&psLinuxEventObject->sList);
atomic_set(&psLinuxEventObject->sTimeStamp, 0);
RESMAN_TYPE_EVENT_OBJECT,
psLinuxEventObject,
0,
- &LinuxEventObjectDeleteCallback);
+ &LinuxEventObjectDeleteCallback);
write_lock_irqsave(&psLinuxEventObjectList->sLock, ulLockFlags);
list_add(&psLinuxEventObject->sList, &psLinuxEventObjectList->sList);
write_unlock_irqrestore(&psLinuxEventObjectList->sLock, ulLockFlags);
-
+
*phOSEventObject = psLinuxEventObject;
- return PVRSRV_OK;
+ return PVRSRV_OK;
}
PVRSRV_ERROR LinuxEventObjectSignal(IMG_HANDLE hOSEventObjectList)
{
PVRSRV_LINUX_EVENT_OBJECT *psLinuxEventObject;
- PVRSRV_LINUX_EVENT_OBJECT_LIST *psLinuxEventObjectList = (PVRSRV_LINUX_EVENT_OBJECT_LIST*)hOSEventObjectList;
+ PVRSRV_LINUX_EVENT_OBJECT_LIST *psLinuxEventObjectList = (PVRSRV_LINUX_EVENT_OBJECT_LIST*)hOSEventObjectList;
struct list_head *psListEntry, *psList;
psList = &psLinuxEventObjectList->sList;
-
+
read_lock(&psLinuxEventObjectList->sLock);
- list_for_each(psListEntry, psList)
- {
-
- psLinuxEventObject = (PVRSRV_LINUX_EVENT_OBJECT *)list_entry(psListEntry, PVRSRV_LINUX_EVENT_OBJECT, sList);
+ list_for_each(psListEntry, psList)
+ {
- atomic_inc(&psLinuxEventObject->sTimeStamp);
+ psLinuxEventObject = (PVRSRV_LINUX_EVENT_OBJECT *)list_entry(psListEntry, PVRSRV_LINUX_EVENT_OBJECT, sList);
+
+ atomic_inc(&psLinuxEventObject->sTimeStamp);
wake_up_interruptible(&psLinuxEventObject->sWait);
}
read_unlock(&psLinuxEventObjectList->sLock);
return PVRSRV_OK;
-
+
}
PVRSRV_ERROR LinuxEventObjectWait(IMG_HANDLE hOSEventObject, IMG_UINT32 ui32MSTimeout)
PVRSRV_LINUX_EVENT_OBJECT *psLinuxEventObject = (PVRSRV_LINUX_EVENT_OBJECT *) hOSEventObject;
IMG_UINT32 ui32TimeOutJiffies = msecs_to_jiffies(ui32MSTimeout);
-
- do
+
+ do
{
prepare_to_wait(&psLinuxEventObject->sWait, &sWait, TASK_INTERRUPTIBLE);
ui32TimeStamp = (IMG_UINT32)atomic_read(&psLinuxEventObject->sTimeStamp);
-
+
if(psLinuxEventObject->ui32TimeStampPrevious != ui32TimeStamp)
{
break;
}
- LinuxUnLockMutex(&gPVRSRVLock);
+ LinuxUnLockMutex(&gPVRSRVLock);
ui32TimeOutJiffies = (IMG_UINT32)schedule_timeout((IMG_INT32)ui32TimeOutJiffies);
-
+
LinuxLockMutex(&gPVRSRVLock);
#if defined(DEBUG)
psLinuxEventObject->ui32Stats++;
-#endif
-
+#endif
+
} while (ui32TimeOutJiffies);
- finish_wait(&psLinuxEventObject->sWait, &sWait);
+ finish_wait(&psLinuxEventObject->sWait, &sWait);
psLinuxEventObject->ui32TimeStampPrevious = ui32TimeStamp;
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
*****************************************************************************/
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
*****************************************************************************/
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
void ProcSeqShowPowerLevel(struct seq_file *sfile,void* el);
-#endif
+#endif
-#endif
+#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
extern PVRSRV_LINUX_MUTEX gPVRSRVLock;
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
typedef struct _DEBUG_MEM_ALLOC_REC
{
DEBUG_MEM_ALLOC_TYPE eAllocType;
- IMG_VOID *pvKey;
+ IMG_VOID *pvKey;
IMG_VOID *pvCpuVAddr;
IMG_UINT32 ulCpuPAddr;
IMG_VOID *pvPrivateData;
pid_t pid;
IMG_CHAR *pszFileName;
IMG_UINT32 ui32Line;
-
+
struct _DEBUG_MEM_ALLOC_REC *psNext;
struct _DEBUG_MEM_ALLOC_REC **ppsThis;
}DEBUG_MEM_ALLOC_REC;
#if defined(DEBUG_LINUX_MEM_AREAS)
{
g_SeqFileMemArea = CreateProcReadEntrySeq(
- "mem_areas",
- NULL,
+ "mem_areas",
+ NULL,
ProcSeqNextMemArea,
ProcSeqShowMemArea,
ProcSeqOff2ElementMemArea,
#if defined(DEBUG_LINUX_MEMORY_ALLOCATIONS)
{
g_SeqFileMemoryRecords =CreateProcReadEntrySeq(
- "meminfo",
- NULL,
+ "meminfo",
+ NULL,
ProcSeqNextMemoryRecords,
- ProcSeqShowMemoryRecords,
+ ProcSeqShowMemoryRecords,
ProcSeqOff2ElementMemoryRecords,
ProcSeqStartstopDebugMutex
);
psCurrentRecord->psLinuxMemArea,
LinuxMemAreaTypeToString(psCurrentRecord->psLinuxMemArea->eAreaType),
psCurrentRecord->psLinuxMemArea->ui32ByteSize));
-
+
LinuxMemAreaDeepFree(psLinuxMemArea);
}
#endif
static IMG_VOID LinuxMMCleanup_MemRecords_ForEachVa(DEBUG_MEM_ALLOC_REC *psCurrentRecord)
{
-
+
PVR_DPF((PVR_DBG_ERROR, "%s: BUG!: Cleaning up memory: "
"type=%s "
"CpuVAddr=%p "
IOUnmapWrapper(psCurrentRecord->pvCpuVAddr);
break;
case DEBUG_MEM_ALLOC_TYPE_IO:
-
+
DebugMemAllocRecordRemove(DEBUG_MEM_ALLOC_TYPE_IO, psCurrentRecord->pvKey, __FILE__, __LINE__);
break;
case DEBUG_MEM_ALLOC_TYPE_VMALLOC:
VFreeWrapper(psCurrentRecord->pvCpuVAddr);
break;
case DEBUG_MEM_ALLOC_TYPE_ALLOC_PAGES:
-
+
DebugMemAllocRecordRemove(DEBUG_MEM_ALLOC_TYPE_ALLOC_PAGES, psCurrentRecord->pvKey, __FILE__, __LINE__);
break;
case DEBUG_MEM_ALLOC_TYPE_KMEM_CACHE:
PVR_DPF((PVR_DBG_ERROR, "%s: BUG!: There are %d LinuxMemArea allocation unfreed (%d bytes)",
__FUNCTION__, g_LinuxMemAreaCount, g_LinuxMemAreaWaterMark));
}
-
+
List_DEBUG_LINUX_MEM_AREA_REC_ForEach(g_LinuxMemAreaRecords,
LinuxMMCleanup_MemAreas_ForEachCb);
#if defined(DEBUG_LINUX_MEMORY_ALLOCATIONS)
{
-
-
+
+
List_DEBUG_MEM_ALLOC_REC_ForEach(g_MemoryRecords,
LinuxMMCleanup_MemRecords_ForEachVa);
if(psLinuxMemAreaCache)
{
- KMemCacheDestroyWrapper(psLinuxMemAreaCache);
+ KMemCacheDestroyWrapper(psLinuxMemAreaCache);
psLinuxMemAreaCache=NULL;
}
}
psRecord->ui32Bytes = ui32Bytes;
psRecord->pszFileName = pszFileName;
psRecord->ui32Line = ui32Line;
-
+
List_DEBUG_MEM_ALLOC_REC_Insert(&g_MemoryRecords, psRecord);
-
+
g_WaterMarkData[eAllocType] += ui32Bytes;
if(g_WaterMarkData[eAllocType] > g_HighWaterMarkData[eAllocType])
{
{
DEBUG_MEM_ALLOC_TYPE eAllocType;
IMG_VOID *pvKey;
-
+
eAllocType = va_arg(va, DEBUG_MEM_ALLOC_TYPE);
pvKey = va_arg(va, IMG_VOID*);
{
eAllocType = psCurrentRecord->eAllocType;
g_WaterMarkData[eAllocType] -= psCurrentRecord->ui32Bytes;
-
+
if(eAllocType == DEBUG_MEM_ALLOC_TYPE_KMALLOC
|| eAllocType == DEBUG_MEM_ALLOC_TYPE_VMALLOC
|| eAllocType == DEBUG_MEM_ALLOC_TYPE_ALLOC_PAGES
{
g_IOMemWaterMark -= psCurrentRecord->ui32Bytes;
}
-
+
List_DEBUG_MEM_ALLOC_REC_Remove(psCurrentRecord);
kfree(psCurrentRecord);
{
LinuxLockMutex(&g_sDebugMutex);
-
+
if(!List_DEBUG_MEM_ALLOC_REC_IMG_BOOL_Any_va(g_MemoryRecords,
DebugMemAllocRecordRemove_AnyVaCb,
eAllocType,
{
pgprot_t PGProtFlags;
IMG_VOID *pvRet;
-
+
switch(ui32AllocFlags & PVRSRV_HAP_CACHETYPE_MASK)
{
case PVRSRV_HAP_CACHED:
return NULL;
}
-
+
pvRet = __vmalloc(ui32Bytes, GFP_KERNEL | __GFP_HIGHMEM, PGProtFlags);
-
+
#if defined(DEBUG_LINUX_MEMORY_ALLOCATIONS)
if(pvRet)
{
{
goto failed;
}
-
+
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15))
-
+
ReservePages(pvCpuVAddr, ui32Bytes);
#endif
DebugLinuxMemAreaRecordAdd(psLinuxMemArea, ui32AreaFlags);
#endif
-
+
if(ui32AreaFlags & (PVRSRV_HAP_WRITECOMBINE | PVRSRV_HAP_UNCACHED))
OSInvalidateCPUCacheRangeKM(psLinuxMemArea, pvCpuVAddr, ui32Bytes);
#endif
}
}
-#endif
+#endif
IMG_VOID *
IMG_UINT32 ui32Line)
{
IMG_VOID *pvIORemapCookie;
-
+
switch(ui32MappingFlags & PVRSRV_HAP_CACHETYPE_MASK)
{
case PVRSRV_HAP_CACHED:
PVR_DPF((PVR_DBG_ERROR, "IORemapWrapper: unknown mapping flags"));
return NULL;
}
-
+
#if defined(DEBUG_LINUX_MEMORY_ALLOCATIONS)
if(pvIORemapCookie)
{
#if defined(DEBUG_LINUX_MEM_AREAS)
DebugLinuxMemAreaRecordRemove(psLinuxMemArea);
#endif
-
+
IOUnmapWrapper(psLinuxMemArea->uData.sIORemap.pvIORemapCookie);
LinuxMemAreaStructFree(psLinuxMemArea);
IMG_UINT32 ui32AddrChk;
IMG_UINT32 ui32NumPages = RANGE_TO_PAGES(ui32Bytes);
-
+
for (ui32 = 0, ui32AddrChk = psSysPhysAddr[0].uiAddr;
ui32 < ui32NumPages;
ui32++, ui32AddrChk = (bPhysContig) ? (ui32AddrChk + PAGE_SIZE) : psSysPhysAddr[ui32].uiAddr)
#if defined(DEBUG_LINUX_MEM_AREAS)
DebugLinuxMemAreaRecordRemove(psLinuxMemArea);
#endif
-
+
LinuxMemAreaStructFree(psLinuxMemArea);
}
return NULL;
}
-
+
psLinuxMemArea->eAreaType = LINUX_MEM_AREA_IO;
psLinuxMemArea->uData.sIO.CPUPhysAddr.uiAddr = BasePAddr.uiAddr;
psLinuxMemArea->ui32ByteSize = ui32Bytes;
0
);
#endif
-
+
#if defined(DEBUG_LINUX_MEM_AREAS)
DebugLinuxMemAreaRecordAdd(psLinuxMemArea, ui32AreaFlags);
#endif
FreeIOLinuxMemArea(LinuxMemArea *psLinuxMemArea)
{
PVR_ASSERT(psLinuxMemArea->eAreaType == LINUX_MEM_AREA_IO);
-
+
#if defined(DEBUG_LINUX_MEM_AREAS)
DebugLinuxMemAreaRecordRemove(psLinuxMemArea);
#endif
(IMG_VOID *)psLinuxMemArea->uData.sIO.CPUPhysAddr.uiAddr, __FILE__, __LINE__);
#endif
-
+
LinuxMemAreaStructFree(psLinuxMemArea);
}
IMG_UINT32 ui32PageCount;
struct page **pvPageList;
IMG_HANDLE hBlockPageList;
- IMG_INT32 i;
+ IMG_INT32 i;
PVRSRV_ERROR eError;
-
+
psLinuxMemArea = LinuxMemAreaStructAlloc();
if(!psLinuxMemArea)
{
goto failed_area_alloc;
}
-
+
ui32PageCount = RANGE_TO_PAGES(ui32Bytes);
eError = OSAllocMem(0, sizeof(*pvPageList) * ui32PageCount, (IMG_VOID **)&pvPageList, &hBlockPageList,
"Array of pages");
{
goto failed_page_list_alloc;
}
-
+
for(i=0; i<(IMG_INT32)ui32PageCount; i++)
{
pvPageList[i] = alloc_pages(GFP_KERNEL | __GFP_HIGHMEM, 0);
goto failed_alloc_pages;
}
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15))
-
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0))
+
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0))
SetPageReserved(pvPageList[i]);
#else
mem_map_reserve(pvPageList[i]);
psLinuxMemArea->ui32AreaFlags = ui32AreaFlags;
INIT_LIST_HEAD(&psLinuxMemArea->sMMapOffsetStructList);
-
+
if(ui32AreaFlags & (PVRSRV_HAP_WRITECOMBINE | PVRSRV_HAP_UNCACHED))
{
psLinuxMemArea->bNeedsCacheInvalidate = IMG_TRUE;
#endif
return psLinuxMemArea;
-
+
failed_alloc_pages:
for(i--; i >= 0; i--)
{
__free_pages(pvPageList[i], 0);
}
(IMG_VOID) OSFreeMem(0, sizeof(*pvPageList) * ui32PageCount, pvPageList, hBlockPageList);
- psLinuxMemArea->uData.sPageList.pvPageList = IMG_NULL;
+ psLinuxMemArea->uData.sPageList.pvPageList = IMG_NULL;
failed_page_list_alloc:
LinuxMemAreaStructFree(psLinuxMemArea);
failed_area_alloc:
PVR_DPF((PVR_DBG_ERROR, "%s: failed", __FUNCTION__));
-
+
return NULL;
}
#if defined(DEBUG_LINUX_MEM_AREAS)
DebugLinuxMemAreaRecordRemove(psLinuxMemArea);
#endif
-
+
ui32PageCount = RANGE_TO_PAGES(psLinuxMemArea->ui32ByteSize);
pvPageList = psLinuxMemArea->uData.sPageList.pvPageList;
hBlockPageList = psLinuxMemArea->uData.sPageList.hBlockPageList;
-
+
#if defined(DEBUG_LINUX_MEMORY_ALLOCATIONS)
DebugMemAllocRecordRemove(DEBUG_MEM_ALLOC_TYPE_ALLOC_PAGES, pvPageList, __FILE__, __LINE__);
#endif
for(i=0;i<(IMG_INT32)ui32PageCount;i++)
{
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15))
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0))
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15))
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0))
ClearPageReserved(pvPageList[i]);
#else
mem_map_reserve(pvPageList[i]);
-#endif
-#endif
+#endif
+#endif
__free_pages(pvPageList[i], 0);
}
(IMG_VOID) OSFreeMem(0, sizeof(*pvPageList) * ui32PageCount, pvPageList, hBlockPageList);
- psLinuxMemArea->uData.sPageList.pvPageList = IMG_NULL;
+ psLinuxMemArea->uData.sPageList.pvPageList = IMG_NULL;
LinuxMemAreaStructFree(psLinuxMemArea);
}
goto err_out;
}
-
+
BUG_ON(ui32PrivDataLength != ui32AllocDataLen &&
ui32PrivDataLength != ui32AllocDataLen * 2);
ui32NumHandlesPerFd = ui32PrivDataLength / ui32AllocDataLen;
-
+
for(i = 0; i < ui32NumHandlesPerFd; i++)
{
memcpy(&asAllocData[i], &pbPrivData[i * ui32AllocDataLen], ui32AllocDataLen);
}
}
-
+
BUG_ON(ui32Bytes != (iNumPages[0] + iNumPages[1]) * PAGE_SIZE);
BUG_ON(sizeof(IMG_CPU_PHYADDR) != sizeof(int));
-
+
pCPUPhysAddrs = vmalloc(sizeof(IMG_CPU_PHYADDR) * (iNumPages[0] + iNumPages[1]));
if(!pCPUPhysAddrs)
{
psLinuxMemArea->ui32AreaFlags = ui32AreaFlags;
INIT_LIST_HEAD(&psLinuxMemArea->sMMapOffsetStructList);
-
+
if(ui32AreaFlags & (PVRSRV_HAP_WRITECOMBINE | PVRSRV_HAP_UNCACHED))
{
psLinuxMemArea->bNeedsCacheInvalidate = IMG_TRUE;
psLinuxMemArea->uData.sIONTilerAlloc.psIONHandle[i] = IMG_NULL;
}
-
+
vfree(psLinuxMemArea->uData.sIONTilerAlloc.pCPUPhysAddrs);
psLinuxMemArea->uData.sIONTilerAlloc.pCPUPhysAddrs = IMG_NULL;
case LINUX_MEM_AREA_ALLOC_PAGES:
ui32PageIndex = PHYS_TO_PFN(ui32ByteOffset);
return psLinuxMemArea->uData.sPageList.pvPageList[ui32PageIndex];
-
+
case LINUX_MEM_AREA_VMALLOC:
pui8Addr = psLinuxMemArea->uData.sVmalloc.pvVmallocAddress;
pui8Addr += ui32ByteOffset;
return vmalloc_to_page(pui8Addr);
-
+
case LINUX_MEM_AREA_SUB_ALLOC:
-
+
return LinuxMemAreaOffsetToPage(psLinuxMemArea->uData.sSubAlloc.psParentLinuxMemArea,
psLinuxMemArea->uData.sSubAlloc.ui32ByteOffset
+ ui32ByteOffset);
return kmem_cache_create(pszName, Size, Align, ui32Flags, NULL
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,22))
, NULL
-#endif
+#endif
);
}
IMG_UINT32 ui32Line)
{
IMG_VOID *pvRet;
-
+
pvRet = kmem_cache_zalloc(psCache, Flags);
#if defined(DEBUG_LINUX_MEMORY_ALLOCATIONS)
PVR_UNREFERENCED_PARAMETER(pszFileName);
PVR_UNREFERENCED_PARAMETER(ui32Line);
#endif
-
+
return pvRet;
}
{
PVR_UNREFERENCED_PARAMETER(psCache);
-
+
return "";
}
IMG_UINT32 ui32Bytes)
{
LinuxMemArea *psLinuxMemArea;
-
+
PVR_ASSERT((ui32ByteOffset+ui32Bytes) <= psParentLinuxMemArea->ui32ByteSize);
-
+
psLinuxMemArea = LinuxMemAreaStructAlloc();
if(!psLinuxMemArea)
{
return NULL;
}
-
+
psLinuxMemArea->eAreaType = LINUX_MEM_AREA_SUB_ALLOC;
psLinuxMemArea->uData.sSubAlloc.psParentLinuxMemArea = psParentLinuxMemArea;
psLinuxMemArea->uData.sSubAlloc.ui32ByteOffset = ui32ByteOffset;
psLinuxMemArea->ui32AreaFlags = psParentLinuxMemArea->ui32AreaFlags;
psLinuxMemArea->bNeedsCacheInvalidate = psParentLinuxMemArea->bNeedsCacheInvalidate;
INIT_LIST_HEAD(&psLinuxMemArea->sMMapOffsetStructList);
-
+
#if defined(DEBUG_LINUX_MEM_AREAS)
{
DEBUG_LINUX_MEM_AREA_REC *psParentRecord;
DebugLinuxMemAreaRecordAdd(psLinuxMemArea, psParentRecord->ui32Flags);
}
#endif
-
+
return psLinuxMemArea;
}
#if defined(DEBUG_LINUX_MEM_AREAS)
DebugLinuxMemAreaRecordRemove(psLinuxMemArea);
#endif
-
-
+
+
LinuxMemAreaStructFree(psLinuxMemArea);
}
LinuxMemAreaStructFree(LinuxMemArea *psLinuxMemArea)
{
KMemCacheFreeWrapper(psLinuxMemAreaCache, psLinuxMemArea);
-
-
+
+
}
{
DEBUG_LINUX_MEM_AREA_REC *psNewRecord;
const IMG_CHAR *pi8FlagsString;
-
+
LinuxLockMutex(&g_sDebugMutex);
if(psLinuxMemArea->eAreaType != LINUX_MEM_AREA_SUB_ALLOC)
}
}
g_LinuxMemAreaCount++;
-
-
+
+
psNewRecord = kmalloc(sizeof(DEBUG_LINUX_MEM_AREA_REC), GFP_KERNEL);
if(psNewRecord)
{
-
+
psNewRecord->psLinuxMemArea = psLinuxMemArea;
psNewRecord->ui32Flags = ui32Flags;
psNewRecord->pid = OSGetCurrentProcessIDKM();
-
+
List_DEBUG_LINUX_MEM_AREA_REC_Insert(&g_LinuxMemAreaRecords, psNewRecord);
}
else
"%s: failed to allocate linux memory area record.",
__FUNCTION__));
}
-
-
+
+
pi8FlagsString = HAPFlagsToString(ui32Flags);
if(strstr(pi8FlagsString, "UNKNOWN"))
{
__FUNCTION__,
ui32Flags,
psLinuxMemArea));
-
+
}
LinuxUnLockMutex(&g_sDebugMutex);
va_list va)
{
LinuxMemArea *psLinuxMemArea;
-
+
psLinuxMemArea = va_arg(va, LinuxMemArea*);
if(psCurrentRecord->psLinuxMemArea == psLinuxMemArea)
{
psCurrentRecord = List_DEBUG_LINUX_MEM_AREA_REC_Any_va(g_LinuxMemAreaRecords,
MatchLinuxMemArea_AnyVaCb,
psLinuxMemArea);
-
+
LinuxUnLockMutex(&g_sDebugMutex);
return psCurrentRecord;
}
g_LinuxMemAreaCount--;
-
+
psCurrentRecord = List_DEBUG_LINUX_MEM_AREA_REC_Any_va(g_LinuxMemAreaRecords,
MatchLinuxMemArea_AnyVaCb,
psLinuxMemArea);
if(psCurrentRecord)
{
-
+
List_DEBUG_LINUX_MEM_AREA_REC_Remove(psCurrentRecord);
kfree(psCurrentRecord);
}
case LINUX_MEM_AREA_SUB_ALLOC:
{
IMG_CHAR *pAddr =
- LinuxMemAreaToCpuVAddr(psLinuxMemArea->uData.sSubAlloc.psParentLinuxMemArea);
+ LinuxMemAreaToCpuVAddr(psLinuxMemArea->uData.sSubAlloc.psParentLinuxMemArea);
if(!pAddr)
{
return NULL;
LinuxMemAreaToCpuPAddr(LinuxMemArea *psLinuxMemArea, IMG_UINT32 ui32ByteOffset)
{
IMG_CPU_PHYADDR CpuPAddr;
-
+
CpuPAddr.uiAddr = 0;
switch(psLinuxMemArea->eAreaType)
break;
}
}
-
+
return CpuPAddr;
}
return IMG_FALSE;
case LINUX_MEM_AREA_SUB_ALLOC:
-
+
return LinuxMemAreaPhysIsContig(psLinuxMemArea->uData.sSubAlloc.psParentLinuxMemArea);
default:
const IMG_CHAR *
LinuxMemAreaTypeToString(LINUX_MEM_AREA_TYPE eMemAreaType)
{
-
+
switch(eMemAreaType)
{
case LINUX_MEM_AREA_IOREMAP:
#if defined(DEBUG_LINUX_MEM_AREAS) || defined(DEBUG_LINUX_MEMORY_ALLOCATIONS)
-static void ProcSeqStartstopDebugMutex(struct seq_file *sfile, IMG_BOOL start)
+static void ProcSeqStartstopDebugMutex(struct seq_file *sfile, IMG_BOOL start)
{
- if(start)
+ if(start)
{
- LinuxLockMutex(&g_sDebugMutex);
+ LinuxLockMutex(&g_sDebugMutex);
}
else
{
LinuxUnLockMutex(&g_sDebugMutex);
}
}
-#endif
+#endif
#if defined(DEBUG_LINUX_MEM_AREAS)
}
}
-
-static void* ProcSeqNextMemArea(struct seq_file *sfile,void* el,loff_t off)
+
+static void* ProcSeqNextMemArea(struct seq_file *sfile,void* el,loff_t off)
{
DEBUG_LINUX_MEM_AREA_REC *psRecord;
psRecord = (DEBUG_LINUX_MEM_AREA_REC*)
static void* ProcSeqOff2ElementMemArea(struct seq_file * sfile, loff_t off)
{
DEBUG_LINUX_MEM_AREA_REC *psRecord;
- if(!off)
+ if(!off)
{
return PVR_PROC_SEQ_START_TOKEN;
}
static void ProcSeqShowMemArea(struct seq_file *sfile,void* el)
{
- DEBUG_LINUX_MEM_AREA_REC *psRecord = (DEBUG_LINUX_MEM_AREA_REC*)el;
- if(el == PVR_PROC_SEQ_START_TOKEN)
+ DEBUG_LINUX_MEM_AREA_REC *psRecord = (DEBUG_LINUX_MEM_AREA_REC*)el;
+ if(el == PVR_PROC_SEQ_START_TOKEN)
{
#if !defined(DEBUG_LINUX_XML_PROC_FILES)
seq_printf( sfile,
"<mem_areas_header>\n"
"\t<count>%u</count>\n"
- "\t<watermark key=\"mar0\" description=\"current\" bytes=\"%u\"/>\n"
- "\t<watermark key=\"mar1\" description=\"high\" bytes=\"%u\"/>\n"
+ "\t<watermark key=\"mar0\" description=\"current\" bytes=\"%u\"/>\n"
+ "\t<watermark key=\"mar1\" description=\"high\" bytes=\"%u\"/>\n"
"</mem_areas_header>\n",
g_LinuxMemAreaCount,
g_LinuxMemAreaWaterMark,
}
-#endif
+#endif
#if defined(DEBUG_LINUX_MEMORY_ALLOCATIONS)
}
-
-static void* ProcSeqNextMemoryRecords(struct seq_file *sfile,void* el,loff_t off)
+
+static void* ProcSeqNextMemoryRecords(struct seq_file *sfile,void* el,loff_t off)
{
DEBUG_MEM_ALLOC_REC *psRecord;
psRecord = (DEBUG_MEM_ALLOC_REC*)
DecOffMemAllocRec_AnyVaCb,
&off);
#if defined(DEBUG_LINUX_XML_PROC_FILES)
- if(!psRecord)
+ if(!psRecord)
{
seq_printf( sfile, "</meminfo>\n");
}
static void* ProcSeqOff2ElementMemoryRecords(struct seq_file *sfile, loff_t off)
{
DEBUG_MEM_ALLOC_REC *psRecord;
- if(!off)
+ if(!off)
{
return PVR_PROC_SEQ_START_TOKEN;
}
&off);
#if defined(DEBUG_LINUX_XML_PROC_FILES)
- if(!psRecord)
+ if(!psRecord)
{
seq_printf( sfile, "</meminfo>\n");
}
static void ProcSeqShowMemoryRecords(struct seq_file *sfile,void* el)
{
DEBUG_MEM_ALLOC_REC *psRecord = (DEBUG_MEM_ALLOC_REC*)el;
- if(el == PVR_PROC_SEQ_START_TOKEN)
+ if(el == PVR_PROC_SEQ_START_TOKEN)
{
#if !defined(DEBUG_LINUX_XML_PROC_FILES)
-
+
seq_printf( sfile, "%-60s: %d bytes\n",
"Current Water Mark of bytes allocated via kmalloc",
g_WaterMarkData[DEBUG_MEM_ALLOC_TYPE_KMALLOC]);
"PrivateData",
"Filename:Line");
-#else
-
-
+#else
+
+
seq_printf( sfile, "<meminfo>\n<meminfo_header>\n");
seq_printf( sfile,
"<watermark key=\"mr0\" description=\"kmalloc_current\" bytes=\"%d\"/>\n",
seq_printf( sfile, "</meminfo_header>\n");
-#endif
+#endif
return;
}
}
}
-#endif
+#endif
#if defined(DEBUG_LINUX_MEM_AREAS) || defined(DEBUG_LINUX_MMAP_AREAS)
"NO_CPU_VIRTUAL",
"UNKNOWN"
};
-
-
+
+
if(ui32Flags & PVRSRV_HAP_UNCACHED){
ui32CacheTypeIndex=0;
}else if(ui32Flags & PVRSRV_HAP_CACHED){
__FUNCTION__, (ui32Flags & PVRSRV_HAP_CACHETYPE_MASK)));
}
-
+
if(ui32Flags & PVRSRV_HAP_KERNEL_ONLY){
ui32MapTypeIndex = 0;
}else if(ui32Flags & PVRSRV_HAP_SINGLE_PROCESS){
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
static inline IMG_UINT32 VMallocToPhys(IMG_VOID *pCpuVAddr)
{
return (page_to_phys(vmalloc_to_page(pCpuVAddr)) + ADDR_TO_PAGE_OFFSET(pCpuVAddr));
-
+
}
typedef enum {
{
struct _sIORemap
{
-
+
IMG_CPU_PHYADDR CPUPhysAddr;
IMG_VOID *pvIORemapCookie;
}sIORemap;
struct _sExternalKV
{
-
+
IMG_BOOL bPhysContig;
union {
-
+
IMG_SYS_PHYADDR SysPhysAddr;
IMG_SYS_PHYADDR *pSysPhysAddr;
} uPhysAddr;
}sExternalKV;
struct _sIO
{
-
+
IMG_CPU_PHYADDR CPUPhysAddr;
}sIO;
struct _sVmalloc
{
-
+
IMG_VOID *pvVmallocAddress;
}sVmalloc;
struct _sPageList
{
-
+
struct page **pvPageList;
IMG_HANDLE hBlockPageList;
}sPageList;
}sIONTilerAlloc;
struct _sSubAlloc
{
-
+
LinuxMemArea *psParentLinuxMemArea;
IMG_UINT32 ui32ByteOffset;
}sSubAlloc;
}uData;
- IMG_UINT32 ui32ByteSize;
+ IMG_UINT32 ui32ByteSize;
- IMG_UINT32 ui32AreaFlags;
+ IMG_UINT32 ui32AreaFlags;
- IMG_BOOL bMMapRegistered;
-
- IMG_BOOL bNeedsCacheInvalidate;
+ IMG_BOOL bMMapRegistered;
+ IMG_BOOL bNeedsCacheInvalidate;
+
struct list_head sMMapItem;
-
+
struct list_head sMMapOffsetStructList;
};
const IMG_CHAR *HAPFlagsToString(IMG_UINT32 ui32Flags);
#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#if defined(DEBUG_LINUX_MMAP_AREAS)
static struct proc_dir_entry *g_ProcMMap;
-#endif
+#endif
#if !defined(PVR_MAKE_ALL_PFNS_SPECIAL)
#define MMAP2_PGOFF_RESOLUTION (32-PAGE_SHIFT+12)
#define FIRST_SPECIAL_PFN (LAST_PHYSICAL_PFN + 1)
#define LAST_SPECIAL_PFN (FIRST_SPECIAL_PFN + MAX_MMAP_HANDLE)
-#else
+#else
#if PAGE_SHIFT != 12
#error This build variant has not yet been made non-4KB page-size aware
#define MAX_MMAP_HANDLE 0x7fffffffUL
#endif
-#endif
+#endif
#if !defined(PVR_MAKE_ALL_PFNS_SPECIAL)
static inline IMG_BOOL
PFNIsPhysical(IMG_UINT32 pfn)
{
-
+
return ( (pfn <= LAST_PHYSICAL_PFN)) ? IMG_TRUE : IMG_FALSE;
}
static inline IMG_BOOL
PFNIsSpecial(IMG_UINT32 pfn)
{
-
+
return ((pfn >= FIRST_SPECIAL_PFN) ) ? IMG_TRUE : IMG_FALSE;
}
#endif
static inline IMG_UINT32
GetCurrentThreadID(IMG_VOID)
{
-
+
return (IMG_UINT32)current->pid;
}
#endif
PVR_DPF((PVR_DBG_ERROR,"PVRMMapRegisterArea: Couldn't alloc another mapping record from cache"));
return IMG_NULL;
}
-
+
psOffsetStruct->ui32MMapOffset = ui32Offset;
psOffsetStruct->psLinuxMemArea = psLinuxMemArea;
psOffsetStruct->ui32RealByteSize = ui32RealByteSize;
-
+
#if !defined(PVR_MAKE_ALL_PFNS_SPECIAL)
psOffsetStruct->ui32TID = GetCurrentThreadID();
#endif
psOffsetStruct->ui32PID = OSGetCurrentProcessIDKM();
#if defined(DEBUG_LINUX_MMAP_AREAS)
-
+
psOffsetStruct->pszName = pszName;
#endif
psOffsetStruct->psLinuxMemArea,
CpuPAddr.uiAddr));
#endif
-
+
KMemCacheFreeWrapper(g_psMemmapCache, psOffsetStruct);
}
{
IMG_UINT32 ui32PageAlignmentOffset;
IMG_CPU_PHYADDR CpuPAddr;
-
+
CpuPAddr = LinuxMemAreaToCpuPAddr(psLinuxMemArea, 0);
ui32PageAlignmentOffset = ADDR_TO_PAGE_OFFSET(CpuPAddr.uiAddr);
-
+
*pui32ByteOffset = ui32PageAlignmentOffset;
*pui32RealByteSize = PAGE_ALIGN(psLinuxMemArea->ui32ByteSize + ui32PageAlignmentOffset);
pui32RealByteSize,
pui32ByteOffset);
-
+
list_for_each_entry(psOffsetStruct, &psLinuxMemArea->sMMapOffsetStructList, sAreaItem)
{
if (psPerProc->ui32PID == psOffsetStruct->ui32PID)
{
PVR_ASSERT(*pui32RealByteSize == psOffsetStruct->ui32RealByteSize);
-
+
*pui32MMapOffset = psOffsetStruct->ui32MMapOffset;
*pui32UserVAddr = psOffsetStruct->ui32UserVAddr;
PVRSRVOffsetStructIncRef(psOffsetStruct);
}
}
-
+
*pui32UserVAddr = 0;
#if !defined(PVR_MAKE_ALL_PFNS_SPECIAL)
goto exit_unlock;
}
-
+
list_add_tail(&psOffsetStruct->sMMapItem, &g_sMMapOffsetStructList);
psOffsetStruct->bOnMMapList = IMG_TRUE;
eError = PVRSRV_OK;
-
+
*pui32MMapOffset = *pui32MMapOffset << (PAGE_SHIFT - 12);
psLinuxMemArea = (LinuxMemArea *)hOSMemHandle;
-
+
list_for_each_entry(psOffsetStruct, &psLinuxMemArea->sMMapOffsetStructList, sAreaItem)
{
if (psOffsetStruct->ui32PID == ui32PID)
}
}
-
+
#if defined (SUPPORT_SID_INTERFACE)
PVR_DPF((PVR_DBG_ERROR, "%s: Mapping data not found for handle %x (memory area %p)", __FUNCTION__, hMHandle, psLinuxMemArea));
#else
if (ui32Offset == psOffsetStruct->ui32MMapOffset && ui32RealByteSize == psOffsetStruct->ui32RealByteSize && psOffsetStruct->ui32PID == ui32PID)
{
#if !defined(PVR_MAKE_ALL_PFNS_SPECIAL)
-
+
if (!PFNIsPhysical(ui32Offset) || psOffsetStruct->ui32TID == ui32TID)
#endif
{
if (psLinuxMemArea->eAreaType == LINUX_MEM_AREA_SUB_ALLOC)
{
- return DoMapToUser(LinuxMemAreaRoot(psLinuxMemArea),
+ return DoMapToUser(LinuxMemAreaRoot(psLinuxMemArea),
ps_vma,
psLinuxMemArea->uData.sSubAlloc.ui32ByteOffset + ui32ByteOffset);
}
-
+
ui32ByteSize = ps_vma->vm_end - ps_vma->vm_start;
PVR_ASSERT(ADDR_TO_PAGE_OFFSET(ui32ByteSize) == 0);
#if defined (__sparc__)
-
+
#error "SPARC not supported"
#endif
PVR_ASSERT(LinuxMemAreaPhysIsContig(psLinuxMemArea));
PVR_ASSERT(LinuxMemAreaToCpuPFN(psLinuxMemArea, ui32ByteOffset) == ps_vma->vm_pgoff);
-
+
result = IO_REMAP_PFN_RANGE(ps_vma, ps_vma->vm_start, ps_vma->vm_pgoff, ui32ByteSize, ps_vma->vm_page_prot);
if(result == 0)
#endif
{
-
+
IMG_UINT32 ulVMAPos;
IMG_UINT32 ui32ByteEnd = ui32ByteOffset + ui32ByteSize;
IMG_UINT32 ui32PA;
#if defined(PVR_MAKE_ALL_PFNS_SPECIAL)
IMG_BOOL bMixedMap = IMG_FALSE;
#endif
-
+
for(ui32PA = ui32ByteOffset; ui32PA < ui32ByteEnd; ui32PA += PAGE_SIZE)
{
IMG_UINT32 pfn = LinuxMemAreaToCpuPFN(psLinuxMemArea, ui32PA);
ps_vma->vm_flags |= VM_MIXEDMAP;
}
#endif
-
+
ulVMAPos = ps_vma->vm_start;
for(ui32PA = ui32ByteOffset; ui32PA < ui32ByteEnd; ui32PA += PAGE_SIZE)
{
PVR_UNREFERENCED_PARAMETER(pFile);
LinuxLockMutex(&g_sMMapMutex);
-
+
ui32ByteSize = ps_vma->vm_end - ps_vma->vm_start;
-
+
PVR_DPF((PVR_DBG_MESSAGE, "%s: Received mmap(2) request with ui32MMapOffset 0x%08lx,"
" and ui32ByteSize %d(0x%08x)",
__FUNCTION__,
ps_vma->vm_pgoff,
ui32ByteSize, ui32ByteSize));
-
+
psOffsetStruct = FindOffsetStructByOffset(ps_vma->vm_pgoff, ui32ByteSize);
if (psOffsetStruct == IMG_NULL)
{
list_del(&psOffsetStruct->sMMapItem);
psOffsetStruct->bOnMMapList = IMG_FALSE;
-
+
if (((ps_vma->vm_flags & VM_WRITE) != 0) &&
((ps_vma->vm_flags & VM_SHARED) == 0))
{
iRetVal = -EINVAL;
goto unlock_and_return;
}
-
+
PVR_DPF((PVR_DBG_MESSAGE, "%s: Mapped psLinuxMemArea 0x%p\n",
__FUNCTION__, psOffsetStruct->psLinuxMemArea));
ps_vma->vm_flags |= VM_RESERVED;
ps_vma->vm_flags |= VM_IO;
-
+
ps_vma->vm_flags |= VM_DONTEXPAND;
-
-
+
+
ps_vma->vm_flags |= VM_DONTCOPY;
ps_vma->vm_private_data = (void *)psOffsetStruct;
-
+
switch(psOffsetStruct->psLinuxMemArea->ui32AreaFlags & PVRSRV_HAP_CACHETYPE_MASK)
{
case PVRSRV_HAP_CACHED:
-
+
break;
case PVRSRV_HAP_WRITECOMBINE:
ps_vma->vm_page_prot = PGPROT_WC(ps_vma->vm_page_prot);
iRetVal = -EINVAL;
goto unlock_and_return;
}
-
-
+
+
ps_vma->vm_ops = &MMapIOOps;
-
+
if(!DoMapToUser(psOffsetStruct->psLinuxMemArea, ps_vma, 0))
{
iRetVal = -EAGAIN;
goto unlock_and_return;
}
-
+
PVR_ASSERT(psOffsetStruct->ui32UserVAddr == 0)
psOffsetStruct->ui32UserVAddr = ps_vma->vm_start;
-
+
if(psOffsetStruct->psLinuxMemArea->bNeedsCacheInvalidate)
{
IMG_UINT32 ui32ByteOffset, ui32DummyByteSize;
psOffsetStruct->psLinuxMemArea->bNeedsCacheInvalidate = IMG_FALSE;
}
-
+
MMapVOpenNoLock(ps_vma);
PVR_DPF((PVR_DBG_MESSAGE, "%s: Mapped area at offset 0x%08lx\n",
#if defined(DEBUG_LINUX_MMAP_AREAS)
-static void ProcSeqStartstopMMapRegistations(struct seq_file *sfile,IMG_BOOL start)
+static void ProcSeqStartstopMMapRegistations(struct seq_file *sfile,IMG_BOOL start)
{
- if(start)
+ if(start)
{
- LinuxLockMutex(&g_sMMapMutex);
+ LinuxLockMutex(&g_sMMapMutex);
}
else
{
static void* ProcSeqOff2ElementMMapRegistrations(struct seq_file *sfile, loff_t off)
{
LinuxMemArea *psLinuxMemArea;
- if(!off)
+ if(!off)
{
return PVR_PROC_SEQ_START_TOKEN;
}
{
off--;
if (off == 0)
- {
+ {
PVR_ASSERT(psOffsetStruct->psLinuxMemArea == psLinuxMemArea);
return (void*)psOffsetStruct;
}
IMG_UINT32 ui32RealByteSize;
IMG_UINT32 ui32ByteOffset;
- if(el == PVR_PROC_SEQ_START_TOKEN)
+ if(el == PVR_PROC_SEQ_START_TOKEN)
{
seq_printf( sfile,
#if !defined(DEBUG_LINUX_XML_PROC_FILES)
PVR_ASSERT(psLinuxMemArea->eAreaType != LINUX_MEM_AREA_SUB_ALLOC || LinuxMemAreaRoot(psLinuxMemArea)->eAreaType != LINUX_MEM_AREA_SUB_ALLOC);
-
+
if(psLinuxMemArea->bMMapRegistered)
{
PVR_DPF((PVR_DBG_ERROR, "%s: psLinuxMemArea 0x%p is already registered",
#if defined(DEBUG_LINUX_MMAP_AREAS)
g_ui32RegisteredAreas++;
-
+
if (psLinuxMemArea->eAreaType != LINUX_MEM_AREA_SUB_ALLOC)
{
g_ui32TotalByteSize += psLinuxMemArea->ui32ByteSize;
}
else
{
-
+
PVR_DPF((PVR_DBG_WARNING, "%s: psOffsetStruct 0x%p was never mapped", __FUNCTION__, psOffsetStruct));
}
}
#if defined(DEBUG_LINUX_MMAP_AREAS)
- g_ProcMMap = CreateProcReadEntrySeq("mmap", NULL,
+ g_ProcMMap = CreateProcReadEntrySeq("mmap", NULL,
ProcSeqNextMMapRegistrations,
ProcSeqShowMMapRegistrations,
ProcSeqOff2ElementMMapRegistrations,
ProcSeqStartstopMMapRegistations
);
-#endif
+#endif
return;
error:
LinuxMemArea *psLinuxMemArea, *psTmpMemArea;
PVR_DPF((PVR_DBG_ERROR, "%s: Memory areas are still registered with MMap", __FUNCTION__));
-
+
PVR_TRACE(("%s: Unregistering memory areas", __FUNCTION__));
list_for_each_entry_safe(psLinuxMemArea, psTmpMemArea, &g_sMMapAreaList, sMMapItem)
{
#if defined(DEBUG_LINUX_MMAP_AREAS)
RemoveProcEntrySeq(g_ProcMMap);
-#endif
+#endif
if(g_psMemmapCache)
{
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
typedef struct KV_OFFSET_STRUCT_TAG
{
-
+
IMG_UINT32 ui32Mapped;
-
+
IMG_UINT32 ui32MMapOffset;
-
+
IMG_UINT32 ui32RealByteSize;
-
+
LinuxMemArea *psLinuxMemArea;
-
+
#if !defined(PVR_MAKE_ALL_PFNS_SPECIAL)
-
+
IMG_UINT32 ui32TID;
#endif
-
+
IMG_UINT32 ui32PID;
-
+
IMG_BOOL bOnMMapList;
-
+
IMG_UINT32 ui32RefCount;
-
+
IMG_UINT32 ui32UserVAddr;
-
+
#if defined(DEBUG_LINUX_MMAP_AREAS)
const IMG_CHAR *pszName;
#endif
-
-
+
+
struct list_head sMMapItem;
-
+
struct list_head sAreaItem;
}KV_OFFSET_STRUCT, *PKV_OFFSET_STRUCT;
int PVRMMap(struct file* pFile, struct vm_area_struct* ps_vma);
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#if defined(SUPPORT_DRI_DRM) && !defined(SUPPORT_DRI_DRM_PLUGIN)
#define PVR_MOD_STATIC
#else
-
+
#if defined(LDM_PLATFORM)
#define PVR_LDM_PLATFORM_MODULE
#define PVR_LDM_MODULE
#if defined(PVR_LDM_PLATFORM_MODULE)
#include <linux/platform_device.h>
-#endif
+#endif
#if defined(PVR_LDM_PCI_MODULE)
#include <linux/pci.h>
-#endif
+#endif
#if defined(DEBUG) && defined(PVR_MANUAL_POWER_CONTROL)
#include <asm/uaccess.h>
#endif
-#if defined(PVR_LDM_MODULE) || defined(PVR_DRI_DRM_PLATFORM_DEV)
-#include <asm/atomic.h>
-#endif
-
#include "img_defs.h"
#include "services.h"
#include "kerneldisplay.h"
extern IMG_UINT32 gPVRDebugLevel;
module_param(gPVRDebugLevel, uint, 0644);
MODULE_PARM_DESC(gPVRDebugLevel, "Sets the level of debug output (default 0x7)");
-#endif
+#endif
#if defined(CONFIG_ION_OMAP)
#include <linux/ion.h>
EXPORT_SYMBOL(gpsIONClient);
#endif
-
+
EXPORT_SYMBOL(PVRGetDisplayClassJTable);
EXPORT_SYMBOL(PVRGetBufferClassJTable);
#if defined(PVR_LDM_PLATFORM_MODULE)
#define LDM_DEV struct platform_device
#define LDM_DRV struct platform_driver
-#endif
+#endif
#if defined(PVR_LDM_PCI_MODULE)
#define LDM_DEV struct pci_dev
#define LDM_DRV struct pci_driver
-#endif
+#endif
#if defined(PVR_LDM_PLATFORM_MODULE)
static int PVRSRVDriverRemove(LDM_DEV *device);
static int PVRSRVDriverProbe(LDM_DEV *device);
PVR_TRACE(("PVRSRVDriverProbe(pDevice=%p)", pDevice));
#if 0
-
+
if (PerDeviceSysInitialise((IMG_PVOID)pDevice) != PVRSRV_OK)
{
return -EINVAL;
}
-#endif
-
+#endif
+
psSysData = SysAcquireDataNoCheck();
if (psSysData == IMG_NULL)
{
#endif
SysAcquireData(&psSysData);
-
+
#if defined(DEBUG) && defined(PVR_MANUAL_POWER_CONTROL)
if (gPVRPowerLevel != 0)
{
return;
#endif
}
-#endif
+#endif
#if defined(PVR_LDM_MODULE) || defined(PVR_DRI_DRM_PLATFORM_DEV)
PVR_MOD_STATIC void PVRSRVDriverShutdown(LDM_DEV *pDevice)
#endif
{
- static atomic_t sDriverIsShutdown = ATOMIC_INIT(1);
-
PVR_TRACE(("PVRSRVDriverShutdown(pDevice=%p)", pDevice));
- if (atomic_dec_and_test(&sDriverIsShutdown))
- {
-
- LinuxLockMutex(&gPVRSRVLock);
-
- (void) PVRSRVSetPowerStateKM(PVRSRV_SYS_POWER_STATE_D3);
- }
+ (void) PVRSRVSetPowerStateKM(PVRSRV_SYS_POWER_STATE_D3);
}
-#endif
+#endif
#if defined(PVR_LDM_MODULE) || defined(SUPPORT_DRI_DRM)
#endif
return 0;
}
-#endif
+#endif
#if defined(DEBUG) && defined(PVR_MANUAL_POWER_CONTROL) && !defined(SUPPORT_DRI_DRM)
return (count);
}
-void ProcSeqShowPowerLevel(struct seq_file *sfile,void* el)
+void ProcSeqShowPowerLevel(struct seq_file *sfile,void* el)
{
seq_printf(sfile, "%lu\n", gPVRPowerLevel);
}
psPrivateData->hBlockAlloc = hBlockAlloc;
PRIVATE_DATA(pFile) = psPrivateData;
iRet = 0;
-err_unlock:
+err_unlock:
LinuxUnLockMutex(&gPVRSRVLock);
return iRet;
}
}
}
-
+
gui32ReleasePID = psPrivateData->ui32OpenPID;
PVRSRVProcessDisconnect(psPrivateData->ui32OpenPID);
gui32ReleasePID = 0;
psPrivateData, psPrivateData->hBlockAlloc);
#if !defined(SUPPORT_DRI_DRM)
- PRIVATE_DATA(pFile) = IMG_NULL;
+ PRIVATE_DATA(pFile) = IMG_NULL;
#endif
}
#endif
#if !defined(SUPPORT_DRI_DRM)
-
+
PVRDPFInit();
#endif
PVR_TRACE(("PVRCore_Init"));
#endif
#if !defined(PVR_LDM_MODULE)
-
+
if ((eError = SysInitialise()) != PVRSRV_OK)
{
error = -ENODEV;
#endif
goto init_failed;
}
-#endif
+#endif
#if !defined(SUPPORT_DRI_DRM)
AssignedMajorNumber = register_chrdev(0, DEVNAME, &pvrsrv_fops);
PVR_TRACE(("PVRCore_Init: major device %d", AssignedMajorNumber));
#if defined(PVR_LDM_MODULE)
-
+
psPvrClass = class_create(THIS_MODULE, "pvr");
if (IS_ERR(psPvrClass))
psDev = device_create(psPvrClass, NULL, MKDEV(AssignedMajorNumber, 0),
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,26))
NULL,
-#endif
+#endif
DEVNAME);
if (IS_ERR(psDev))
{
platform_driver_unregister(&powervr_driver);
#endif
-#else
-
+#else
+
{
SYS_DATA *psSysData;
(void) SysDeinitialise(psSysData);
}
}
-#endif
+#endif
init_failed:
PVRMMapCleanup();
LinuxMMCleanup();
return error;
-}
+}
#if defined(SUPPORT_DRI_DRM)
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,22))
if (
-#endif
+#endif
unregister_chrdev((IMG_UINT)AssignedMajorNumber, DEVNAME)
#if !(LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,22))
;
-#else
+#else
)
{
PVR_DPF((PVR_DBG_ERROR," can't unregister device major %d", AssignedMajorNumber));
}
-#endif
-#endif
+#endif
+#endif
#if defined(PVR_LDM_MODULE)
platform_driver_unregister(&powervr_driver);
#endif
-#else
+#else
#if defined(DEBUG) && defined(PVR_MANUAL_POWER_CONTROL)
if (gPVRPowerLevel != 0)
{
}
}
#endif
-
+
(void) SysDeinitialise(psSysData);
-#endif
+#endif
PVRMMapCleanup();
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
}
-#else
+#else
IMG_VOID LinuxInitMutex(PVRSRV_LINUX_MUTEX *psPVRSRVMutex)
{
if(down_interruptible(&psPVRSRVMutex->sSemaphore) == -EINTR)
{
-
+
return PVRSRV_ERROR_MUTEX_INTERRUPTIBLE_ERROR;
}else{
atomic_dec(&psPVRSRVMutex->Count);
IMG_BOOL LinuxIsLockedMutex(PVRSRV_LINUX_MUTEX *psPVRSRVMutex)
{
IMG_INT32 iCount;
-
+
iCount = atomic_read(&psPVRSRVMutex->Count);
return (IMG_BOOL)iCount;
}
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
typedef struct mutex PVRSRV_LINUX_MUTEX;
-#else
+#else
typedef struct {
struct semaphore sSemaphore;
-
+
atomic_t Count;
}PVRSRV_LINUX_MUTEX;
extern IMG_BOOL LinuxIsLockedMutex(PVRSRV_LINUX_MUTEX *psPVRSRVMutex);
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
static IMG_VOID
PVRLinuxX86PATProbe(IMG_VOID)
{
-
- if (cpu_has_pat)
+
+ if (cpu_has_pat)
{
u64 pat;
IMG_UINT pat_index;
IMG_UINT pat_entry;
PVR_TRACE(("%s: PAT available", __FUNCTION__));
-
+
rdmsrl(MSR_IA32_CR_PAT, pat);
PVR_TRACE(("%s: Top 32 bits of PAT: 0x%.8x", __FUNCTION__, (IMG_UINT)(pat >> 32)));
PVR_TRACE(("%s: Bottom 32 bits of PAT: 0x%.8x", __FUNCTION__, (IMG_UINT)(pat)));
{
PVR_TRACE(("%s: Write combining not available", __FUNCTION__));
}
-#else
+#else
PVR_TRACE(("%s: Write combining disabled in driver build", __FUNCTION__));
-#endif
-#endif
+#endif
+#endif
}
pgprot_t
pvr_pgprot_writecombine(pgprot_t prot)
{
-
-
+
+
return (g_write_combining_available) ?
__pgprot((pgprot_val(prot) & ~_PAGE_CACHE_MASK) | _PAGE_CACHE_WC) : pgprot_noncached(prot);
}
-#endif
+#endif
IMG_VOID
PVRLinuxMUtilsInit(IMG_VOID)
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#if defined(__i386__) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26))
#define IOREMAP(pa, bytes) ioremap_cache(pa, bytes)
-#else
+#else
#if defined(__arm__) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
#define IOREMAP(pa, bytes) ioremap_cached(pa, bytes)
#else
IMG_VOID PVRLinuxMUtilsInit(IMG_VOID);
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#include <asm/cacheflush.h>
#include <linux/mm.h>
#include <linux/pagemap.h>
-#include <linux/hugetlb.h>
+#include <linux/hugetlb.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/delay.h>
if (ui32Size > PAGE_SIZE)
{
-
+
#if defined(DEBUG_LINUX_MEMORY_ALLOCATIONS)
*ppvCpuVAddr = _VMallocWrapper(ui32Size, PVRSRV_HAP_CACHED, pszFilename, ui32Line);
#else
return lAddr >= VMALLOC_START && lAddr < VMALLOC_END;
}
-#endif
+#endif
#if !defined(DEBUG_LINUX_MEMORY_ALLOCATIONS)
PVRSRV_ERROR OSFreeMem_Impl(IMG_UINT32 ui32Flags, IMG_UINT32 ui32Size, IMG_PVOID pvCpuVAddr, IMG_HANDLE hBlockAlloc)
#else
PVRSRV_ERROR OSFreeMem_Impl(IMG_UINT32 ui32Flags, IMG_UINT32 ui32Size, IMG_PVOID pvCpuVAddr, IMG_HANDLE hBlockAlloc, IMG_CHAR *pszFilename, IMG_UINT32 ui32Line)
#endif
-{
+{
PVR_UNREFERENCED_PARAMETER(ui32Flags);
PVR_UNREFERENCED_PARAMETER(ui32Size);
PVR_UNREFERENCED_PARAMETER(hBlockAlloc);
PVR_UNREFERENCED_PARAMETER(ui32PageSize);
#if 0
-
+
if(ui32AllocFlags & PVRSRV_HAP_SINGLE_PROCESS)
{
ui32AllocFlags &= ~PVRSRV_HAP_SINGLE_PROCESS;
}
case PVRSRV_HAP_SINGLE_PROCESS:
{
-
+
psLinuxMemArea = NewAllocPagesLinuxMemArea(ui32Size, ui32AllocFlags);
if(!psLinuxMemArea)
{
case PVRSRV_HAP_MULTI_PROCESS:
{
-
+
#if defined(VIVT_CACHE) || defined(__sh__)
-
+
ui32AllocFlags &= ~PVRSRV_HAP_CACHED;
#endif
psLinuxMemArea = NewVMallocLinuxMemArea(ui32Size, ui32AllocFlags);
ExitSkipSwitch:
*ppvCpuVAddr = LinuxMemAreaToCpuVAddr(psLinuxMemArea);
*phOSMemHandle = psLinuxMemArea;
-
+
LinuxMemAreaRegister(psLinuxMemArea);
return PVRSRV_OK;
PVRSRV_ERROR
OSFreePages(IMG_UINT32 ui32AllocFlags, IMG_UINT32 ui32Bytes, IMG_VOID *pvCpuVAddr, IMG_HANDLE hOSMemHandle)
-{
+{
LinuxMemArea *psLinuxMemArea;
PVRSRV_ERROR eError;
-
+
PVR_UNREFERENCED_PARAMETER(ui32Bytes);
PVR_UNREFERENCED_PARAMETER(pvCpuVAddr);
-
+
psLinuxMemArea = (LinuxMemArea *)hOSMemHandle;
switch(ui32AllocFlags & PVRSRV_HAP_MAPTYPE_MASK)
PVRSRV_ERROR eError;
psParentLinuxMemArea = (LinuxMemArea *)hOSMemHandle;
-
+
psLinuxMemArea = NewSubLinuxMemArea(psParentLinuxMemArea, ui32ByteOffset, ui32Bytes);
if(!psLinuxMemArea)
{
}
*phOSMemHandleRet = psLinuxMemArea;
-
+
if(ui32Flags & PVRSRV_HAP_KERNEL_ONLY)
{
return PVRSRV_OK;
{
LinuxMemArea *psLinuxMemArea;
PVRSRV_ERROR eError;
-
+
psLinuxMemArea = (LinuxMemArea *)hOSMemHandle;
PVR_ASSERT(psLinuxMemArea->eAreaType == LINUX_MEM_AREA_SUB_ALLOC);
-
+
if((ui32Flags & PVRSRV_HAP_KERNEL_ONLY) == 0)
{
eError = PVRMMapRemoveRegisteredArea(psLinuxMemArea);
}
else
{
- PVR_DPF((PVR_DBG_MESSAGE,"OSBreakResourceLock: Resource is not locked for this process."));
+ PVR_DPF((PVR_DBG_MESSAGE,"OSBreakResourceLock: Resource is not locked for this process."));
}
}
else
{
ENV_DATA *psEnvData;
PVRSRV_ERROR eError;
-
-
+
+
eError = OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(ENV_DATA), (IMG_VOID **)&psEnvData, IMG_NULL,
"Environment Data");
if (eError != PVRSRV_OK)
return eError;
}
- eError = OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP, PVRSRV_MAX_BRIDGE_IN_SIZE + PVRSRV_MAX_BRIDGE_OUT_SIZE,
+ eError = OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP, PVRSRV_MAX_BRIDGE_IN_SIZE + PVRSRV_MAX_BRIDGE_OUT_SIZE,
&psEnvData->pvBridgeData, IMG_NULL,
"Bridge Data");
if (eError != PVRSRV_OK)
{
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(ENV_DATA), psEnvData, IMG_NULL);
-
+
return eError;
}
-
+
psEnvData->bMISRInstalled = IMG_FALSE;
psEnvData->bLISRInstalled = IMG_FALSE;
-
+
*ppvEnvSpecificData = psEnvData;
return PVRSRV_OK;
psEnvData->pvBridgeData = IMG_NULL;
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(ENV_DATA), pvEnvSpecificData, IMG_NULL);
-
+
return PVRSRV_OK;
}
-
+
IMG_VOID OSReleaseThreadQuanta(IMG_VOID)
{
schedule();
}
-
+
IMG_UINT32 OSClockus(IMG_VOID)
{
IMG_UINT32 time, j = jiffies;
}
-
+
IMG_HANDLE OSFuncHighResTimerCreate(IMG_VOID)
{
-
+
return (IMG_HANDLE) 1;
}
-
+
IMG_UINT32 OSFuncHighResTimerGetus(IMG_HANDLE hTimer)
{
return (IMG_UINT32) jiffies_to_usecs(jiffies);
}
-
+
IMG_VOID OSFuncHighResTimerDestroy(IMG_HANDLE hTimer)
{
PVR_UNREFERENCED_PARAMETER(hTimer);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19))
PVR_UNREFERENCED_PARAMETER(regs);
-#endif
+#endif
psDeviceNode = (PVRSRV_DEVICE_NODE*)dev_id;
if(!psDeviceNode)
{
psEnvData->pvISRCookie = pvDeviceNode;
psEnvData->bLISRInstalled = IMG_TRUE;
- return PVRSRV_OK;
+ return PVRSRV_OK;
}
PVRSRV_ERROR OSUninstallDeviceLISR(IMG_VOID *pvSysData)
PVR_DPF((PVR_DBG_ERROR, "OSUninstallDeviceLISR: No LISR has been installed"));
return PVRSRV_ERROR_ISR_NOT_INSTALLED;
}
-
+
PVR_TRACE(("Uninstalling device LISR on IRQ %d with cookie %p", psEnvData->ui32IRQ, psEnvData->pvISRCookie));
free_irq(psEnvData->ui32IRQ, psEnvData->pvISRCookie);
psEnvData->pvISRCookie = pvSysData;
psEnvData->bLISRInstalled = IMG_TRUE;
- return PVRSRV_OK;
+ return PVRSRV_OK;
}
queue_work(psEnvData->psWorkQueue, &psEnvData->sMISRWork);
}
- return PVRSRV_OK;
+ return PVRSRV_OK;
}
-#else
+#else
#if defined(PVR_LINUX_MISR_USING_WORKQUEUE)
static void MISRWrapper(
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20))
schedule_work(&psEnvData->sMISRWork);
}
- return PVRSRV_OK;
+ return PVRSRV_OK;
}
-#else
+#else
static void MISRWrapper(unsigned long data)
SYS_DATA *psSysData;
psSysData = (SYS_DATA *)data;
-
+
PVRSRVMISR(psSysData);
}
tasklet_schedule(&psEnvData->sMISRTasklet);
}
- return PVRSRV_OK;
+ return PVRSRV_OK;
}
-#endif
-#endif
+#endif
+#endif
-#endif
+#endif
IMG_VOID OSPanic(IMG_VOID)
{
}
else
{
- PVR_DPF((PVR_DBG_ERROR,"OSUnlockResource: Resource %p is not locked with expected value.", psResource));
+ PVR_DPF((PVR_DBG_ERROR,"OSUnlockResource: Resource %p is not locked with expected value.", psResource));
PVR_DPF((PVR_DBG_MESSAGE,"Should be %x is actually %x", ui32ID, psResource->ui32ID));
eError = PVRSRV_ERROR_INVALID_LOCK_ID;
}
PVR_DPF((PVR_DBG_ERROR,"OSUnlockResource: Resource %p is not locked", psResource));
eError = PVRSRV_ERROR_RESOURCE_NOT_LOCKED;
}
-
+
return eError;
}
IMG_VOID OSPowerLockUnwrap (IMG_VOID)
{
}
-#endif
+#endif
IMG_CPU_PHYADDR OSMapLinToCPUPhys(IMG_HANDLE hOSMemHandle,
PVR_ASSERT(hOSMemHandle != IMG_NULL);
-
+
psLinuxMemArea = (LinuxMemArea *)hOSMemHandle;
{
if(ui32MappingFlags & PVRSRV_HAP_KERNEL_ONLY)
{
-
+
if(phOSMemHandle == IMG_NULL)
{
IMG_VOID *pvIORemapCookie;
{
PVR_TRACE(("%s: unmapping %d bytes from %p", __FUNCTION__, ui32Bytes, pvLinAddr));
- PVR_UNREFERENCED_PARAMETER(ui32Bytes);
+ PVR_UNREFERENCED_PARAMETER(ui32Bytes);
if(ui32MappingFlags & PVRSRV_HAP_KERNEL_ONLY)
{
LinuxMemArea *psLinuxMemArea = (LinuxMemArea *)hOSMemHandle;
PVR_ASSERT(LinuxMemAreaToCpuVAddr(psLinuxMemArea) == pvLinAddr);
-
+
FreeIORemapLinuxMemArea(psLinuxMemArea);
}
case PVRSRV_HAP_KERNEL_ONLY:
{
psLinuxMemArea = NewExternalKVLinuxMemArea(pBasePAddr, pvCPUVAddr, ui32Bytes, bPhysContig, ui32MappingFlags);
-
+
if(!psLinuxMemArea)
{
return PVRSRV_ERROR_BAD_MAPPING;
}
case PVRSRV_HAP_MULTI_PROCESS:
{
-
+
#if defined(VIVT_CACHE) || defined(__sh__)
-
+
ui32MappingFlags &= ~PVRSRV_HAP_CACHED;
#endif
psLinuxMemArea = NewExternalKVLinuxMemArea(pBasePAddr, pvCPUVAddr, ui32Bytes, bPhysContig, ui32MappingFlags);
*phOSMemHandle = (IMG_HANDLE)0;
return PVRSRV_ERROR_INVALID_FLAGS;
}
-
+
*phOSMemHandle = (IMG_HANDLE)psLinuxMemArea;
LinuxMemAreaRegister(psLinuxMemArea);
LinuxMemArea *psLinuxMemArea;
#if 0
-
+
if(ui32MappingFlags & PVRSRV_HAP_SINGLE_PROCESS)
{
ui32MappingFlags &= ~PVRSRV_HAP_SINGLE_PROCESS;
{
case PVRSRV_HAP_KERNEL_ONLY:
{
-
+
psLinuxMemArea = NewIORemapLinuxMemArea(BasePAddr, ui32Bytes, ui32MappingFlags);
if(!psLinuxMemArea)
{
}
case PVRSRV_HAP_SINGLE_PROCESS:
{
-
+
psLinuxMemArea = NewIOLinuxMemArea(BasePAddr, ui32Bytes, ui32MappingFlags);
if(!psLinuxMemArea)
{
}
case PVRSRV_HAP_MULTI_PROCESS:
{
-
+
#if defined(VIVT_CACHE) || defined(__sh__)
-
+
ui32MappingFlags &= ~PVRSRV_HAP_CACHED;
#endif
psLinuxMemArea = NewIORemapLinuxMemArea(BasePAddr, ui32Bytes, ui32MappingFlags);
PVR_UNREFERENCED_PARAMETER(ui32Bytes);
psLinuxMemArea = (LinuxMemArea *)hOSMemHandle;
-
+
switch(ui32MappingFlags & PVRSRV_HAP_MAPTYPE_MASK)
{
case PVRSRV_HAP_KERNEL_ONLY:
return PVRSRV_ERROR_INVALID_PARAMS;
}
}
-
+
LinuxMemAreaDeepFree(psLinuxMemArea);
return PVRSRV_OK;
psPhysAddr->uiAddr = virt_to_phys(pvKernLinAddr);
return PVRSRV_OK;
-#endif
+#endif
}
return IMG_NULL;
}
- if (psPVRPCI->ePCIFlags & HOST_PCI_INIT_FLAG_BUS_MASTER)
+ if (psPVRPCI->ePCIFlags & HOST_PCI_INIT_FLAG_BUS_MASTER)
{
pci_set_master(psPVRPCI->psPCIDev);
}
- if (psPVRPCI->ePCIFlags & HOST_PCI_INIT_FLAG_MSI)
+ if (psPVRPCI->ePCIFlags & HOST_PCI_INIT_FLAG_MSI)
{
#if defined(CONFIG_PCI_MSI)
err = pci_enable_msi(psPVRPCI->psPCIDev);
if (err != 0)
{
PVR_DPF((PVR_DBG_WARNING, "OSPCISetDev: Couldn't enable MSI (%d)", err));
- psPVRPCI->ePCIFlags &= ~HOST_PCI_INIT_FLAG_MSI;
+ psPVRPCI->ePCIFlags &= ~HOST_PCI_INIT_FLAG_MSI;
}
#else
PVR_DPF((PVR_DBG_WARNING, "OSPCISetDev: MSI support not enabled in the kernel"));
#endif
}
-
+
for (i = 0; i < DEVICE_COUNT_RESOURCE; i++)
{
psPVRPCI->abPCIResourceInUse[i] = IMG_FALSE;
IMG_UINT32 OSPCIAddrRangeLen(PVRSRV_PCI_DEV_HANDLE hPVRPCI, IMG_UINT32 ui32Index)
{
- return OSPCIAddrRangeFunc(HOST_PCI_ADDR_RANGE_FUNC_LEN, hPVRPCI, ui32Index);
+ return OSPCIAddrRangeFunc(HOST_PCI_ADDR_RANGE_FUNC_LEN, hPVRPCI, ui32Index);
}
IMG_UINT32 OSPCIAddrRangeStart(PVRSRV_PCI_DEV_HANDLE hPVRPCI, IMG_UINT32 ui32Index)
{
- return OSPCIAddrRangeFunc(HOST_PCI_ADDR_RANGE_FUNC_START, hPVRPCI, ui32Index);
+ return OSPCIAddrRangeFunc(HOST_PCI_ADDR_RANGE_FUNC_START, hPVRPCI, ui32Index);
}
IMG_UINT32 OSPCIAddrRangeEnd(PVRSRV_PCI_DEV_HANDLE hPVRPCI, IMG_UINT32 ui32Index)
{
- return OSPCIAddrRangeFunc(HOST_PCI_ADDR_RANGE_FUNC_END, hPVRPCI, ui32Index);
+ return OSPCIAddrRangeFunc(HOST_PCI_ADDR_RANGE_FUNC_END, hPVRPCI, ui32Index);
}
PVRSRV_ERROR OSPCIRequestAddrRange(PVRSRV_PCI_DEV_HANDLE hPVRPCI,
PVR_TRACE(("OSPCIReleaseDev"));
-
+
for (i = 0; i < DEVICE_COUNT_RESOURCE; i++)
{
if (psPVRPCI->abPCIResourceInUse[i])
}
#if defined(CONFIG_PCI_MSI)
- if (psPVRPCI->ePCIFlags & HOST_PCI_INIT_FLAG_MSI)
+ if (psPVRPCI->ePCIFlags & HOST_PCI_INIT_FLAG_MSI)
{
pci_disable_msi(psPVRPCI->psPCIDev);
}
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
- if (psPVRPCI->ePCIFlags & HOST_PCI_INIT_FLAG_BUS_MASTER)
+ if (psPVRPCI->ePCIFlags & HOST_PCI_INIT_FLAG_BUS_MASTER)
{
pci_clear_master(psPVRPCI->psPCIDev);
}
pci_disable_device(psPVRPCI->psPCIDev);
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(*psPVRPCI), (IMG_VOID *)psPVRPCI, IMG_NULL);
-
+
return PVRSRV_OK;
}
PVR_TRACE(("OSPCISuspendDev"));
-
+
for (i = 0; i < DEVICE_COUNT_RESOURCE; i++)
{
if (psPVRPCI->abPCIResourceInUse[i])
return PVRSRV_ERROR_PCI_CALL_FAILED;
}
- if (psPVRPCI->ePCIFlags & HOST_PCI_INIT_FLAG_BUS_MASTER)
+ if (psPVRPCI->ePCIFlags & HOST_PCI_INIT_FLAG_BUS_MASTER)
pci_set_master(psPVRPCI->psPCIDev);
-
+
for (i = 0; i < DEVICE_COUNT_RESOURCE; i++)
{
if (psPVRPCI->abPCIResourceInUse[i])
return PVRSRV_OK;
}
-#endif
+#endif
#define OS_MAX_TIMERS 8
{
IMG_BOOL bInUse;
PFN_TIMER_FUNC pfnTimerFunc;
- IMG_VOID *pvData;
+ IMG_VOID *pvData;
struct timer_list sTimer;
IMG_UINT32 ui32Delay;
IMG_BOOL bActive;
DEFINE_MUTEX(sTimerStructLock);
#else
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39))
-
+
static spinlock_t sTimerStructLock = __SPIN_LOCK_UNLOCKED();
#else
static DEFINE_SPINLOCK(sTimerStructLock);
if (!psTimerCBData->bActive)
return;
-
+
psTimerCBData->pfnTimerFunc(psTimerCBData->pvData);
-
-
+
+
mod_timer(&psTimerCBData->sTimer, psTimerCBData->ui32Delay + jiffies);
}
static IMG_VOID OSTimerCallbackWrapper(IMG_UINT32 ui32Data)
{
TIMER_CALLBACK_DATA *psTimerCBData = (TIMER_CALLBACK_DATA*)ui32Data;
-
+
#if defined(PVR_LINUX_TIMERS_USING_WORKQUEUES) || defined(PVR_LINUX_TIMERS_USING_SHARED_WORKQUEUE)
int res;
#endif
if (res == 0)
{
- PVR_DPF((PVR_DBG_WARNING, "OSTimerCallbackWrapper: work already queued"));
+ PVR_DPF((PVR_DBG_WARNING, "OSTimerCallbackWrapper: work already queued"));
}
#else
OSTimerCallbackBody(psTimerCBData);
unsigned long ulLockFlags;
#endif
-
+
if(!pfnTimerFunc)
{
- PVR_DPF((PVR_DBG_ERROR, "OSAddTimer: passed invalid callback"));
- return IMG_NULL;
+ PVR_DPF((PVR_DBG_ERROR, "OSAddTimer: passed invalid callback"));
+ return IMG_NULL;
}
-
-
+
+
#if defined(PVR_LINUX_TIMERS_USING_WORKQUEUES) || defined(PVR_LINUX_TIMERS_USING_SHARED_WORKQUEUE)
mutex_lock(&sTimerStructLock);
#else
#endif
if (ui32i >= OS_MAX_TIMERS)
{
- PVR_DPF((PVR_DBG_ERROR, "OSAddTimer: all timers are in use"));
- return IMG_NULL;
+ PVR_DPF((PVR_DBG_ERROR, "OSAddTimer: all timers are in use"));
+ return IMG_NULL;
}
psTimerCBData->pfnTimerFunc = pfnTimerFunc;
psTimerCBData->pvData = pvData;
psTimerCBData->bActive = IMG_FALSE;
-
-
+
+
psTimerCBData->ui32Delay = ((HZ * ui32MsTimeout) < 1000)
? 1
: ((HZ * ui32MsTimeout) / 1000);
-
+
init_timer(&psTimerCBData->sTimer);
-
-
-
+
+
+
psTimerCBData->sTimer.function = (IMG_VOID *)OSTimerCallbackWrapper;
psTimerCBData->sTimer.data = (IMG_UINT32)psTimerCBData;
-
+
return (IMG_HANDLE)(ui32i + 1);
}
PVR_ASSERT(psTimerCBData->bInUse);
PVR_ASSERT(!psTimerCBData->bActive);
-
+
psTimerCBData->bInUse = IMG_FALSE;
-
+
return PVRSRV_OK;
}
PVR_ASSERT(psTimerCBData->bInUse);
PVR_ASSERT(!psTimerCBData->bActive);
-
+
psTimerCBData->bActive = IMG_TRUE;
-
+
psTimerCBData->sTimer.expires = psTimerCBData->ui32Delay + jiffies;
-
+
add_timer(&psTimerCBData->sTimer);
-
+
return PVRSRV_OK;
}
PVR_ASSERT(psTimerCBData->bInUse);
PVR_ASSERT(psTimerCBData->bActive);
-
+
psTimerCBData->bActive = IMG_FALSE;
smp_mb();
flush_scheduled_work();
#endif
-
- del_timer_sync(&psTimerCBData->sTimer);
-
+
+ del_timer_sync(&psTimerCBData->sTimer);
+
#if defined(PVR_LINUX_TIMERS_USING_WORKQUEUES)
-
+
flush_workqueue(psTimerWorkQueue);
#endif
#if defined(PVR_LINUX_TIMERS_USING_SHARED_WORKQUEUE)
{
PVRSRV_ERROR eError = PVRSRV_OK;
-
+
if(psEventObject)
{
if (pszName && strlen(pszName) < EVENTOBJNAME_MAXLENGTH)
}
else
{
-
- static IMG_UINT16 ui16NameIndex = 0;
+
+ static IMG_UINT16 ui16NameIndex = 0;
#if defined (SUPPORT_SID_INTERFACE)
snprintf(psEventObject->szName, EVENTOBJNAME_MAXLENGTH, "PVRSRV_EVENTOBJECT_KM_%d", ui16NameIndex++);
#else
snprintf(psEventObject->szName, EVENTOBJNAME_MAXLENGTH, "PVRSRV_EVENTOBJECT_%d", ui16NameIndex++);
#endif
}
-
+
if(LinuxEventObjectListCreate(&psEventObject->hOSEventKM) != PVRSRV_OK)
{
- eError = PVRSRV_ERROR_OUT_OF_MEMORY;
+ eError = PVRSRV_ERROR_OUT_OF_MEMORY;
}
}
else
{
PVR_DPF((PVR_DBG_ERROR, "OSEventObjectCreateKM: psEventObject is not a valid pointer"));
- eError = PVRSRV_ERROR_UNABLE_TO_CREATE_EVENT;
+ eError = PVRSRV_ERROR_UNABLE_TO_CREATE_EVENT;
}
-
+
return eError;
}
PVR_DPF((PVR_DBG_ERROR, "OSEventObjectDestroyKM: psEventObject is not a valid pointer"));
eError = PVRSRV_ERROR_INVALID_PARAMS;
}
-
+
return eError;
}
PVRSRV_ERROR OSEventObjectWaitKM(IMG_HANDLE hOSEventKM)
{
PVRSRV_ERROR eError;
-
+
if(hOSEventKM)
{
eError = LinuxEventObjectWait(hOSEventKM, EVENT_OBJECT_TIMEOUT_MS);
PVR_DPF((PVR_DBG_ERROR, "OSEventObjectWaitKM: hOSEventKM is not a valid handle"));
eError = PVRSRV_ERROR_INVALID_PARAMS;
}
-
+
return eError;
}
IMG_HANDLE *phOSEvent)
{
PVRSRV_ERROR eError = PVRSRV_OK;
-
+
if(psEventObject)
{
if(LinuxEventObjectAdd(psEventObject->hOSEventKM, phOSEvent) != PVRSRV_OK)
PVR_DPF((PVR_DBG_ERROR, "OSEventObjectCreateKM: psEventObject is not a valid pointer"));
eError = PVRSRV_ERROR_INVALID_PARAMS;
}
-
+
return eError;
}
PVR_DPF((PVR_DBG_ERROR, "OSEventObjectDestroyKM: psEventObject is not a valid pointer"));
eError = PVRSRV_ERROR_INVALID_PARAMS;
}
-
+
return eError;
-
+
}
PVRSRV_ERROR OSEventObjectSignalKM(IMG_HANDLE hOSEventKM)
{
PVRSRV_ERROR eError;
-
+
if(hOSEventKM)
{
eError = LinuxEventObjectSignal(hOSEventKM);
PVR_DPF((PVR_DBG_ERROR, "OSEventObjectSignalKM: hOSEventKM is not a valid handle"));
eError = PVRSRV_ERROR_INVALID_PARAMS;
}
-
+
return eError;
}
return (capable(CAP_SYS_MODULE) != 0) ? IMG_TRUE : IMG_FALSE;
}
-PVRSRV_ERROR OSCopyToUser(IMG_PVOID pvProcess,
- IMG_VOID *pvDest,
- IMG_VOID *pvSrc,
+PVRSRV_ERROR OSCopyToUser(IMG_PVOID pvProcess,
+ IMG_VOID *pvDest,
+ IMG_VOID *pvSrc,
IMG_UINT32 ui32Bytes)
{
PVR_UNREFERENCED_PARAMETER(pvProcess);
return PVRSRV_ERROR_FAILED_TO_COPY_VIRT_MEMORY;
}
-PVRSRV_ERROR OSCopyFromUser( IMG_PVOID pvProcess,
- IMG_VOID *pvDest,
- IMG_VOID *pvSrc,
+PVRSRV_ERROR OSCopyFromUser( IMG_PVOID pvProcess,
+ IMG_VOID *pvDest,
+ IMG_VOID *pvSrc,
IMG_UINT32 ui32Bytes)
{
PVR_UNREFERENCED_PARAMETER(pvProcess);
PVR_ASSERT(psPage != NULL);
-
+
if (psInfo->iNumPagesMapped == psInfo->iNumPages)
{
if (!PageReserved(psPage))
#endif
-PVRSRV_ERROR OSAcquirePhysPageAddr(IMG_VOID *pvCPUVAddr,
- IMG_UINT32 ui32Bytes,
+PVRSRV_ERROR OSAcquirePhysPageAddr(IMG_VOID *pvCPUVAddr,
+ IMG_UINT32 ui32Bytes,
IMG_SYS_PHYADDR *psSysPAddr,
IMG_HANDLE *phOSWrapMem)
{
IMG_BOOL bMMapSemHeld = IMG_FALSE;
PVRSRV_ERROR eError = PVRSRV_ERROR_OUT_OF_MEMORY;
-
+
ulStartAddr = ulStartAddrOrig & PAGE_MASK;
ulBeyondEndAddr = PAGE_ALIGN(ulBeyondEndAddrOrig);
ulAddrRange = ulBeyondEndAddr - ulStartAddr;
-
+
if (ulBeyondEndAddr <= ulStartAddr)
{
PVR_DPF((PVR_DBG_ERROR,
goto error;
}
-
+
psInfo = kmalloc(sizeof(*psInfo), GFP_KERNEL);
if (psInfo == NULL)
{
psInfo->iNumPages = (IMG_INT)(ulAddrRange >> PAGE_SHIFT);
psInfo->iPageOffset = (IMG_INT)(ulStartAddrOrig & ~PAGE_MASK);
-
+
psInfo->psPhysAddr = kmalloc((size_t)psInfo->iNumPages * sizeof(*psInfo->psPhysAddr), GFP_KERNEL);
if (psInfo->psPhysAddr == NULL)
{
PVR_DPF((PVR_DBG_ERROR,
- "OSAcquirePhysPageAddr: Couldn't allocate page array"));
+ "OSAcquirePhysPageAddr: Couldn't allocate page array"));
goto error;
}
memset(psInfo->psPhysAddr, 0, (size_t)psInfo->iNumPages * sizeof(*psInfo->psPhysAddr));
-
+
psInfo->ppsPages = kmalloc((size_t)psInfo->iNumPages * sizeof(*psInfo->ppsPages), GFP_KERNEL);
if (psInfo->ppsPages == NULL)
{
PVR_DPF((PVR_DBG_ERROR,
- "OSAcquirePhysPageAddr: Couldn't allocate page array"));
+ "OSAcquirePhysPageAddr: Couldn't allocate page array"));
goto error;
}
memset(psInfo->ppsPages, 0, (size_t)psInfo->iNumPages * sizeof(*psInfo->ppsPages));
-
+
eError = PVRSRV_ERROR_BAD_MAPPING;
-
+
psInfo->eType = WRAP_TYPE_GET_USER_PAGES;
-
+
down_read(¤t->mm->mmap_sem);
bMMapSemHeld = IMG_TRUE;
-
+
psInfo->iNumPagesMapped = get_user_pages(current, current->mm, ulStartAddr, psInfo->iNumPages, 1, 0, psInfo->ppsPages, NULL);
if (psInfo->iNumPagesMapped >= 0)
{
-
+
if (psInfo->iNumPagesMapped != psInfo->iNumPages)
{
PVR_TRACE(("OSAcquirePhysPageAddr: Couldn't map all the pages needed (wanted: %d, got %d)", psInfo->iNumPages, psInfo->iNumPagesMapped));
goto error;
}
-
+
for (i = 0; i < psInfo->iNumPages; i++)
{
IMG_CPU_PHYADDR CPUPhysAddr;
}
psInfo->psPhysAddr[i] = SysCpuPAddrToSysPAddr(CPUPhysAddr);
psSysPAddr[i] = psInfo->psPhysAddr[i];
-
+
}
goto exit;
}
PVR_DPF((PVR_DBG_MESSAGE, "OSAcquirePhysPageAddr: get_user_pages failed (%d), using CPU page table", psInfo->iNumPagesMapped));
-
-
+
+
psInfo->eType = WRAP_TYPE_NULL;
psInfo->iNumPagesMapped = 0;
memset(psInfo->ppsPages, 0, (size_t)psInfo->iNumPages * sizeof(*psInfo->ppsPages));
-
-
+
+
psInfo->eType = WRAP_TYPE_FIND_VMA;
psVMArea = find_vma(current->mm, ulStartAddrOrig);
{
PVR_DPF((PVR_DBG_ERROR,
"OSAcquirePhysPageAddr: Couldn't find memory region containing start address %x", ulStartAddrOrig));
-
+
goto error;
}
#if defined(DEBUG)
psInfo->psVMArea = psVMArea;
#endif
-
+
if (ulStartAddrOrig < psVMArea->vm_start)
{
PVR_DPF((PVR_DBG_ERROR,
goto error;
}
-
+
if (ulBeyondEndAddrOrig > psVMArea->vm_end)
{
PVR_DPF((PVR_DBG_ERROR,
goto error;
}
-
+
if ((psVMArea->vm_flags & (VM_IO | VM_RESERVED)) != (VM_IO | VM_RESERVED))
{
PVR_DPF((PVR_DBG_ERROR,
goto error;
}
-
+
if ((psVMArea->vm_flags & (VM_READ | VM_WRITE)) != (VM_READ | VM_WRITE))
{
PVR_DPF((PVR_DBG_ERROR,
if (!bHaveNoPageStructs)
{
-
+
goto exit;
}
PVR_ASSERT(bMMapSemHeld);
up_read(¤t->mm->mmap_sem);
-
+
*phOSWrapMem = (IMG_HANDLE)psInfo;
if (bHaveNoPageStructs)
PVR_ASSERT(psInfo->eType != 0);
#if 0
-
-
+
+
OSCleanCPUCacheRangeKM(pvCPUVAddr, (IMG_VOID *)((IMG_CHAR *)pvCPUVAddr + ui32Bytes));
#endif
return CpuPAddr.uiAddr;
}
-#endif
+#endif
static
IMG_VOID *FindMMapBaseVAddr(struct list_head *psMMapOffsetStructList,
PKV_OFFSET_STRUCT psOffsetStruct;
IMG_VOID *pvMinVAddr;
-
+
list_for_each_entry(psOffsetStruct, psMMapOffsetStructList, sAreaItem)
{
if(OSGetCurrentProcessIDKM() != psOffsetStruct->ui32PID)
pvMinVAddr = (IMG_VOID *)psOffsetStruct->ui32UserVAddr;
-
+
if(pvRangeAddrStart >= pvMinVAddr &&
ui32Length <= psOffsetStruct->ui32RealByteSize)
return pvMinVAddr;
psLinuxMemArea = psLinuxMemArea->uData.sSubAlloc.psParentLinuxMemArea;
}
-
+
PVR_ASSERT(psLinuxMemArea->eAreaType != LINUX_MEM_AREA_SUB_ALLOC);
switch(psLinuxMemArea->eAreaType)
{
pvMinVAddr = psLinuxMemArea->uData.sVmalloc.pvVmallocAddress + ui32AreaOffset;
-
+
if(pvRangeAddrStart < pvMinVAddr)
goto err_blocked;
}
else
{
-
+
pvMinVAddr = FindMMapBaseVAddr(psMMapOffsetStructList,
pvRangeAddrStart, ui32Length);
if(!pvMinVAddr)
pfnInnerCacheOp(pvRangeAddrStart, pvRangeAddrStart + ui32Length);
#if defined(CONFIG_OUTER_CACHE)
-
+
pvRangeAddrStart = psLinuxMemArea->uData.sVmalloc.pvVmallocAddress +
(ui32AreaOffset & PAGE_MASK) + (pvRangeAddrStart - pvMinVAddr);
}
pfnMemAreaToPhys = VMallocAreaToPhys;
-#else
+#else
}
-#endif
+#endif
break;
}
case LINUX_MEM_AREA_EXTERNAL_KV:
{
-
+
if (psLinuxMemArea->uData.sExternalKV.bPhysContig == IMG_TRUE)
{
PVR_DPF((PVR_DBG_WARNING, "%s: Attempt to flush contiguous external memory", __func__));
goto err_blocked;
}
-
+
if (psLinuxMemArea->uData.sExternalKV.pvExternalKV != IMG_NULL)
{
PVR_DPF((PVR_DBG_WARNING, "%s: Attempt to flush external memory with a kernel virtual address", __func__));
#if defined(CONFIG_OUTER_CACHE)
PVR_ASSERT(pfnMemAreaToPhys != IMG_NULL);
-
+
{
unsigned long ulStart, ulEnd, ulLength, ulStartOffset, ulEndOffset;
IMG_UINT32 i, ui32NumPages;
-
+
ulLength = (unsigned long)ui32Length;
ulStartOffset = ((unsigned long)pvRangeAddrStart) & (PAGE_SIZE - 1);
ulEndOffset = ((unsigned long)pvRangeAddrStart + ulLength) & (PAGE_SIZE - 1);
-
+
ui32NumPages = (ulStartOffset + ulLength + PAGE_SIZE - 1) >> PAGE_SHIFT;
for(i = 0; i < ui32NumPages; i++)
IMG_VOID OSCleanCPUCacheKM(IMG_VOID)
{
-
+
ON_EACH_CPU(per_cpu_cache_flush, NULL, 1);
}
IMG_VOID *pvRangeAddrStart,
IMG_UINT32 ui32Length)
{
-
+
return CheckExecuteCacheOp(hOSMemHandle, pvRangeAddrStart, ui32Length,
x86_flush_cache_range, IMG_NULL);
}
IMG_VOID *pvRangeAddrStart,
IMG_UINT32 ui32Length)
{
-
+
return CheckExecuteCacheOp(hOSMemHandle, pvRangeAddrStart, ui32Length,
x86_flush_cache_range, IMG_NULL);
}
IMG_VOID *pvRangeAddrStart,
IMG_UINT32 ui32Length)
{
-
+
return CheckExecuteCacheOp(hOSMemHandle, pvRangeAddrStart, ui32Length,
x86_flush_cache_range, IMG_NULL);
}
-#else
+#else
#if defined(__arm__)
IMG_VOID OSCleanCPUCacheKM(IMG_VOID)
{
-
+
ON_EACH_CPU(per_cpu_cache_flush, NULL, 1);
#if defined(CONFIG_OUTER_CACHE) && !defined(PVR_NO_FULL_CACHE_OPS)
outer_clean_range(0, ULONG_MAX);
pvr_dmac_inv_range, outer_inv_range);
}
-#else
+#else
#if defined(__mips__)
IMG_VOID OSCleanCPUCacheKM(IMG_VOID)
{
-
+
dma_cache_wback(0, 0x100000);
}
IMG_VOID OSFlushCPUCacheKM(IMG_VOID)
{
-
+
dma_cache_wback_inv(0, 0x100000);
}
IMG_UINT32 ui32Length)
{
if (ui32Length)
- dma_cache_wback_inv((IMG_UINTPTR_T)pvRangeAddrStart, ui32Length);
+ dma_cache_wback_inv((IMG_UINTPTR_T)pvRangeAddrStart, ui32Length);
return IMG_TRUE;
}
return IMG_TRUE;
}
-#else
+#else
#error "Implement CPU cache flush/clean/invalidate primitives for this CPU!"
-#endif
+#endif
-#endif
+#endif
-#endif
+#endif
PVRSRV_ERROR PVROSFuncInit(IMG_VOID)
{
psTimerWorkQueue = create_workqueue("pvr_timer");
if (psTimerWorkQueue == NULL)
{
- PVR_DPF((PVR_DBG_ERROR, "%s: couldn't create timer workqueue", __FUNCTION__));
+ PVR_DPF((PVR_DBG_ERROR, "%s: couldn't create timer workqueue", __FUNCTION__));
return PVRSRV_ERROR_UNABLE_TO_CREATE_THREAD;
}
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
psEnvPerProc->hBlockAlloc = hBlockAlloc;
-
+
LinuxMMapPerProcessConnect(psEnvPerProc);
#if defined(SUPPORT_DRI_DRM) && defined(PVR_SECURE_DRM_AUTH_EXPORT)
-
+
INIT_LIST_HEAD(&psEnvPerProc->sDRMAuthListHead);
#endif
psEnvPerProc = (PVRSRV_ENV_PER_PROCESS_DATA *)hOsPrivateData;
-
+
LinuxMMapPerProcessDisconnect(psEnvPerProc);
-
+
RemovePerProcessProcDir(psEnvPerProc);
eError = OSFreeMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
sizeof(PVRSRV_ENV_PER_PROCESS_DATA),
hOsPrivateData,
psEnvPerProc->hBlockAlloc);
-
+
if (eError != PVRSRV_OK)
{
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#include <asm/atomic.h>
#include <stdarg.h>
#if defined (SUPPORT_SGX)
-#include "sgxdefs.h"
+#include "sgxdefs.h"
#endif
#include "services_headers.h"
#include "pdump_km.h"
#include "pdump_int.h"
-#include <linux/kernel.h>
-#include <linux/string.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
static IMG_BOOL PDumpWriteString2 (IMG_CHAR * pszString, IMG_UINT32 ui32Flags);
static IMG_BOOL PDumpWriteILock (PDBG_STREAM psStream, IMG_UINT8 *pui8Data, IMG_UINT32 ui32Count, IMG_UINT32 ui32Flags);
va_end(vaArgs);
- if (n>=(IMG_INT32)ui32ScriptSizeMax || n==-1)
+ if (n>=(IMG_INT32)ui32ScriptSizeMax || n==-1)
{
PVR_DPF((PVR_DBG_ERROR, "Buffer overflow detected, pdump output may be incomplete."));
n = vsnprintf(pszComment, ui32ScriptSizeMax, pszFormat, vaArgs);
- if (n>=(IMG_INT32)ui32ScriptSizeMax || n==-1)
+ if (n>=(IMG_INT32)ui32ScriptSizeMax || n==-1)
{
PVR_DPF((PVR_DBG_ERROR, "Buffer overflow detected, pdump output may be incomplete."));
{
PVR_UNREFERENCED_PARAMETER(pszFormat);
-
+
}
PVRSRV_ERROR PDumpOSSprintf(IMG_CHAR *pszComment, IMG_UINT32 ui32ScriptSizeMax, IMG_CHAR *pszFormat, ...)
va_end(vaArgs);
- if (n>=(IMG_INT32)ui32ScriptSizeMax || n==-1)
+ if (n>=(IMG_INT32)ui32ScriptSizeMax || n==-1)
{
PVR_DPF((PVR_DBG_ERROR, "Buffer overflow detected, pdump output may be incomplete."));
IMG_UINT32 ui32Count;
IMG_CHAR* pszBuf = hBuffer;
-
+
ui32Count = PDumpOSBuflen(hBuffer, ui32BufferSizeMax);
-
+
if ((ui32Count >= 1) && (pszBuf[ui32Count-1] != '\n') && (ui32Count<ui32BufferSizeMax))
{
pszBuf[ui32Count] = '\n';
IMG_VOID PDumpOSCheckForSplitting(IMG_HANDLE hStream, IMG_UINT32 ui32Size, IMG_UINT32 ui32Flags)
{
-
+
PVR_UNREFERENCED_PARAMETER(hStream);
PVR_UNREFERENCED_PARAMETER(ui32Size);
PVR_UNREFERENCED_PARAMETER(ui32Flags);
IMG_CPU_PHYADDR sCpuPAddr;
PVR_UNREFERENCED_PARAMETER(pui8LinAddr);
- PVR_UNREFERENCED_PARAMETER(ui32PageSize);
-
-
+ PVR_UNREFERENCED_PARAMETER(ui32PageSize);
+
+
PVR_ASSERT (hOSMemHandle != IMG_NULL);
-
+
sCpuPAddr = OSMemHandleToCpuPAddr(hOSMemHandle, ui32Offset);
PVR_ASSERT((sCpuPAddr.uiAddr & (ui32PageSize - 1)) == 0);
-
+
*psDevPAddr = SysCpuPAddrToDevPAddr(eDeviceType, sCpuPAddr);
}
{
if(hOSMemHandle)
{
-
+
IMG_CPU_PHYADDR sCpuPAddr;
PVR_UNREFERENCED_PARAMETER(pui8LinAddr);
IMG_UINT32 i;
DBGKM_CONNECT_NOTIFIER sConnectNotifier;
-
+
if (!gpfnDbgDrv)
{
DBGDrvGetServiceTable((IMG_VOID **)&gpfnDbgDrv);
-
+
if (gpfnDbgDrv == IMG_NULL)
{
return;
}
-
-
+
+
sConnectNotifier.pfnConnectNotifier = &PDumpConnectionNotify;
gpfnDbgDrv->pfnSetConnectNotifier(sConnectNotifier);
gsDBGPdumpState.pszMsg = IMG_NULL;
}
-
+
sConnectNotifier.pfnConnectNotifier = 0;
gpfnDbgDrv->pfnSetConnectNotifier(sConnectNotifier);
gsDBGPdumpState.pszMsg = IMG_NULL;
}
-
+
sConnectNotifier.pfnConnectNotifier = 0;
gpfnDbgDrv->pfnSetConnectNotifier(sConnectNotifier);
}
-
+
if (psStream == gsDBGPdumpState.psStream[PDUMP_STREAM_PARAM2])
{
atomic_dec(&gsPDumpSuspended);
}
-#endif
-#endif
+#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
typedef struct
{
-
+
IMG_UINT32 ui32OpenPID;
-
+
#if defined (SUPPORT_SID_INTERFACE)
IMG_SID hKernelMemInfo;
#else
#endif
#if defined(SUPPORT_DRI_DRM) && defined(PVR_SECURE_DRM_AUTH_EXPORT)
-
+
struct list_head sDRMAuthListItem;
struct drm_file *psDRMFile;
#endif
#if defined(SUPPORT_MEMINFO_IDS)
-
+
IMG_UINT64 ui64Stamp;
-#endif
-
+#endif
+
IMG_HANDLE hBlockAlloc;
#if defined(SUPPORT_DRI_DRM_EXT)
- IMG_PVOID pPriv;
+ IMG_PVOID pPriv;
#endif
}
PVRSRV_FILE_PRIVATE_DATA;
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
n = vsnprintf (buffer+off, space, format, ap);
va_end (ap);
-
+
if (n >= (IMG_INT)space || n < 0)
{
-
+
buffer[size - 1] = 0;
return (off_t)(size - 1);
}
void* ProcSeq1ElementOff2Element(struct seq_file *sfile, loff_t off)
{
PVR_UNREFERENCED_PARAMETER(sfile);
-
+
if(!off)
return (void*)2;
return NULL;
return PVR_PROC_SEQ_START_TOKEN;
}
-
+
if(off == 1)
return (void*)2;
struct seq_file *seq = (struct seq_file*)file->private_data;
struct proc_dir_entry* pvr_proc_entry = PDE(inode);
-
+
seq->private = pvr_proc_entry->data;
return ret;
}
file->proc_fops = &pvr_proc_operations;
file->write_proc = whandler;
-
+
file->data = kmalloc(sizeof(PVR_PROC_SEQ_HANDLERS), GFP_KERNEL);
if(file->data)
{
static IMG_INT pvr_read_proc(IMG_CHAR *page, IMG_CHAR **start, off_t off,
IMG_INT count, IMG_INT *eof, IMG_VOID *data)
{
-
+
pvr_read_proc_t *pprn = (pvr_read_proc_t *)data;
off_t len = pprn (page, (size_t)count, off);
len = 0;
*eof = 1;
}
- else if (!len)
+ else if (!len)
{
- *start = (IMG_CHAR *) 0;
+ *start = (IMG_CHAR *) 0;
}
else
{
return -ENOMEM;
}
-
+
file = create_proc_read_entry (name, S_IFREG | S_IRUGO, dir, pvr_read_proc, (IMG_VOID *)handler);
if (file)
RemoveProcEntrySeq( g_pProcDebugLevel );
#ifdef PVR_MANUAL_POWER_CONTROL
RemoveProcEntrySeq( g_pProcPowerLevel );
-#endif
+#endif
#endif
RemoveProcEntrySeq(g_pProcQueue);
{
SYS_DATA *psSysData;
PVRSRV_DEVICE_NODE*psDevNode = IMG_NULL;
-
+
PVR_UNREFERENCED_PARAMETER(sfile);
-
+
if(!off)
{
return PVR_PROC_SEQ_START_TOKEN;
psSysData = SysAcquireDataNoCheck();
if (psSysData != IMG_NULL)
{
-
+
psDevNode = (PVRSRV_DEVICE_NODE*)
List_PVRSRV_DEVICE_NODE_Any_va(psSysData->psDeviceNodeList,
DecOffPsDev_AnyVaCb,
&off);
}
-
+
return (void*)psDevNode;
}
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#ifndef __SERVICES_PROC_H__
#define __SERVICES_PROC_H__
-#include <asm/system.h>
-#include <linux/proc_fs.h>
-#include <linux/seq_file.h>
+#include <asm/system.h>
+#include <linux/proc_fs.h>
+#include <linux/seq_file.h>
#define END_OF_FILE (off_t) -1
typedef void (pvr_startstop_proc_seq_t)(struct seq_file *, IMG_BOOL start);
typedef struct _PVR_PROC_SEQ_HANDLERS_ {
- pvr_next_proc_seq_t *next;
- pvr_show_proc_seq_t *show;
+ pvr_next_proc_seq_t *next;
+ pvr_show_proc_seq_t *show;
pvr_off2element_proc_seq_t *off2element;
pvr_startstop_proc_seq_t *startstop;
IMG_VOID *data;
IMG_VOID RemoveProcEntries(IMG_VOID);
struct proc_dir_entry* CreateProcReadEntrySeq (
- const IMG_CHAR* name,
+ const IMG_CHAR* name,
IMG_VOID* data,
- pvr_next_proc_seq_t next_handler,
+ pvr_next_proc_seq_t next_handler,
pvr_show_proc_seq_t show_handler,
pvr_off2element_proc_seq_t off2element_handler,
pvr_startstop_proc_seq_t startstop_handler
);
struct proc_dir_entry* CreateProcEntrySeq (
- const IMG_CHAR* name,
+ const IMG_CHAR* name,
IMG_VOID* data,
- pvr_next_proc_seq_t next_handler,
+ pvr_next_proc_seq_t next_handler,
pvr_show_proc_seq_t show_handler,
pvr_off2element_proc_seq_t off2element_handler,
pvr_startstop_proc_seq_t startstop_handler,
);
struct proc_dir_entry* CreatePerProcessProcEntrySeq (
- const IMG_CHAR* name,
+ const IMG_CHAR* name,
IMG_VOID* data,
- pvr_next_proc_seq_t next_handler,
+ pvr_next_proc_seq_t next_handler,
pvr_show_proc_seq_t show_handler,
pvr_off2element_proc_seq_t off2element_handler,
pvr_startstop_proc_seq_t startstop_handler,
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#if defined(SUPPORT_MEMINFO_IDS)
static IMG_UINT64 ui64Stamp;
-#endif
+#endif
PVRSRV_ERROR
LinuxBridgeInit(IMG_VOID)
#if defined(DEBUG_BRIDGE_KM)
{
g_ProcBridgeStats = CreateProcReadEntrySeq(
- "bridge_stats",
+ "bridge_stats",
NULL,
ProcSeqNextBridgeStats,
ProcSeqShowBridgeStats,
#if defined(DEBUG_BRIDGE_KM)
-static void ProcSeqStartstopBridgeStats(struct seq_file *sfile,IMG_BOOL start)
+static void ProcSeqStartstopBridgeStats(struct seq_file *sfile,IMG_BOOL start)
{
- if(start)
+ if(start)
{
LinuxLockMutex(&gPVRSRVLock);
}
static void* ProcSeqOff2ElementBridgeStats(struct seq_file *sfile, loff_t off)
{
- if(!off)
+ if(!off)
{
return PVR_PROC_SEQ_START_TOKEN;
}
{
PVRSRV_BRIDGE_DISPATCH_TABLE_ENTRY *psEntry = ( PVRSRV_BRIDGE_DISPATCH_TABLE_ENTRY*)el;
- if(el == PVR_PROC_SEQ_START_TOKEN)
+ if(el == PVR_PROC_SEQ_START_TOKEN)
{
seq_printf(sfile,
"Total ioctl call count = %u\n"
psEntry->ui32CopyToUserTotalBytes);
}
-#endif
+#endif
#if defined(SUPPORT_DRI_DRM)
goto unlock_and_return;
}
-
-
+
+
if(OSCopyFromUser(IMG_NULL,
psBridgePackageKM,
psBridgePackageUM,
#endif
cmd = psBridgePackageKM->ui32BridgeID;
-
+
if(cmd != PVRSRV_BRIDGE_CONNECT_SERVICES)
{
PVRSRV_ERROR eError;
}
else
{
-
+
psPerProc = PVRSRVPerProcessData(ui32PID);
if(psPerProc == IMG_NULL)
{
break;
}
-
+
psEnvPerProc = (PVRSRV_ENV_PER_PROCESS_DATA *)PVRSRVProcessPrivateData(psPerProc);
if (psEnvPerProc == IMG_NULL)
{
default:
break;
}
-#endif
+#endif
err = BridgedDispatchKM(psPerProc, psBridgePackageKM);
if(err != PVRSRV_OK)
PVRSRV_BRIDGE_OUT_EXPORTDEVICEMEM *psExportDeviceMemOUT =
(PVRSRV_BRIDGE_OUT_EXPORTDEVICEMEM *)psBridgePackageKM->pvParamOut;
PVRSRV_FILE_PRIVATE_DATA *psPrivateData = PRIVATE_DATA(pFile);
- IMG_HANDLE hMemInfo;
PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo;
- if (get_user(hMemInfo, &psExportDeviceMemOUT->hMemInfo) != 0)
- {
- err = -EFAULT;
- goto unlock_and_return;
- }
-
if(PVRSRVLookupHandle(KERNEL_HANDLE_BASE,
(IMG_PVOID *)&psKernelMemInfo,
- hMemInfo,
+ psExportDeviceMemOUT->hMemInfo,
PVRSRV_HANDLE_TYPE_MEM_INFO) != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR, "%s: Failed to look up export handle", __FUNCTION__));
PVRSRVKernelMemInfoIncRef(psKernelMemInfo);
- psPrivateData->hKernelMemInfo = hMemInfo;
+ psPrivateData->hKernelMemInfo = psExportDeviceMemOUT->hMemInfo;
#if defined(SUPPORT_MEMINFO_IDS)
psPrivateData->ui64Stamp = ++ui64Stamp;
}
break;
}
-#endif
+#endif
default:
break;
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#include <linux/hardirq.h>
#include <linux/module.h>
#include <linux/spinlock.h>
-#include <linux/string.h>
+#include <linux/string.h>
#include <stdarg.h>
#include "img_types.h"
#include "servicesext.h"
IMG_UINT32 gPVRDebugLevel =
(DBGPRIV_FATAL | DBGPRIV_ERROR | DBGPRIV_WARNING);
-#endif
+#endif
#define PVR_MAX_MSG_LEN PVR_MAX_DEBUG_MESSAGE_LEN
#endif
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39))
-
+
static spinlock_t gsDebugLockIRQ = __SPIN_LOCK_UNLOCKED();
#else
static DEFINE_SPINLOCK(gsDebugLockIRQ);
#endif
#if !defined(PVR_DEBUG_ALWAYS_USE_SPINLOCK)
-#if !defined (USE_SPIN_LOCK)
+#if !defined (USE_SPIN_LOCK)
#define USE_SPIN_LOCK (in_interrupt() || !preemptible())
#endif
#endif
i32Len = vsnprintf(&pszBuf[ui32Used], ui32Space, pszFormat, VArgs);
pszBuf[ui32BufSiz - 1] = 0;
-
+
return (i32Len < 0 || i32Len >= (IMG_INT32)ui32Space) ? IMG_TRUE : IMG_FALSE;
}
BUG();
}
-#endif
+#endif
#if defined(PVRSRV_NEED_PVR_TRACE)
va_end(VArgs);
}
-#endif
+#endif
#if defined(PVRSRV_NEED_PVR_DPF)
GetBufferLock(&ulLockFlags);
-
+
if (bTrace == IMG_FALSE)
{
switch(ui32DebugLevel)
}
else
{
-
+
if (bTrace == IMG_FALSE)
{
#ifdef DEBUG_LOG_PATH_TRUNCATE
-
+
static IMG_CHAR szFileNameRewrite[PVR_MAX_FILEPATH_LEN];
IMG_CHAR* pszTruncIter;
IMG_CHAR* pszTruncBackInter;
-
+
if (strlen(pszFullFileName) > strlen(DEBUG_LOG_PATH_TRUNCATE)+1)
pszFileName = pszFullFileName + strlen(DEBUG_LOG_PATH_TRUNCATE)+1;
-
+
strncpy(szFileNameRewrite, pszFileName,PVR_MAX_FILEPATH_LEN);
if(strlen(szFileNameRewrite) == PVR_MAX_FILEPATH_LEN-1) {
while(*pszTruncIter++ != 0)
{
IMG_CHAR* pszNextStartPoint;
-
+
if(
!( ( *pszTruncIter == '/' && (pszTruncIter-4 >= szFileNameRewrite) ) &&
( *(pszTruncIter-1) == '.') &&
( *(pszTruncIter-3) == '/') )
) continue;
-
+
pszTruncBackInter = pszTruncIter - 3;
while(*(--pszTruncBackInter) != '/')
{
}
pszNextStartPoint = pszTruncBackInter;
-
+
while(*pszTruncIter != 0)
{
*pszTruncBackInter++ = *pszTruncIter++;
}
*pszTruncBackInter = 0;
-
+
pszTruncIter = pszNextStartPoint;
}
pszFileName = szFileNameRewrite;
-
+
if(*pszFileName == '/') pszFileName++;
#endif
{
pszFileName = pszLeafName;
}
-#endif
+#endif
if (BAppend(pszBuf, ui32BufSiz, " [%u, %s]", ui32Line, pszFileName))
{
}
}
-#endif
+#endif
#if defined(DEBUG)
seq_printf(sfile, "%u\n", gPVRDebugLevel);
}
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
{}
};
#endif
-#else
+#else
static struct pci_device_id asPciIdList[] = {
#if defined(PVR_DRI_DRM_NOT_PCI)
{1, 1, 1, 1, 0, 0, 0},
-#else
+#else
{SYS_SGX_DEV_VENDOR_ID, SYS_SGX_DEV_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
#if defined(SYS_SGX_DEV1_DEVICE_ID)
{SYS_SGX_DEV_VENDOR_ID, SYS_SGX_DEV1_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
-#endif
-#endif
+#endif
+#endif
{0}
};
-#endif
-#endif
+#endif
+#endif
DRI_DRM_STATIC int
PVRSRVDrmLoad(struct drm_device *dev, unsigned long flags)
goto exit;
}
#endif
-
+
iRes = PVRCore_Init();
if (iRes != 0)
{
if (ret != 0)
{
-
+
PVR_DPF((PVR_DBG_ERROR, "%s : drm_release failed: %d",
__FUNCTION__, ret));
}
#if defined(PVR_DRI_DRM_PLATFORM_DEV) && !defined(SUPPORT_DRI_DRM_EXT)
static int PVRSRVDrmProbe(struct platform_device *pDevice);
static int PVRSRVDrmRemove(struct platform_device *pDevice);
-#endif
+#endif
-static struct drm_driver sPVRDrmDriver =
+static struct drm_driver sPVRDrmDriver =
{
#if defined(PVR_DRI_DRM_PLATFORM_DEV)
.driver_features = DRIVER_USE_PLATFORM_DEVICE,
.get_reg_ofs = drm_core_get_reg_ofs,
#endif
.ioctls = sPVRDrmIoctls,
- .fops =
+ .fops =
{
.owner = THIS_MODULE,
.open = drm_open,
.shutdown = PVRSRVDriverShutdown,
},
#else
- .pci_driver =
+ .pci_driver =
{
.name = PVR_DRM_NAME,
.id_table = asPciIdList,
return 0;
}
-#endif
+#endif
static int __init PVRSRVDrmInit(void)
{
int iRes;
sPVRDrmDriver.num_ioctls = pvr_max_ioctl;
-
+
PVRDPFInit();
#if defined(PVR_DRI_DRM_NOT_PCI)
#endif
return iRes;
}
-
+
static void __exit PVRSRVDrmExit(void)
{
drm_exit(&sPVRDrmDriver);
module_init(PVRSRVDrmInit);
module_exit(PVRSRVDrmExit);
-#endif
-#endif
+#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
int PVRDRM_Dummy_ioctl(struct drm_device *dev, IMG_VOID *arg, struct drm_file *pFile);
#else
#define DRI_DRM_STATIC static
-#endif
+#endif
#if defined(DISPLAY_CONTROLLER)
extern int PVR_DRM_MAKENAME(DISPLAY_CONTROLLER, _Init)(struct drm_device *);
#define DRM_IOCTL_PVR_UNPRIV _IO(0, DRM_PVR_UNPRIV)
#define DRM_IOCTL_PVR_DBGDRV _IO(0, DRM_PVR_DBGDRV)
#define DRM_IOCTL_PVR_DISP _IO(0, DRM_PVR_DISP)
-#endif
+#endif
-#endif
+#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#define EUR_CR_OCP_DEBUG_STATUS_CMD_DEBUG_STATE_SIGNED 0
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#define EUR_CR_MNE_CR_EVENT_CLEAR_INVAL_SHIFT 0
#define EUR_CR_MNE_CR_CTRL_INVAL 0x0D20
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#define EUR_CR_USE_CODE_BASE_SIZE_UINT32 16
#define EUR_CR_USE_CODE_BASE_NUM_ENTRIES 16
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#define EUR_CR_USE_CODE_BASE_SIZE_UINT32 16
#define EUR_CR_USE_CODE_BASE_NUM_ENTRIES 16
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#define EUR_CR_USE_CODE_BASE_SIZE_UINT32 16
#define EUR_CR_USE_CODE_BASE_NUM_ENTRIES 16
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#define EUR_CR_USE_CODE_BASE_SIZE_UINT32 16
#define EUR_CR_USE_CODE_BASE_NUM_ENTRIES 16
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#include "sgxmpplusdefs.h"
#else
#include "sgxmpdefs.h"
-#endif
-#else
+#endif
+#else
#if defined(SGX_FEATURE_SYSTEM_CACHE)
#include "mnemedefs.h"
#endif
-#endif
+#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#define _SGXERRATA_KM_H_
#if defined(SGX520) && !defined(SGX_CORE_DEFINED)
-
+
#define SGX_CORE_REV_HEAD 0
#if defined(USE_SGX_CORE_REV_HEAD)
-
+
#define SGX_CORE_REV SGX_CORE_REV_HEAD
#endif
#define FIX_HW_BRN_28889
#else
#if SGX_CORE_REV == SGX_CORE_REV_HEAD
-
+
#else
#error "sgxerrata.h: SGX520 Core Revision unspecified"
#endif
#endif
#endif
-
+
#define SGX_CORE_DEFINED
#endif
#if defined(SGX530) && !defined(SGX_CORE_DEFINED)
-
+
#define SGX_CORE_REV_HEAD 0
#if defined(USE_SGX_CORE_REV_HEAD)
-
+
#define SGX_CORE_REV SGX_CORE_REV_HEAD
#endif
#define FIX_HW_BRN_28889
#else
#if SGX_CORE_REV == 111
- #define FIX_HW_BRN_22934
+ #define FIX_HW_BRN_22934
#define FIX_HW_BRN_28889
#else
#if SGX_CORE_REV == 1111
- #define FIX_HW_BRN_22934
+ #define FIX_HW_BRN_22934
#define FIX_HW_BRN_28889
#else
#if SGX_CORE_REV == 120
- #define FIX_HW_BRN_22934
+ #define FIX_HW_BRN_22934
#define FIX_HW_BRN_28889
#else
#if SGX_CORE_REV == 121
- #define FIX_HW_BRN_22934
+ #define FIX_HW_BRN_22934
#define FIX_HW_BRN_28889
#else
#if SGX_CORE_REV == 125
- #define FIX_HW_BRN_22934
+ #define FIX_HW_BRN_22934
#define FIX_HW_BRN_28889
#else
#if SGX_CORE_REV == 130
- #define FIX_HW_BRN_22934
+ #define FIX_HW_BRN_22934
#define FIX_HW_BRN_28889
#else
#if SGX_CORE_REV == SGX_CORE_REV_HEAD
-
+
#else
#error "sgxerrata.h: SGX530 Core Revision unspecified"
#endif
#endif
#endif
#endif
-
+
#define SGX_CORE_DEFINED
#endif
#if defined(SGX531) && !defined(SGX_CORE_DEFINED)
-
+
#define SGX_CORE_REV_HEAD 0
#if defined(USE_SGX_CORE_REV_HEAD)
-
+
#define SGX_CORE_REV SGX_CORE_REV_HEAD
#endif
#define FIX_HW_BRN_34028
#else
#if SGX_CORE_REV == SGX_CORE_REV_HEAD
-
+
#else
#error "sgxerrata.h: SGX531 Core Revision unspecified"
#endif
#endif
#endif
-
+
#define SGX_CORE_DEFINED
#endif
#if (defined(SGX535) || defined(SGX535_V1_1)) && !defined(SGX_CORE_DEFINED)
-
+
#define SGX_CORE_REV_HEAD 0
#if defined(USE_SGX_CORE_REV_HEAD)
-
+
#define SGX_CORE_REV SGX_CORE_REV_HEAD
#endif
#define FIX_HW_BRN_23281
#define FIX_HW_BRN_23410
#define FIX_HW_BRN_22693
- #define FIX_HW_BRN_22934
+ #define FIX_HW_BRN_22934
#define FIX_HW_BRN_22997
#define FIX_HW_BRN_23030
#else
#if SGX_CORE_REV == 113
- #define FIX_HW_BRN_22934
+ #define FIX_HW_BRN_22934
#define FIX_HW_BRN_23281
#define FIX_HW_BRN_23944
#define FIX_HW_BRN_23410
#else
#if SGX_CORE_REV == 121
- #define FIX_HW_BRN_22934
+ #define FIX_HW_BRN_22934
#define FIX_HW_BRN_23944
#define FIX_HW_BRN_23410
#else
#if SGX_CORE_REV == 126
- #define FIX_HW_BRN_22934
- #else
+ #define FIX_HW_BRN_22934
+ #else
#if SGX_CORE_REV == SGX_CORE_REV_HEAD
-
+
#else
#error "sgxerrata.h: SGX535 Core Revision unspecified"
#endif
#endif
#endif
-
+
#define SGX_CORE_DEFINED
#endif
#if defined(SGX540) && !defined(SGX_CORE_DEFINED)
-
+
#define SGX_CORE_REV_HEAD 0
#if defined(USE_SGX_CORE_REV_HEAD)
-
+
#define SGX_CORE_REV SGX_CORE_REV_HEAD
#endif
#define FIX_HW_BRN_34028
#else
#if SGX_CORE_REV == SGX_CORE_REV_HEAD
-
+
#else
#error "sgxerrata.h: SGX540 Core Revision unspecified"
#endif
#endif
#endif
#endif
-
+
#define SGX_CORE_DEFINED
#endif
#if defined(SGX541) && !defined(SGX_CORE_DEFINED)
#if defined(SGX_FEATURE_MP)
-
+
#define SGX_CORE_REV_HEAD 0
#if defined(USE_SGX_CORE_REV_HEAD)
-
+
#define SGX_CORE_REV SGX_CORE_REV_HEAD
#endif
#define FIX_HW_BRN_27270
#define FIX_HW_BRN_28011
#define FIX_HW_BRN_27510
-
+
#else
#if SGX_CORE_REV == SGX_CORE_REV_HEAD
-
+
#else
#error "sgxerrata.h: SGX541 Core Revision unspecified"
#endif
#endif
-
+
#define SGX_CORE_DEFINED
- #else
+ #else
#error "sgxerrata.h: SGX541 only supports MP configs (SGX_FEATURE_MP)"
- #endif
+ #endif
#endif
#if defined(SGX543) && !defined(SGX_CORE_DEFINED)
-
+
#define SGX_CORE_REV_HEAD 0
#if defined(USE_SGX_CORE_REV_HEAD)
-
+
#define SGX_CORE_REV SGX_CORE_REV_HEAD
#endif
#define FIX_HW_BRN_31620
#define FIX_HW_BRN_31780
#define FIX_HW_BRN_31542
- #define FIX_HW_BRN_32044
+ #define FIX_HW_BRN_32044
#if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) && defined(SGX_FEATURE_MP)
#define FIX_HW_BRN_33657
#endif
#define FIX_HW_BRN_31620
#define FIX_HW_BRN_31780
#define FIX_HW_BRN_31542
- #define FIX_HW_BRN_32044
- #define FIX_HW_BRN_32085
+ #define FIX_HW_BRN_32044
+ #define FIX_HW_BRN_32085
#if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) && defined(SGX_FEATURE_MP)
#define FIX_HW_BRN_33657
#endif
#define FIX_HW_BRN_33920
-
+
#else
#if SGX_CORE_REV == 1221
#define FIX_HW_BRN_29954
#define FIX_HW_BRN_31425
#endif
#define FIX_HW_BRN_31542
- #define FIX_HW_BRN_31671
+ #define FIX_HW_BRN_31671
#define FIX_HW_BRN_31780
#define FIX_HW_BRN_32044
- #define FIX_HW_BRN_32085
+ #define FIX_HW_BRN_32085
#if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) && defined(SGX_FEATURE_MP)
#define FIX_HW_BRN_33657
#endif
#define FIX_HW_BRN_33920
-
+
#else
#if SGX_CORE_REV == 140
#define FIX_HW_BRN_29954
#define FIX_HW_BRN_31620
#define FIX_HW_BRN_31780
#define FIX_HW_BRN_31542
- #define FIX_HW_BRN_32044
- #define FIX_HW_BRN_32085
+ #define FIX_HW_BRN_32044
+ #define FIX_HW_BRN_32085
#define FIX_HW_BRN_33920
#if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) && defined(SGX_FEATURE_MP)
#define FIX_HW_BRN_33657
#endif
-
+
#else
#if SGX_CORE_REV == 1401
#define FIX_HW_BRN_29954
#define FIX_HW_BRN_31620
#define FIX_HW_BRN_31542
#define FIX_HW_BRN_31780
- #define FIX_HW_BRN_32044
- #define FIX_HW_BRN_32085
+ #define FIX_HW_BRN_32044
+ #define FIX_HW_BRN_32085
#define FIX_HW_BRN_33920
#if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) && defined(SGX_FEATURE_MP)
#define FIX_HW_BRN_33657
#endif
-
+
#else
#if SGX_CORE_REV == 141
#define FIX_HW_BRN_29954
#if defined(SGX_FEATURE_MP)
#define FIX_HW_BRN_31425
#endif
- #define FIX_HW_BRN_31671
+ #define FIX_HW_BRN_31671
#define FIX_HW_BRN_31780
#if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) && defined(SGX_FEATURE_MP)
#define FIX_HW_BRN_33657
#endif
-
+
#else
#if SGX_CORE_REV == 142
#define FIX_HW_BRN_29954
#if defined(SGX_FEATURE_MP)
#define FIX_HW_BRN_31425
#endif
- #define FIX_HW_BRN_31671
+ #define FIX_HW_BRN_31671
#define FIX_HW_BRN_31780
#if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) && defined(SGX_FEATURE_MP)
#define FIX_HW_BRN_33657
#endif
-
+
#else
#if SGX_CORE_REV == 211
#define FIX_HW_BRN_31093
#define FIX_HW_BRN_31620
#define FIX_HW_BRN_31780
#define FIX_HW_BRN_31542
- #define FIX_HW_BRN_32044
- #define FIX_HW_BRN_32085
+ #define FIX_HW_BRN_32044
+ #define FIX_HW_BRN_32085
#if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) && defined(SGX_FEATURE_MP)
#define FIX_HW_BRN_33657
#endif
#define FIX_HW_BRN_33920
-
+
#else
#if SGX_CORE_REV == 2111
- #define FIX_HW_BRN_30982
+ #define FIX_HW_BRN_30982
#define FIX_HW_BRN_31093
#define FIX_HW_BRN_31195
#define FIX_HW_BRN_31272
#define FIX_HW_BRN_31620
#define FIX_HW_BRN_31780
#define FIX_HW_BRN_31542
- #define FIX_HW_BRN_32044
- #define FIX_HW_BRN_32085
+ #define FIX_HW_BRN_32044
+ #define FIX_HW_BRN_32085
#if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) && defined(SGX_FEATURE_MP)
#define FIX_HW_BRN_33657
#endif
#define FIX_HW_BRN_33920
-
+
#else
#if SGX_CORE_REV == 213
#define FIX_HW_BRN_31272
#if defined(SGX_FEATURE_MP)
#define FIX_HW_BRN_31425
#endif
- #define FIX_HW_BRN_31671
+ #define FIX_HW_BRN_31671
#define FIX_HW_BRN_31780
- #define FIX_HW_BRN_32085
+ #define FIX_HW_BRN_32085
#if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) && defined(SGX_FEATURE_MP)
#define FIX_HW_BRN_33657
#endif
#define FIX_HW_BRN_33920
-
+
#else
#if SGX_CORE_REV == 216
#if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) && defined(SGX_FEATURE_MP)
#endif
#endif
#endif
-
+
#define SGX_CORE_DEFINED
#endif
#if defined(SGX544) && !defined(SGX_CORE_DEFINED)
-
+
#define SGX_CORE_REV_HEAD 0
#if defined(USE_SGX_CORE_REV_HEAD)
-
+
#define SGX_CORE_REV SGX_CORE_REV_HEAD
#endif
#define FIX_HW_BRN_31425
#endif
#define FIX_HW_BRN_31780
- #define FIX_HW_BRN_32085
+ #define FIX_HW_BRN_32085
#if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) && defined(SGX_FEATURE_MP)
#define FIX_HW_BRN_33657
#endif
#define FIX_HW_BRN_31425
#endif
#define FIX_HW_BRN_31780
- #define FIX_HW_BRN_32085
+ #define FIX_HW_BRN_32085
#if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) && defined(SGX_FEATURE_MP)
#define FIX_HW_BRN_33657
#endif
#if defined(SGX_FEATURE_MP)
#define FIX_HW_BRN_31425
#endif
- #define FIX_HW_BRN_31542
+ #define FIX_HW_BRN_31542
#define FIX_HW_BRN_31620
- #define FIX_HW_BRN_31671
+ #define FIX_HW_BRN_31671
#define FIX_HW_BRN_31780
- #define FIX_HW_BRN_32044
- #define FIX_HW_BRN_32085
+ #define FIX_HW_BRN_32044
+ #define FIX_HW_BRN_32085
#if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) && defined(SGX_FEATURE_MP)
#define FIX_HW_BRN_33657
#endif
#define FIX_HW_BRN_33920
- #else
+ #else
#if SGX_CORE_REV == 105
#if defined(SGX_FEATURE_MP)
#define FIX_HW_BRN_31425
#endif
#endif
#endif
-
+
#define SGX_CORE_DEFINED
#endif
#if defined(SGX545) && !defined(SGX_CORE_DEFINED)
-
+
#define SGX_CORE_REV_HEAD 0
#if defined(USE_SGX_CORE_REV_HEAD)
-
+
#define SGX_CORE_REV SGX_CORE_REV_HEAD
#endif
#if SGX_CORE_REV == 10141
#else
#if SGX_CORE_REV == SGX_CORE_REV_HEAD
-
+
#else
#error "sgxerrata.h: SGX545 Core Revision unspecified"
#endif
#endif
#endif
#endif
-
+
#define SGX_CORE_DEFINED
#endif
#if defined(SGX554) && !defined(SGX_CORE_DEFINED)
-
+
#define SGX_CORE_REV_HEAD 0
#if defined(USE_SGX_CORE_REV_HEAD)
-
+
#define SGX_CORE_REV SGX_CORE_REV_HEAD
#endif
#if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) && defined(SGX_FEATURE_MP)
#define FIX_HW_BRN_33657
#endif
-
- #else
+
+ #else
#if SGX_CORE_REV == SGX_CORE_REV_HEAD
#if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) && defined(SGX_FEATURE_MP)
#define FIX_HW_BRN_33657
#error "sgxerrata.h: SGX554 Core Revision unspecified"
#endif
#endif
-
+
#define SGX_CORE_DEFINED
#endif
#endif
#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#define SGX_CORE_FRIENDLY_NAME "SGX520"
#define SGX_CORE_ID SGX_CORE_ID_520
#define SGX_FEATURE_ADDRESS_SPACE_SIZE (28)
- #define SGX_FEATURE_NUM_USE_PIPES (1)
#define SGX_FEATURE_AUTOCLOCKGATING
#else
#if defined(SGX530)
#define SGX_CORE_FRIENDLY_NAME "SGX530"
#define SGX_CORE_ID SGX_CORE_ID_530
#define SGX_FEATURE_ADDRESS_SPACE_SIZE (28)
- #define SGX_FEATURE_NUM_USE_PIPES (2)
#define SGX_FEATURE_AUTOCLOCKGATING
#else
#if defined(SGX531)
#define SGX_CORE_FRIENDLY_NAME "SGX531"
#define SGX_CORE_ID SGX_CORE_ID_531
#define SGX_FEATURE_ADDRESS_SPACE_SIZE (28)
- #define SGX_FEATURE_NUM_USE_PIPES (2)
#define SGX_FEATURE_AUTOCLOCKGATING
#define SGX_FEATURE_MULTI_EVENT_KICK
#else
#define SGX_FEATURE_MULTIPLE_MEM_CONTEXTS
#define SGX_FEATURE_BIF_NUM_DIRLISTS (16)
#define SGX_FEATURE_2D_HARDWARE
- #define SGX_FEATURE_NUM_USE_PIPES (2)
#define SGX_FEATURE_AUTOCLOCKGATING
#define SUPPORT_SGX_GENERAL_MAPPING_HEAP
#define SGX_FEATURE_EDM_VERTEX_PDSADDR_FULL_RANGE
#define SGX_CORE_FRIENDLY_NAME "SGX540"
#define SGX_CORE_ID SGX_CORE_ID_540
#define SGX_FEATURE_ADDRESS_SPACE_SIZE (28)
- #define SGX_FEATURE_NUM_USE_PIPES (4)
#define SGX_FEATURE_AUTOCLOCKGATING
#define SGX_FEATURE_MULTI_EVENT_KICK
#else
#define SGX_FEATURE_ADDRESS_SPACE_SIZE (32)
#define SGX_FEATURE_MULTIPLE_MEM_CONTEXTS
#define SGX_FEATURE_BIF_NUM_DIRLISTS (8)
- #define SGX_FEATURE_NUM_USE_PIPES (4)
#define SGX_FEATURE_AUTOCLOCKGATING
#define SGX_FEATURE_MONOLITHIC_UKERNEL
#define SGX_FEATURE_MULTI_EVENT_KICK
#define SGX_FEATURE_ADDRESS_SPACE_SIZE (32)
#define SGX_FEATURE_MULTIPLE_MEM_CONTEXTS
#define SGX_FEATURE_BIF_NUM_DIRLISTS (8)
- #define SGX_FEATURE_NUM_USE_PIPES (4)
#define SGX_FEATURE_AUTOCLOCKGATING
#define SGX_FEATURE_MONOLITHIC_UKERNEL
#define SGX_FEATURE_MULTI_EVENT_KICK
#define SGX_FEATURE_MAX_TA_RENDER_TARGETS (512)
#define SGX_FEATURE_SECONDARY_REQUIRES_USE_KICK
#define SGX_FEATURE_WRITEBACK_DCU
-
-
+
+
#define SGX_FEATURE_BIF_WIDE_TILING_AND_4K_ADDRESS
#define SGX_FEATURE_MULTI_EVENT_KICK
#define SGX_FEATURE_EDM_VERTEX_PDSADDR_FULL_RANGE
#define SGX_FEATURE_ADDRESS_SPACE_SIZE (32)
#define SGX_FEATURE_MULTIPLE_MEM_CONTEXTS
#define SGX_FEATURE_BIF_NUM_DIRLISTS (8)
- #define SGX_FEATURE_NUM_USE_PIPES (8)
#define SGX_FEATURE_AUTOCLOCKGATING
#define SGX_FEATURE_MONOLITHIC_UKERNEL
#define SGX_FEATURE_MULTI_EVENT_KICK
#if defined(SGX_FEATURE_MP_CORE_COUNT_TA) && defined(SGX_FEATURE_MP_CORE_COUNT_3D)
#if (SGX_FEATURE_MP_CORE_COUNT_TA > SGX_FEATURE_MP_CORE_COUNT_3D)
#error Number of TA cores larger than number of 3D cores not supported in current driver
-#endif
+#endif
#else
#if defined(SGX_FEATURE_MP_CORE_COUNT)
#define SGX_FEATURE_MP_CORE_COUNT_TA (SGX_FEATURE_MP_CORE_COUNT)
#error Either SGX_FEATURE_MP_CORE_COUNT or \
both SGX_FEATURE_MP_CORE_COUNT_TA and SGX_FEATURE_MP_CORE_COUNT_3D \
must be defined when SGX_FEATURE_MP is defined
-#endif
-#endif
+#endif
+#endif
#else
#define SGX_FEATURE_MP_CORE_COUNT (1)
#define SGX_FEATURE_MP_CORE_COUNT_TA (1)
#define SGX_FEATURE_MP_CORE_COUNT_3D (1)
-#endif
+#endif
#if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) && !defined(SUPPORT_SGX_PRIORITY_SCHEDULING)
#define SUPPORT_SGX_PRIORITY_SCHEDULING
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#define SGX_MMU_PTE_CACHECONSISTENT (0x00000008U)
#define SGX_MMU_PTE_EDMPROTECT (0x00000010U)
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#define EUR_CR_MASTER_SOFT_RESET_PTLA_RESET_SHIFT 10
#define EUR_CR_MASTER_SOFT_RESET_PTLA_RESET_SIGNED 0
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
{
enum
{
- hm_wrapped = 1,
- hm_wrapped_scatter,
- hm_wrapped_virtaddr,
- hm_wrapped_scatter_virtaddr,
- hm_env,
- hm_contiguous
+ hm_wrapped = 1,
+ hm_wrapped_scatter,
+ hm_wrapped_virtaddr,
+ hm_wrapped_scatter_virtaddr,
+ hm_env,
+ hm_contiguous
} eCpuMemoryOrigin;
- BM_HEAP *pBMHeap;
- RA_ARENA *pArena;
+ BM_HEAP *pBMHeap;
+ RA_ARENA *pArena;
IMG_CPU_VIRTADDR CpuVAddr;
IMG_CPU_PHYADDR CpuPAddr;
DEV_ARENA_DESCRIPTOR sDevArena;
MMU_HEAP *pMMUHeap;
PDUMP_MMU_ATTRIB *psMMUAttrib;
-
+
struct _BM_HEAP_ *psNext;
struct _BM_HEAP_ **ppsThis;
{
MMU_CONTEXT *psMMUContext;
-
+
BM_HEAP *psBMHeap;
-
+
BM_HEAP *psBMSharedHeap;
PVRSRV_DEVICE_NODE *psDeviceNode;
-
+
HASH_TABLE *pBufferHash;
-
+
IMG_HANDLE hResItem;
IMG_UINT32 ui32RefCount;
-
+
struct _BM_CONTEXT_ *psNext;
struct _BM_CONTEXT_ **ppsThis;
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#if defined(__cplusplus)
extern "C" {
#endif
-
-#include "ra.h"
-#include "resman.h"
+
+#include "ra.h"
+#include "resman.h"
typedef struct _BM_CONTEXT_ BM_CONTEXT;
#define DEVICE_MEMORY_HEAP_SHARED_EXPORTED 3
#define PVRSRV_DEVICE_NODE_FLAGS_PORT80DISPLAY 1
-#define PVRSRV_DEVICE_NODE_FLAGS_MMU_OPT_INV 2
+#define PVRSRV_DEVICE_NODE_FLAGS_MMU_OPT_INV 2
typedef struct _DEVICE_MEMORY_HEAP_INFO_
{
-
+
IMG_UINT32 ui32HeapID;
-
+
IMG_CHAR *pszName;
-
+
IMG_CHAR *pszBSName;
-
-
+
+
IMG_DEV_VIRTADDR sDevVAddrBase;
-
+
IMG_UINT32 ui32HeapSize;
-
+
IMG_UINT32 ui32Attribs;
-
+
DEVICE_MEMORY_HEAP_TYPE DevMemHeapType;
-
-
+
+
IMG_HANDLE hDevMemHeap;
-
-
+
+
RA_ARENA *psLocalDevMemArena;
-
+
IMG_UINT32 ui32DataPageSize;
IMG_UINT32 ui32XTileStride;
typedef struct _DEVICE_MEMORY_INFO_
{
-
+
IMG_UINT32 ui32AddressSpaceSizeLog2;
-
+
IMG_UINT32 ui32Flags;
-
+
IMG_UINT32 ui32HeapCount;
-
-
+
+
IMG_UINT32 ui32SyncHeapID;
-
-
+
+
IMG_UINT32 ui32MappingHeapID;
-
+
DEVICE_MEMORY_HEAP_INFO *psDeviceMemoryHeap;
-
+
BM_CONTEXT *pBMKernelContext;
-
+
BM_CONTEXT *pBMContext;
} DEVICE_MEMORY_INFO;
typedef struct DEV_ARENA_DESCRIPTOR_TAG
{
- IMG_UINT32 ui32HeapID;
+ IMG_UINT32 ui32HeapID;
- IMG_CHAR *pszName;
+ IMG_CHAR *pszName;
- IMG_DEV_VIRTADDR BaseDevVAddr;
+ IMG_DEV_VIRTADDR BaseDevVAddr;
- IMG_UINT32 ui32Size;
+ IMG_UINT32 ui32Size;
DEVICE_MEMORY_HEAP_TYPE DevMemHeapType;
-
+
IMG_UINT32 ui32DataPageSize;
DEVICE_MEMORY_HEAP_INFO *psDeviceMemoryHeapInfo;
typedef struct _PDUMP_MMU_ATTRIB_
{
PVRSRV_DEVICE_IDENTIFIER sDevId;
-
+
IMG_CHAR *pszPDRegRegion;
-
-
+
+
IMG_UINT32 ui32DataPageMask;
-
+
IMG_UINT32 ui32PTEValid;
IMG_UINT32 ui32PTSize;
IMG_UINT32 ui32PTEAlignShift;
-
+
IMG_UINT32 ui32PDEMask;
IMG_UINT32 ui32PDEAlignShift;
PVRSRV_DEVICE_IDENTIFIER sDevId;
IMG_UINT32 ui32RefCount;
+
-
-
+
PVRSRV_ERROR (*pfnInitDevice) (IMG_VOID*);
-
+
PVRSRV_ERROR (*pfnDeInitDevice) (IMG_VOID*);
-
+
PVRSRV_ERROR (*pfnInitDeviceCompatCheck) (struct _PVRSRV_DEVICE_NODE_*);
-
+
PVRSRV_ERROR (*pfnMMUInitialise)(struct _PVRSRV_DEVICE_NODE_*, MMU_CONTEXT**, IMG_DEV_PHYADDR*);
IMG_VOID (*pfnMMUFinalise)(MMU_CONTEXT*);
IMG_VOID (*pfnMMUInsertHeap)(MMU_CONTEXT*, MMU_HEAP*);
IMG_HANDLE hUniqueTag);
IMG_VOID (*pfnMMUMapShadow)(MMU_HEAP *pMMU,
IMG_DEV_VIRTADDR MapBaseDevVAddr,
- IMG_SIZE_T uSize,
+ IMG_SIZE_T uSize,
IMG_CPU_VIRTADDR CpuVAddr,
IMG_HANDLE hOSMemHandle,
IMG_DEV_VIRTADDR *pDevVAddr,
IMG_VOID (*pfnMMUGetCacheFlushRange)(MMU_CONTEXT *pMMUContext, IMG_UINT32 *pui32RangeMask);
IMG_VOID (*pfnMMUGetPDPhysAddr)(MMU_CONTEXT *pMMUContext, IMG_DEV_PHYADDR *psDevPAddr);
-
+
PVRSRV_ERROR (*pfnAllocMemTilingRange)(struct _PVRSRV_DEVICE_NODE_ *psDeviceNode,
PVRSRV_KERNEL_MEM_INFO *psMemInfo,
IMG_UINT32 ui32TilingStride,
PVRSRV_ERROR (*pfnFreeMemTilingRange)(struct _PVRSRV_DEVICE_NODE_ *psDeviceNode,
IMG_UINT32 ui32RangeIndex);
-
+
IMG_BOOL (*pfnDeviceISR)(IMG_VOID*);
-
+
IMG_VOID *pvISRData;
-
+
IMG_UINT32 ui32SOCInterruptBit;
-
+
IMG_VOID (*pfnDeviceMISR)(IMG_VOID*);
-
+
IMG_VOID (*pfnDeviceCommandComplete)(struct _PVRSRV_DEVICE_NODE_ *psDeviceNode);
-
+
IMG_BOOL bReProcessDeviceCommandComplete;
IMG_VOID (*pfnCacheInvalidate)(struct _PVRSRV_DEVICE_NODE_ *psDeviceNode);
-
+
DEVICE_MEMORY_INFO sDevMemoryInfo;
-
+
IMG_VOID *pvDevice;
- IMG_UINT32 ui32pvDeviceSize;
-
-
+ IMG_UINT32 ui32pvDeviceSize;
+
+
PRESMAN_CONTEXT hResManContext;
-
-
+
+
PSYS_DATA psSysData;
-
-
+
+
RA_ARENA *psLocalDevMemArena;
-
+
IMG_UINT32 ui32Flags;
-
+
struct _PVRSRV_DEVICE_NODE_ *psNext;
struct _PVRSRV_DEVICE_NODE_ **ppsThis;
-
+
#if defined(PDUMP)
-
+
PVRSRV_ERROR (*pfnPDumpInitDevice)(struct _PVRSRV_DEVICE_NODE_ *psDeviceNode);
-
+
IMG_UINT32 (*pfnMMUGetContextID)(IMG_HANDLE hDevMemContext);
#endif
} PVRSRV_DEVICE_NODE;
IMG_UINT32 ui32PollPeriodus,
IMG_BOOL bAllowPreemption);
-#endif
+#endif
#if defined (USING_ISR_INTERRUPTS)
IMG_UINT32 ui32Mask,
IMG_UINT32 ui32Waitus,
IMG_UINT32 ui32Tries);
-#endif
+#endif
PVRSRV_ERROR IMG_CALLCONV PVRSRVInit(PSYS_DATA psSysData);
IMG_VOID IMG_CALLCONV PVRSRVDeInit(PSYS_DATA psSysData);
#if defined(__cplusplus)
}
#endif
-
-#endif
+
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
typedef enum
{
-
+
PVRSRV_HANDLE_ALLOC_FLAG_NONE = 0,
-
+
PVRSRV_HANDLE_ALLOC_FLAG_SHARED = 0x01,
-
+
PVRSRV_HANDLE_ALLOC_FLAG_MULTI = 0x02,
-
+
PVRSRV_HANDLE_ALLOC_FLAG_PRIVATE = 0x04
} PVRSRV_HANDLE_ALLOC_FLAG;
PVRSRV_ERROR PVRSRVLookupAndReleaseHandle(PVRSRV_HANDLE_BASE *psBase, IMG_PVOID *ppvData, IMG_HANDLE hHandle, PVRSRV_HANDLE_TYPE eType);
PVRSRV_ERROR PVRSRVReleaseHandle(PVRSRV_HANDLE_BASE *psBase, IMG_HANDLE hHandle, PVRSRV_HANDLE_TYPE eType);
-#endif
+#endif
PVRSRV_ERROR PVRSRVNewHandleBatch(PVRSRV_HANDLE_BASE *psBase, IMG_UINT32 ui32BatchSize);
PVRSRV_ERROR PVRSRVHandleDeInit(IMG_VOID);
-#else
+#else
#define KERNEL_HANDLE_BASE IMG_NULL
PVRSRV_ERROR PVRSRVLookupHandleAnyType(PVRSRV_HANDLE_BASE *psBase, IMG_PVOID *ppvData, PVRSRV_HANDLE_TYPE *peType, IMG_HANDLE hHandle)
{
PVR_UNREFERENCED_PARAMETER(psBase);
-
+
*peType = PVRSRV_HANDLE_TYPE_NONE;
*ppvData = hHandle;
return PVRSRV_OK;
}
-#endif
+#endif
#define PVRSRVAllocHandleNR(psBase, phHandle, pvData, eType, eFlag) \
(IMG_VOID)PVRSRVAllocHandle(psBase, phHandle, pvData, eType, eFlag)
}
#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
}
#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#if defined(DEBUG) || defined(TIMING)
-typedef struct
+typedef struct
{
IMG_UINT32 ui32Start;
IMG_UINT32 ui32Stop;
IMG_UINT32 ui32Count;
} Temporal_Data;
-extern Temporal_Data asTimers[];
+extern Temporal_Data asTimers[];
extern IMG_UINT32 PVRSRVTimeNow(IMG_VOID);
extern IMG_VOID PVRSRVSetupMetricTimers(IMG_VOID *pvDevInfo);
#if defined(__sh__)
-#define TST_REG ((volatile IMG_UINT8 *) (psDevInfo->pvSOCRegsBaseKM))
+#define TST_REG ((volatile IMG_UINT8 *) (psDevInfo->pvSOCRegsBaseKM))
-#define TCOR_2 ((volatile IMG_UINT *) (psDevInfo->pvSOCRegsBaseKM+28))
-#define TCNT_2 ((volatile IMG_UINT *) (psDevInfo->pvSOCRegsBaseKM+32))
-#define TCR_2 ((volatile IMG_UINT16 *)(psDevInfo->pvSOCRegsBaseKM+36))
+#define TCOR_2 ((volatile IMG_UINT *) (psDevInfo->pvSOCRegsBaseKM+28))
+#define TCNT_2 ((volatile IMG_UINT *) (psDevInfo->pvSOCRegsBaseKM+32))
+#define TCR_2 ((volatile IMG_UINT16 *)(psDevInfo->pvSOCRegsBaseKM+36))
#define TIMER_DIVISOR 4
-#endif
+#endif
-#else
+#else
-#endif
+#endif
#if defined(__cplusplus)
}
#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#endif
-
+
#define PVRSRV_PAGEABLE_SELECT PVRSRV_OS_PAGEABLE_HEAP
#define KERNEL_ID 0xffffffffL
#define HOST_PAGEMASK (HOST_PAGESIZE()-1)
#define HOST_PAGEALIGN(addr) (((addr) + HOST_PAGEMASK) & ~HOST_PAGEMASK)
-#define PVRSRV_OS_HEAP_MASK 0xf
-#define PVRSRV_OS_PAGEABLE_HEAP 0x1
-#define PVRSRV_OS_NON_PAGEABLE_HEAP 0x2
+#define PVRSRV_OS_HEAP_MASK 0xf
+#define PVRSRV_OS_PAGEABLE_HEAP 0x1
+#define PVRSRV_OS_NON_PAGEABLE_HEAP 0x2
IMG_UINT32 OSClockus(IMG_VOID);
IMG_VOID *pvRangeAddrStart,
IMG_UINT32 ui32Length);
-#else
+#else
#ifdef INLINE_IS_PRAGMA
#pragma inline(OSFlushCPUCacheKM)
return IMG_FALSE;
}
-#endif
+#endif
#if defined(__linux__)
PVRSRV_ERROR OSRegisterDiscontigMem(IMG_SYS_PHYADDR *pBasePAddr,
- IMG_VOID *pvCpuVAddr,
+ IMG_VOID *pvCpuVAddr,
IMG_SIZE_T ui32Bytes,
- IMG_UINT32 ui32Flags,
+ IMG_UINT32 ui32Flags,
IMG_HANDLE *phOSMemHandle);
PVRSRV_ERROR OSUnRegisterDiscontigMem(IMG_VOID *pvCpuVAddr,
IMG_SIZE_T ui32Bytes,
IMG_UINT32 ui32Flags,
IMG_HANDLE hOSMemHandle);
-#else
+#else
#ifdef INLINE_IS_PRAGMA
#pragma inline(OSRegisterDiscontigMem)
#endif
return PVRSRV_ERROR_NOT_SUPPORTED;
}
-#endif
+#endif
#if defined(__linux__)
#endif
static INLINE PVRSRV_ERROR OSReserveDiscontigPhys(IMG_SYS_PHYADDR *pBasePAddr, IMG_SIZE_T ui32Bytes, IMG_UINT32 ui32Flags, IMG_VOID **ppvCpuVAddr, IMG_HANDLE *phOSMemHandle)
{
-#if defined(__linux__)
+#if defined(__linux__)
*ppvCpuVAddr = IMG_NULL;
- return OSRegisterDiscontigMem(pBasePAddr, *ppvCpuVAddr, ui32Bytes, ui32Flags, phOSMemHandle);
+ return OSRegisterDiscontigMem(pBasePAddr, *ppvCpuVAddr, ui32Bytes, ui32Flags, phOSMemHandle);
#else
extern IMG_CPU_PHYADDR SysSysPAddrToCpuPAddr(IMG_SYS_PHYADDR SysPAddr);
-
+
return OSReservePhys(SysSysPAddrToCpuPAddr(pBasePAddr[0]), ui32Bytes, ui32Flags, ppvCpuVAddr, phOSMemHandle);
-#endif
+#endif
}
static INLINE PVRSRV_ERROR OSUnReserveDiscontigPhys(IMG_VOID *pvCpuVAddr, IMG_SIZE_T ui32Bytes, IMG_UINT32 ui32Flags, IMG_HANDLE hOSMemHandle)
#if defined(__linux__)
OSUnRegisterDiscontigMem(pvCpuVAddr, ui32Bytes, ui32Flags, hOSMemHandle);
#endif
-
+
return PVRSRV_OK;
}
-#else
+#else
#ifdef INLINE_IS_PRAGMA
return PVRSRV_ERROR_NOT_SUPPORTED;
}
-#endif
+#endif
PVRSRV_ERROR OSRegisterMem(IMG_CPU_PHYADDR BasePAddr,
IMG_VOID *pvCpuVAddr,
#define OSAllocPages(flags, size, pageSize, privdata, privdatalength, linAddr, pageAlloc) \
(PVR_TRACE(("OSAllocPages(" #flags ", " #size ", " #pageSize ", " #linAddr ", " #pageAlloc "): (size = 0x%lx)", size)), \
OSAllocPages_Impl(flags, size, pageSize, linAddr, privdata, privdatalength, pageAlloc))
-
+
#define OSFreeMem(flags, size, linAddr, blockAlloc) \
(PVR_TRACE(("OSFreeMem(" #flags ", " #size ", " #linAddr ", " #blockAlloc "): (pointer = 0x%X)", linAddr)), \
OSFreeMem_Debug_Wrapper(flags, size, linAddr, blockAlloc, __FILE__, __LINE__))
#else
#define OSAllocMem(flags, size, linAddr, blockAlloc, logString) \
OSAllocMem_Debug_Wrapper(flags, size, linAddr, blockAlloc, __FILE__, __LINE__)
-
+
#define OSAllocPages OSAllocPages_Impl
-
+
#define OSFreeMem(flags, size, linAddr, blockAlloc) \
OSFreeMem_Debug_Wrapper(flags, size, linAddr, blockAlloc, __FILE__, __LINE__)
#endif
-
+
#ifdef PVRSRV_DEBUG_OS_MEMORY
PVRSRV_ERROR OSAllocMem_Debug_Wrapper(IMG_UINT32 ui32Flags,
IMG_HANDLE *phBlockAlloc,
IMG_CHAR *pszFilename,
IMG_UINT32 ui32Line);
-
+
PVRSRV_ERROR OSFreeMem_Debug_Wrapper(IMG_UINT32 ui32Flags,
IMG_UINT32 ui32Size,
IMG_PVOID pvCpuVAddr,
typedef struct
- {
+ {
IMG_UINT8 sGuardRegionBefore[8];
IMG_CHAR sFileName[128];
IMG_UINT32 uLineNo;
isAllocated = 0x260511AA
} eValid;
} OSMEM_DEBUG_INFO;
-
- #define TEST_BUFFER_PADDING_STATUS (sizeof(OSMEM_DEBUG_INFO))
- #define TEST_BUFFER_PADDING_AFTER (8)
+
+ #define TEST_BUFFER_PADDING_STATUS (sizeof(OSMEM_DEBUG_INFO))
+ #define TEST_BUFFER_PADDING_AFTER (8)
#define TEST_BUFFER_PADDING (TEST_BUFFER_PADDING_STATUS + TEST_BUFFER_PADDING_AFTER)
#else
#define OSAllocMem_Debug_Wrapper OSAllocMem_Debug_Linux_Memory_Allocations
#define OSFreeMem_Debug_Wrapper OSFreeMem_Debug_Linux_Memory_Allocations
#endif
-
+
#if defined(__linux__) && defined(DEBUG_LINUX_MEMORY_ALLOCATIONS)
PVRSRV_ERROR OSAllocMem_Impl(IMG_UINT32 ui32Flags, IMG_SIZE_T ui32Size, IMG_PVOID *ppvLinAddr, IMG_HANDLE *phBlockAlloc, IMG_CHAR *pszFilename, IMG_UINT32 ui32Line);
PVRSRV_ERROR OSFreeMem_Impl(IMG_UINT32 ui32Flags, IMG_SIZE_T ui32Size, IMG_PVOID pvLinAddr, IMG_HANDLE hBlockAlloc, IMG_CHAR *pszFilename, IMG_UINT32 ui32Line);
-
+
#define OSAllocMem_Debug_Linux_Memory_Allocations OSAllocMem_Impl
#define OSFreeMem_Debug_Linux_Memory_Allocations OSFreeMem_Impl
#else
PVRSRV_ERROR OSAllocMem_Impl(IMG_UINT32 ui32Flags, IMG_SIZE_T ui32Size, IMG_PVOID *ppvLinAddr, IMG_HANDLE *phBlockAlloc);
PVRSRV_ERROR OSFreeMem_Impl(IMG_UINT32 ui32Flags, IMG_SIZE_T ui32Size, IMG_PVOID pvLinAddr, IMG_HANDLE hBlockAlloc);
-
+
#define OSAllocMem_Debug_Linux_Memory_Allocations(flags, size, addr, blockAlloc, file, line) \
OSAllocMem_Impl(flags, size, addr, blockAlloc)
#define OSFreeMem_Debug_Linux_Memory_Allocations(flags, size, addr, blockAlloc, file, line) \
IMG_HANDLE *phOSEvent);
PVRSRV_ERROR OSEventObjectCloseKM(PVRSRV_EVENTOBJECT *psEventObject,
IMG_HANDLE hOSEventKM);
-#endif
+#endif
PVRSRV_ERROR OSBaseAllocContigMemory(IMG_SIZE_T ui32Size, IMG_CPU_VIRTADDR *pLinAddr, IMG_CPU_PHYADDR *pPhysAddr);
PVRSRV_ERROR OSPowerLockWrap(IMG_BOOL bTryLock);
IMG_VOID OSPowerLockUnwrap(IMG_VOID);
-#endif
-
+#endif
+
IMG_VOID OSWaitus(IMG_UINT32 ui32Timeus);
-
+
IMG_VOID OSSleepms(IMG_UINT32 ui32Timems);
IMG_HANDLE OSFuncHighResTimerCreate(IMG_VOID);
PVRSRV_ERROR OSCopyFromUser(IMG_PVOID pvProcess, IMG_VOID *pvDest, IMG_VOID *pvSrc, IMG_SIZE_T ui32Bytes);
#if defined(__linux__)
-PVRSRV_ERROR OSAcquirePhysPageAddr(IMG_VOID* pvCPUVAddr,
- IMG_SIZE_T ui32Bytes,
+PVRSRV_ERROR OSAcquirePhysPageAddr(IMG_VOID* pvCPUVAddr,
+ IMG_SIZE_T ui32Bytes,
IMG_SYS_PHYADDR *psSysPAddr,
IMG_HANDLE *phOSWrapMem);
PVRSRV_ERROR OSReleasePhysPageAddr(IMG_HANDLE hOSWrapMem);
#ifdef INLINE_IS_PRAGMA
#pragma inline(OSAcquirePhysPageAddr)
#endif
-static INLINE PVRSRV_ERROR OSAcquirePhysPageAddr(IMG_VOID* pvCPUVAddr,
- IMG_SIZE_T ui32Bytes,
+static INLINE PVRSRV_ERROR OSAcquirePhysPageAddr(IMG_VOID* pvCPUVAddr,
+ IMG_SIZE_T ui32Bytes,
IMG_SYS_PHYADDR *psSysPAddr,
IMG_HANDLE *phOSWrapMem)
{
PVR_UNREFERENCED_PARAMETER(ui32Bytes);
PVR_UNREFERENCED_PARAMETER(psSysPAddr);
PVR_UNREFERENCED_PARAMETER(phOSWrapMem);
- return PVRSRV_OK;
+ return PVRSRV_OK;
}
#ifdef INLINE_IS_PRAGMA
#pragma inline(OSReleasePhysPageAddr)
static INLINE PVRSRV_ERROR OSReleasePhysPageAddr(IMG_HANDLE hOSWrapMem)
{
PVR_UNREFERENCED_PARAMETER(hOSWrapMem);
- return PVRSRV_OK;
+ return PVRSRV_OK;
}
#endif
-
+
#if defined(__linux__) && defined(__KERNEL__)
#define OS_SUPPORTS_IN_LISR
mb();
}
-#else
+#else
#ifdef INLINE_IS_PRAGMA
#pragma inline(OSWriteMemoryBarrier)
#endif
static INLINE IMG_VOID OSMemoryBarrier(IMG_VOID) { }
-#endif
+#endif
#if defined (__cplusplus)
}
#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
PVRSRV_ERROR OSPerProcessPrivateDataDeInit(IMG_HANDLE hOsPrivateData);
PVRSRV_ERROR OSPerProcessSetHandleOptions(PVRSRV_HANDLE_BASE *psHandleBase);
-#else
+#else
#ifdef INLINE_IS_PRAGMA
#pragma inline(OSPerProcessPrivateDataInit)
#endif
return PVRSRV_OK;
}
-#endif
+#endif
#if defined (__cplusplus)
}
#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
IMG_EXPORT IMG_VOID PDumpConnectionNotify(IMG_VOID);
-#endif
+#endif
typedef enum
{
-
+
PDUMP_WRITE_MODE_CONTINUOUS = 0,
-
+
PDUMP_WRITE_MODE_LASTFRAME,
-
+
PDUMP_WRITE_MODE_BINCM,
-
+
PDUMP_WRITE_MODE_PERSISTENT
} PDUMP_DDWMODE;
#if defined (__cplusplus)
}
#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
IMG_BOOL bInitialisePages,
IMG_HANDLE hUniqueTag1,
IMG_HANDLE hUniqueTag2);
-
+
PVRSRV_ERROR PDumpMemPTEntriesKM(PDUMP_MMU_ATTRIB *psMMUAttrib,
IMG_HANDLE hOSMemHandle,
IMG_CPU_VIRTADDR pvLinAddr,
IMG_UINT32 ui32Flags);
IMG_VOID PDumpVGXMemToFile(IMG_CHAR *pszFileName,
- IMG_UINT32 ui32FileOffset,
+ IMG_UINT32 ui32FileOffset,
PVRSRV_KERNEL_MEM_INFO *psMemInfo,
- IMG_UINT32 uiAddr,
+ IMG_UINT32 uiAddr,
IMG_UINT32 ui32Size,
IMG_UINT32 ui32PDumpFlags,
IMG_HANDLE hUniqueTag);
IMG_VOID PDumpSuspendKM(IMG_VOID);
IMG_VOID PDumpResumeKM(IMG_VOID);
-
+
PVRSRV_ERROR PDumpStoreMemToFile(PDUMP_MMU_ATTRIB *psMMUAttrib,
IMG_CHAR *pszFileName,
- IMG_UINT32 ui32FileOffset,
+ IMG_UINT32 ui32FileOffset,
PVRSRV_KERNEL_MEM_INFO *psMemInfo,
- IMG_UINT32 uiAddr,
+ IMG_UINT32 uiAddr,
IMG_UINT32 ui32Size,
IMG_UINT32 ui32PDumpFlags,
IMG_HANDLE hUniqueTag);
}
#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#define MAX_PDUMP_STRING_LENGTH (256)
-
+
#define PDUMP_GET_SCRIPT_STRING() \
IMG_HANDLE hScript; \
IMG_UINT32 ui32MaxLen; \
eError = PDumpOSGetFilenameString(&pszFileName, &ui32MaxLenFileName);\
if(eError != PVRSRV_OK) return eError;
-
+
PVRSRV_ERROR PDumpOSGetScriptString(IMG_HANDLE *phScript, IMG_UINT32 *pui32MaxLen);
-
+
PVRSRV_ERROR PDumpOSGetMessageString(IMG_CHAR **ppszMsg, IMG_UINT32 *pui32MaxLen);
-
+
PVRSRV_ERROR PDumpOSGetFilenameString(IMG_CHAR **ppszFile, IMG_UINT32 *pui32MaxLen);
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#define PERFINIT()
#define PERFDEINIT()
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#endif
PVRSRV_HANDLE_BASE *psHandleBase;
#if defined (SUPPORT_SID_INTERFACE)
-
+
IMG_BOOL bHandlesBatched;
#else
#if defined (PVR_SECURE_HANDLES)
-
+
IMG_BOOL bHandlesBatched;
-#endif
-#endif
+#endif
+#endif
IMG_UINT32 ui32RefCount;
-
+
IMG_BOOL bInitProcess;
#if defined(PDUMP)
-
+
IMG_BOOL bPDumpPersistent;
#if defined(SUPPORT_PDUMP_MULTI_PROCESS)
-
+
IMG_BOOL bPDumpActive;
+#endif
#endif
-#endif
-
+
IMG_HANDLE hOsPrivateData;
} PVRSRV_PER_PROCESS_DATA;
}
#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#endif
-
+
typedef struct _PVRSRV_POWER_DEV_TAG_
{
PFN_PRE_POWER pfnPrePower;
typedef enum _PVRSRV_INIT_SERVER_STATE_
{
- PVRSRV_INIT_SERVER_Unspecified = -1,
- PVRSRV_INIT_SERVER_RUNNING = 0,
- PVRSRV_INIT_SERVER_RAN = 1,
- PVRSRV_INIT_SERVER_SUCCESSFUL = 2,
- PVRSRV_INIT_SERVER_NUM = 3,
+ PVRSRV_INIT_SERVER_Unspecified = -1,
+ PVRSRV_INIT_SERVER_RUNNING = 0,
+ PVRSRV_INIT_SERVER_RAN = 1,
+ PVRSRV_INIT_SERVER_SUCCESSFUL = 2,
+ PVRSRV_INIT_SERVER_NUM = 3,
PVRSRV_INIT_SERVER_FORCE_I32 = 0x7fffffff
} PVRSRV_INIT_SERVER_STATE, *PPVRSRV_INIT_SERVER_STATE;
#if defined (__cplusplus)
}
#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
IMG_IMPORT
PVRSRV_ERROR PVRSRVProcessQueues (IMG_BOOL bFlush);
-#if defined(__linux__) && defined(__KERNEL__)
+#if defined(__linux__) && defined(__KERNEL__)
#include <linux/types.h>
#include <linux/seq_file.h>
void* ProcSeqOff2ElementQueue(struct seq_file * sfile, loff_t off);
PVRSRV_ERROR PVRSRVRemoveCmdProcListKM(IMG_UINT32 ui32DevIndex,
IMG_UINT32 ui32CmdCount);
-#endif
+#endif
#if defined (__cplusplus)
}
#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#include "hash.h"
#include "osfunc.h"
-typedef struct _RA_ARENA_ RA_ARENA;
+typedef struct _RA_ARENA_ RA_ARENA;
typedef struct _BM_MAPPING_ BM_MAPPING;
-#define RA_STATS
+#define RA_STATS
struct _RA_STATISTICS_
{
-
+
IMG_SIZE_T uSpanCount;
-
+
IMG_SIZE_T uLiveSegmentCount;
-
+
IMG_SIZE_T uFreeSegmentCount;
-
+
IMG_SIZE_T uTotalResourceCount;
-
-
+
+
IMG_SIZE_T uFreeResourceCount;
-
+
IMG_SIZE_T uCumulativeAllocs;
-
+
IMG_SIZE_T uCumulativeFrees;
-
+
IMG_SIZE_T uImportCount;
-
+
IMG_SIZE_T uExportCount;
};
typedef struct _RA_STATISTICS_ RA_STATISTICS;
IMG_UINTPTR_T base,
IMG_SIZE_T uSize,
BM_MAPPING *psMapping,
- IMG_SIZE_T uQuantum,
+ IMG_SIZE_T uQuantum,
IMG_BOOL (*imp_alloc)(IMG_VOID *_h,
IMG_SIZE_T uSize,
IMG_SIZE_T *pActualSize,
RA_Add (RA_ARENA *pArena, IMG_UINTPTR_T base, IMG_SIZE_T uSize);
IMG_BOOL
-RA_Alloc (RA_ARENA *pArena,
+RA_Alloc (RA_ARENA *pArena,
IMG_SIZE_T uSize,
IMG_SIZE_T *pActualSize,
- BM_MAPPING **ppsMapping,
+ BM_MAPPING **ppsMapping,
IMG_UINT32 uFlags,
IMG_UINT32 uAlignment,
IMG_UINT32 uAlignmentOffset,
IMG_UINT32 ui32PrivDataLength,
IMG_UINTPTR_T *pBase);
-IMG_VOID
+IMG_VOID
RA_Free (RA_ARENA *pArena, IMG_UINTPTR_T base, IMG_BOOL bFreeBackingStore);
PVRSRV_ERROR RA_GetStats(RA_ARENA *pArena,
- IMG_CHAR **ppszStr,
+ IMG_CHAR **ppszStr,
IMG_UINT32 *pui32StrLen);
PVRSRV_ERROR RA_GetStatsFreeMem(RA_ARENA *pArena,
- IMG_CHAR **ppszStr,
+ IMG_CHAR **ppszStr,
IMG_UINT32 *pui32StrLen);
-#endif
+#endif
#endif
-/**********************************************************************
- *
- * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * The full GNU General Public License is included in this distribution in
- * the file called "COPYING".
- *
- * Contact Information:
- * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
- *
+/*************************************************************************/ /*!
+@Title Services reference count debugging
+@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
+@License Strictly Confidential.
*/ /**************************************************************************/
#ifndef __REFCOUNT_H__
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#endif
enum {
-
- RESMAN_TYPE_SHARED_PB_DESC = 1,
- RESMAN_TYPE_SHARED_PB_DESC_CREATE_LOCK,
- RESMAN_TYPE_HW_RENDER_CONTEXT,
- RESMAN_TYPE_HW_TRANSFER_CONTEXT,
- RESMAN_TYPE_HW_2D_CONTEXT,
- RESMAN_TYPE_TRANSFER_CONTEXT,
-
-
- RESMAN_TYPE_DMA_CLIENT_FIFO_DATA,
-
-
-
-
-
- RESMAN_TYPE_DISPLAYCLASS_SWAPCHAIN_REF,
- RESMAN_TYPE_DISPLAYCLASS_DEVICE,
-
-
- RESMAN_TYPE_BUFFERCLASS_DEVICE,
-
-
- RESMAN_TYPE_OS_USERMODE_MAPPING,
-
-
- RESMAN_TYPE_DEVICEMEM_CONTEXT,
- RESMAN_TYPE_DEVICECLASSMEM_MAPPING,
- RESMAN_TYPE_DEVICEMEM_MAPPING,
- RESMAN_TYPE_DEVICEMEM_WRAP,
- RESMAN_TYPE_DEVICEMEM_ALLOCATION,
- RESMAN_TYPE_EVENT_OBJECT,
- RESMAN_TYPE_SHARED_MEM_INFO,
- RESMAN_TYPE_MODIFY_SYNC_OPS,
- RESMAN_TYPE_SYNC_INFO,
-
-
- RESMAN_TYPE_KERNEL_DEVICEMEM_ALLOCATION
+
+ RESMAN_TYPE_SHARED_PB_DESC = 1,
+ RESMAN_TYPE_SHARED_PB_DESC_CREATE_LOCK,
+ RESMAN_TYPE_HW_RENDER_CONTEXT,
+ RESMAN_TYPE_HW_TRANSFER_CONTEXT,
+ RESMAN_TYPE_HW_2D_CONTEXT,
+ RESMAN_TYPE_TRANSFER_CONTEXT,
+
+
+ RESMAN_TYPE_DMA_CLIENT_FIFO_DATA,
+
+
+
+
+
+ RESMAN_TYPE_DISPLAYCLASS_SWAPCHAIN_REF,
+ RESMAN_TYPE_DISPLAYCLASS_DEVICE,
+
+
+ RESMAN_TYPE_BUFFERCLASS_DEVICE,
+
+
+ RESMAN_TYPE_OS_USERMODE_MAPPING,
+
+
+ RESMAN_TYPE_DEVICEMEM_CONTEXT,
+ RESMAN_TYPE_DEVICECLASSMEM_MAPPING,
+ RESMAN_TYPE_DEVICEMEM_MAPPING,
+ RESMAN_TYPE_DEVICEMEM_WRAP,
+ RESMAN_TYPE_DEVICEMEM_ALLOCATION,
+ RESMAN_TYPE_EVENT_OBJECT,
+ RESMAN_TYPE_SHARED_MEM_INFO,
+ RESMAN_TYPE_MODIFY_SYNC_OPS,
+ RESMAN_TYPE_SYNC_INFO,
+
+
+ RESMAN_TYPE_KERNEL_DEVICEMEM_ALLOCATION
};
-#define RESMAN_CRITERIA_ALL 0x00000000
-#define RESMAN_CRITERIA_RESTYPE 0x00000001
-#define RESMAN_CRITERIA_PVOID_PARAM 0x00000002
-#define RESMAN_CRITERIA_UI32_PARAM 0x00000004
+#define RESMAN_CRITERIA_ALL 0x00000000
+#define RESMAN_CRITERIA_RESTYPE 0x00000001
+#define RESMAN_CRITERIA_PVOID_PARAM 0x00000002
+#define RESMAN_CRITERIA_UI32_PARAM 0x00000004
-typedef PVRSRV_ERROR (*RESMAN_FREE_FN)(IMG_PVOID pvParam, IMG_UINT32 ui32Param, IMG_BOOL bForceCleanup);
+typedef PVRSRV_ERROR (*RESMAN_FREE_FN)(IMG_PVOID pvParam, IMG_UINT32 ui32Param, IMG_BOOL bForceCleanup);
typedef struct _RESMAN_ITEM_ *PRESMAN_ITEM;
typedef struct _RESMAN_CONTEXT_ *PRESMAN_CONTEXT;
IMG_VOID ResManDeInit(IMG_VOID);
PRESMAN_ITEM ResManRegisterRes(PRESMAN_CONTEXT hResManContext,
- IMG_UINT32 ui32ResType,
- IMG_PVOID pvParam,
- IMG_UINT32 ui32Param,
+ IMG_UINT32 ui32ResType,
+ IMG_PVOID pvParam,
+ IMG_UINT32 ui32Param,
RESMAN_FREE_FN pfnFreeResource);
PVRSRV_ERROR ResManFreeResByPtr(PRESMAN_ITEM psResItem,
IMG_BOOL bForceCleanup);
PVRSRV_ERROR ResManFreeResByCriteria(PRESMAN_CONTEXT hResManContext,
- IMG_UINT32 ui32SearchCriteria,
- IMG_UINT32 ui32ResType,
- IMG_PVOID pvParam,
+ IMG_UINT32 ui32SearchCriteria,
+ IMG_UINT32 ui32ResType,
+ IMG_PVOID pvParam,
IMG_UINT32 ui32Param);
PVRSRV_ERROR ResManDissociateRes(PRESMAN_ITEM psResItem,
}
#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#include "osfunc.h"
#include "refcount.h"
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
extern "C" {
#endif
-
+
#ifdef PVR_DISABLE_LOGGING
#define PVR_LOG(X)
#else
-
+
#define PVR_LOG(X) PVRSRVReleasePrintf X;
#endif
}
#endif
-
+
#define LOOP_UNTIL_TIMEOUT(TIMEOUT) \
{\
IMG_UINT32 uiOffset, uiStart, uiCurrent; \
IMG_IMPORT
const IMG_CHAR *PVRSRVGetErrorStringKM(PVRSRV_ERROR eError);
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
1, (IMG_UINT8 *) &psPAddr.uiAddr);
}
-#else
+#else
#define PVR_TTRACE(group, class, token) \
((void) 0)
#define PVR_TTRACE_SYNC_OBJECT(group, token, syncobj, op) \
((void) 0)
-#endif
+#endif
IMG_IMPORT PVRSRV_ERROR PVRSRVTimeTraceInit(IMG_VOID);
IMG_IMPORT IMG_VOID PVRSRVTimeTraceDeinit(IMG_VOID);
IMG_IMPORT PVRSRV_ERROR PVRSRVTimeTraceBufferDestroy(IMG_UINT32 ui32PID);
IMG_IMPORT IMG_VOID PVRSRVDumpTimeTraceBuffers(IMG_VOID);
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#define PVRSRV_TRACE_SYNC_WO_DEV_VADDR 5
#define PVRSRV_TRACE_SYNC_RO_DEV_VADDR 6
#define PVRSRV_TRACE_SYNC_OP 7
- #define PVRSRV_TRACE_SYNC_RO2P 8
- #define PVRSRV_TRACE_SYNC_RO2C 9
- #define PVRSRV_TRACE_SYNC_RO2_DEV_VADDR 10
-#define PVRSRV_TRACE_TYPE_SYNC_SIZE ((PVRSRV_TRACE_SYNC_RO2_DEV_VADDR + 1) * sizeof(IMG_UINT32))
+#define PVRSRV_TRACE_TYPE_SYNC_SIZE ((PVRSRV_TRACE_SYNC_OP + 1) * sizeof(IMG_UINT32))
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#define MKSYNC_TOKEN_CORE_CLK 1
#define MKSYNC_TOKEN_UKERNEL_CLK 2
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#ifndef _SYSCOMMON_H
#define _SYSCOMMON_H
-#include "sysconfig.h"
-#include "sysinfo.h"
+#include "sysconfig.h"
+#include "sysinfo.h"
#include "servicesint.h"
#include "queue.h"
#include "power.h"
typedef IMG_VOID (*PFN_HTIMER_DESTROY) (IMG_HANDLE);
typedef struct _SYS_DATA_TAG_
{
- IMG_UINT32 ui32NumDevices;
+ IMG_UINT32 ui32NumDevices;
SYS_DEVICE_ID sDeviceID[SYS_DEVICE_COUNT];
- PVRSRV_DEVICE_NODE *psDeviceNodeList;
- PVRSRV_POWER_DEV *psPowerDeviceList;
- PVRSRV_RESOURCE sPowerStateChangeResource;
- PVRSRV_SYS_POWER_STATE eCurrentPowerState;
- PVRSRV_SYS_POWER_STATE eFailedPowerState;
- IMG_UINT32 ui32CurrentOSPowerState;
- PVRSRV_QUEUE_INFO *psQueueList;
- PVRSRV_KERNEL_SYNC_INFO *psSharedSyncInfoList;
- IMG_PVOID pvEnvSpecificData;
- IMG_PVOID pvSysSpecificData;
- PVRSRV_RESOURCE sQProcessResource;
- IMG_VOID *pvSOCRegsBase;
- IMG_HANDLE hSOCTimerRegisterOSMemHandle;
- IMG_UINT32 *pvSOCTimerRegisterKM;
- IMG_VOID *pvSOCClockGateRegsBase;
+ PVRSRV_DEVICE_NODE *psDeviceNodeList;
+ PVRSRV_POWER_DEV *psPowerDeviceList;
+ PVRSRV_RESOURCE sPowerStateChangeResource;
+ PVRSRV_SYS_POWER_STATE eCurrentPowerState;
+ PVRSRV_SYS_POWER_STATE eFailedPowerState;
+ IMG_UINT32 ui32CurrentOSPowerState;
+ PVRSRV_QUEUE_INFO *psQueueList;
+ PVRSRV_KERNEL_SYNC_INFO *psSharedSyncInfoList;
+ IMG_PVOID pvEnvSpecificData;
+ IMG_PVOID pvSysSpecificData;
+ PVRSRV_RESOURCE sQProcessResource;
+ IMG_VOID *pvSOCRegsBase;
+ IMG_HANDLE hSOCTimerRegisterOSMemHandle;
+ IMG_UINT32 *pvSOCTimerRegisterKM;
+ IMG_VOID *pvSOCClockGateRegsBase;
IMG_UINT32 ui32SOCClockGateRegsSize;
-
+
struct _DEVICE_COMMAND_DATA_ *apsDeviceCommandData[SYS_DEVICE_COUNT];
+
+ RA_ARENA *apsLocalDevMemArena[SYS_MAX_LOCAL_DEVMEM_ARENAS];
- RA_ARENA *apsLocalDevMemArena[SYS_MAX_LOCAL_DEVMEM_ARENAS];
-
- IMG_CHAR *pszVersionString;
+ IMG_CHAR *pszVersionString;
#if defined (SUPPORT_SID_INTERFACE)
- PVRSRV_EVENTOBJECT_KM *psGlobalEventObject;
+ PVRSRV_EVENTOBJECT_KM *psGlobalEventObject;
#else
- PVRSRV_EVENTOBJECT *psGlobalEventObject;
+ PVRSRV_EVENTOBJECT *psGlobalEventObject;
#endif
- PVRSRV_MISC_INFO_CPUCACHEOP_TYPE ePendingCacheOpType;
+ PVRSRV_MISC_INFO_CPUCACHEOP_TYPE ePendingCacheOpType;
PFN_HTIMER_CREATE pfnHighResTimerCreate;
PFN_HTIMER_GETUS pfnHighResTimerGetus;
#endif
static INLINE IMG_VOID SysAcquireData(SYS_DATA **ppsSysData)
{
-
+
*ppsSysData = gpsSysData;
-
+
#endif
static INLINE SYS_DATA * SysAcquireDataNoCheck(IMG_VOID)
{
-
+
return gpsSysData;
}
{
PVRSRV_ERROR eError;
-
+
eError = PVRSRVInit(psSysData);
return eError;
#endif
static INLINE IMG_VOID SysDeinitialiseCommon(SYS_DATA *psSysData)
{
-
+
PVRSRVDeInit(psSysData);
OSDestroyResource(&psSysData->sPowerStateChangeResource);
}
-#endif
+#endif
#if !(defined(NO_HARDWARE) && defined(__linux__) && defined(__KERNEL__))
#define SysReadHWReg(p, o) OSReadHWReg(p, o)
#define SysWriteHWReg(p, o, v) OSWriteHWReg(p, o, v)
-#else
+#else
static inline IMG_UINT32 SysReadHWReg(IMG_PVOID pvLinRegBaseAddr, IMG_UINT32 ui32Offset)
{
return (IMG_UINT32) readl(pvLinRegBaseAddr + ui32Offset);
{
writel(ui32Value, pvLinRegBaseAddr + ui32Offset);
}
-#endif
+#endif
#if defined(__cplusplus)
}
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
{
IMG_UINT32 ui32Size;
IMG_UINT32 ui32FBPhysBaseAddress;
- IMG_UINT32 ui32FBMemAvailable;
+ IMG_UINT32 ui32FBMemAvailable;
IMG_UINT32 ui32SysPhysBaseAddress;
IMG_UINT32 ui32SysSize;
IMG_UINT32 ui32DevIRQ;
-} OEM_ACCESS_INFO, *POEM_ACCESS_INFO;
-
+} OEM_ACCESS_INFO, *POEM_ACCESS_INFO;
+
typedef IMG_UINT32 (*PFN_SRV_BRIDGEDISPATCH)( IMG_UINT32 Ioctl,
IMG_BYTE *pInBuf,
- IMG_UINT32 InBufLen,
+ IMG_UINT32 InBufLen,
IMG_BYTE *pOutBuf,
IMG_UINT32 OutBufLen,
IMG_UINT32 *pdwBytesTransferred);
}
#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
/**********************************************************************
*
* Copyright(c) 2008 Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
int BC_Video_ModCleanup(void);
int BC_Video_Bridge(struct drm_device *dev, IMG_VOID *arg, struct drm_file *file_priv);
-#endif
+#endif
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#else
-#define pvr_put_user put_user
-#define pvr_get_user get_user
+#define DRM_PSB_STOLEN_MEMORY 0x0B
+#define DRM_PSB_PLACEMENT_OFFSET 0x13
+
+#define DRM_PVR_RESERVED1 0x0D
+#define DRM_PVR_RESERVED2 0x0E
+#define DRM_PVR_RESERVED3 0x0F
+#define DRM_PVR_RESERVED4 0x10
+#define DRM_PVR_RESERVED5 0x11
+#define DRM_PVR_RESERVED6 0x12
#endif
#define DRM_PSB_VT_LEAVE 0x02
#define DRM_PSB_VT_ENTER 0x03
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#endif
#define SYS_SGX_CLOCK_SPEED (400000000)
-#define SYS_SGX_HWRECOVERY_TIMEOUT_FREQ (100)
-#define SYS_SGX_PDS_TIMER_FREQ (1000)
+#define SYS_SGX_HWRECOVERY_TIMEOUT_FREQ (100)
+#define SYS_SGX_PDS_TIMER_FREQ (1000)
#define SYS_SGX_ACTIVE_POWER_LATENCY_MS (5)
#if defined(SUPPORT_DRI_DRM_EXT)
#if defined(DRM_PVR_USE_INTEL_FB)
IMG_UINT32 gui32SGXDeviceID;
-#else
+#else
static IMG_UINT32 gui32SGXDeviceID;
#endif
#if defined(PVR_MDFLD_SYS_MSVDX_AND_TOPAZ)
psSysSpecData->hSGXPCI = OSPCISetDev((IMG_VOID *)psSysSpecData->psPCIDev, 0);
ui32MaxOffset = (IS_MRST(psSysSpecData->psDRMDev) || IS_MDFLD(psSysSpecData->psDRMDev)) ? MRST_MAX_OFFSET : POULSBO_MAX_OFFSET;
-
-#else
+
+#else
#if defined(LDM_PCI) || defined(SUPPORT_DRI_DRM)
psSysSpecData->hSGXPCI = OSPCISetDev((IMG_VOID *)psSysSpecData->psPCIDev, HOST_PCI_INIT_FLAG_BUS_MASTER | HOST_PCI_INIT_FLAG_MSI);
#else
psSysSpecData->hSGXPCI = OSPCIAcquireDev(SYS_SGX_DEV_VENDOR_ID, SYS_SGX_DEV_DEVICE_ID, HOST_PCI_INIT_FLAG_BUS_MASTER | HOST_PCI_INIT_FLAG_MSI);
#endif
-#endif
+#endif
if (!psSysSpecData->hSGXPCI)
{
PVR_DPF((PVR_DBG_ERROR,"PCIInitDev: Failed to acquire PCI device"));
#if defined(SGX_FEATURE_HOST_PORT)
PVR_TRACE(("Host Port region: %x to %x", OSPCIAddrRangeStart(psSysSpecData->hSGXPCI, POULSBO_HP_ADDR_RANGE_INDEX), OSPCIAddrRangeEnd(psSysSpecData->hSGXPCI, POULSBO_HP_ADDR_RANGE_INDEX)));
#endif
-
+
if (OSPCIAddrRangeLen(psSysSpecData->hSGXPCI, POULSBO_ADDR_RANGE_INDEX) < ui32MaxOffset)
{
PVR_DPF((PVR_DBG_ERROR,"PCIInitDev: Device memory region isn't big enough"));
return PVRSRV_ERROR_PCI_REGION_TOO_SMALL;
}
-
+
if (OSPCIRequestAddrRange(psSysSpecData->hSGXPCI, POULSBO_ADDR_RANGE_INDEX) != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR,"PCIInitDev: Device memory region not available"));
}
SYS_SPECIFIC_DATA_SET(psSysSpecData, SYS_SPECIFIC_DATA_PCI_REQUEST_SGX_ADDR_RANGE);
-
+
#if defined(SGX_FEATURE_HOST_PORT)
-
+
if (OSPCIRequestAddrRange(psSysSpecData->hSGXPCI, POULSBO_HP_ADDR_RANGE_INDEX) != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR,"PCIInitDev: Host Port region not available"));
return PVRSRV_ERROR_PCI_REGION_UNAVAILABLE;
}
SYS_SPECIFIC_DATA_SET(psSysSpecData, SYS_SPECIFIC_DATA_PCI_REQUEST_HOST_PORT_RANGE);
-#endif
+#endif
return PVRSRV_OK;
}
#endif
PVR_TRACE(("IRQ: %d", ui32IRQ));
-
+
gsSGXDeviceMap.ui32Flags = 0x0;
gsSGXDeviceMap.ui32IRQ = ui32IRQ;
-
+
#if defined(SUPPORT_DRI_DRM_EXT)
gsSGXDeviceMap.sRegsSysPBase.uiAddr = ui32BaseAddr + ((IS_MRST(psSysSpecData->psDRMDev) || IS_MDFLD(psSysSpecData->psDRMDev)) ? MRST_SGX_REGS_OFFSET : POULSBO_SGX_REGS_OFFSET);
#else
#endif
gsSGXDeviceMap.sRegsCpuPBase = SysSysPAddrToCpuPAddr(gsSGXDeviceMap.sRegsSysPBase);
gsSGXDeviceMap.ui32RegsSize = SGX_REG_SIZE;
-
+
#if defined(SGX_FEATURE_HOST_PORT)
-
+
gsSGXDeviceMap.ui32Flags = SGX_HOSTPORT_PRESENT;
gsSGXDeviceMap.sHPSysPBase.uiAddr = ui32HostPortAddr;
gsSGXDeviceMap.sHPCpuPBase = SysSysPAddrToCpuPAddr(gsSGXDeviceMap.sHPSysPBase);
gsSGXDeviceMap.ui32HPSize = SYS_SGX_HP_SIZE;
-#endif
+#endif
#if defined(MRST_SLAVEPORT)
-
+
gsSGXDeviceMap.sSPSysPBase.uiAddr = ui32BaseAddr + MRST_SGX_SP_OFFSET;
gsSGXDeviceMap.sSPCpuPBase = SysSysPAddrToCpuPAddr(gsSGXDeviceMap.sSPSysPBase);
gsSGXDeviceMap.ui32SPSize = SGX_SP_SIZE;
#endif
-
+
#if !defined(NO_HARDWARE)
-
+
{
IMG_SYS_PHYADDR sPoulsboRegsCpuPBase;
sPoulsboRegsCpuPBase.uiAddr = ui32BaseAddr + POULSBO_REGS_OFFSET;
#endif
#if defined(PDUMP)
{
-
+
static IMG_CHAR pszPDumpDevName[] = "SGXMEM";
gsSGXDeviceMap.pszPDumpDevName = pszPDumpDevName;
}
ui32MaxStrLen + 1,
pszVersionString,
IMG_NULL);
-
+
return PVRSRV_ERROR_INVALID_PARAMS;
}
}
static IMG_VOID SysFreeVersionString(SYS_DATA *psSysData)
-{
+{
if(psSysData->pszVersionString)
{
IMG_UINT32 ui32MaxStrLen;
gpsSysData->pvSysSpecificData = &gsSysSpecificData;
gsSysSpecificData.ui32SysSpecificData = 0;
#if defined(LDM_PCI) || defined(SUPPORT_DRI_DRM)
-
+
PVR_ASSERT(gpsPVRLDMDev != IMG_NULL);
gsSysSpecificData.psPCIDev = gpsPVRLDMDev;
#endif
#if defined(SUPPORT_DRI_DRM)
-
+
PVR_ASSERT(gpsPVRDRMDev != IMG_NULL);
gsSysSpecificData.psDRMDev = gpsPVRDRMDev;
#endif
return eError;
}
-
+
psTimingInfo = &gsSGXDeviceMap.sTimingInfo;
psTimingInfo->ui32CoreClockSpeed = SYS_SGX_CLOCK_SPEED;
- psTimingInfo->ui32HWRecoveryFreq = SYS_SGX_HWRECOVERY_TIMEOUT_FREQ;
+ psTimingInfo->ui32HWRecoveryFreq = SYS_SGX_HWRECOVERY_TIMEOUT_FREQ;
#if defined(SUPPORT_ACTIVE_POWER_MANAGEMENT)
psTimingInfo->bEnableActivePM = IMG_TRUE;
-#else
+#else
psTimingInfo->bEnableActivePM = IMG_FALSE;
-#endif
- psTimingInfo->ui32ActivePowManLatencyms = SYS_SGX_ACTIVE_POWER_LATENCY_MS;
- psTimingInfo->ui32uKernelFreq = SYS_SGX_PDS_TIMER_FREQ;
+#endif
+ psTimingInfo->ui32ActivePowManLatencyms = SYS_SGX_ACTIVE_POWER_LATENCY_MS;
+ psTimingInfo->ui32uKernelFreq = SYS_SGX_PDS_TIMER_FREQ;
eError = PCIInitDev(gpsSysData);
if (eError != PVRSRV_OK)
gpsSysData->ui32NumDevices = SYS_DEVICE_COUNT;
-
+
for(i=0; i<SYS_DEVICE_COUNT; i++)
{
gpsSysData->sDeviceID[i].uiID = i;
gpsSysData = IMG_NULL;
return eError;
}
-
-
+
+
#ifdef CONFIG_MDFD_VIDEO_DECODE
#if defined(PVR_MDFLD_SYS_MSVDX_AND_TOPAZ)
-
+
eError = PVRSRVRegisterDevice(gpsSysData, MSVDXRegisterDevice,
DEVICE_MSVDX_INTERRUPT, &gui32MRSTMSVDXDeviceID);
if (eError != PVRSRV_OK)
if (IS_MDFLD(gpDrmDevice) && !dev_priv->topaz_disabled)
{
-
+
eError = PVRSRVRegisterDevice(gpsSysData, TOPAZRegisterDevice,
DEVICE_TOPAZ_INTERRUPT, &gui32MRSTTOPAZDeviceID);
if (eError != PVRSRV_OK)
}
#endif
#endif
-
+
psDeviceNode = gpsSysData->psDeviceNodeList;
while(psDeviceNode)
{
-
+
switch(psDeviceNode->sDevId.eDeviceType)
{
case PVRSRV_DEVICE_TYPE_SGX:
{
DEVICE_MEMORY_INFO *psDevMemoryInfo;
DEVICE_MEMORY_HEAP_INFO *psDeviceMemoryHeap;
-
-
+
+
psDeviceNode->psLocalDevMemArena = IMG_NULL;
-
-
+
+
psDevMemoryInfo = &psDeviceNode->sDevMemoryInfo;
psDeviceMemoryHeap = psDevMemoryInfo->psDeviceMemoryHeap;
-
-
+
+
for(i=0; i<psDevMemoryInfo->ui32HeapCount; i++)
{
psDeviceMemoryHeap[i].ui32Attribs |= PVRSRV_BACKINGSTORE_SYSMEM_NONCONTIG;
#ifdef OEM_CUSTOMISE
-
+
#endif
}
#if defined(SUPPORT_DRI_DRM_EXT)
}
#if defined(PVR_MDFLD_SYS_MSVDX_AND_TOPAZ)
case PVRSRV_DEVICE_TYPE_MSVDX:
-
+
break;
case PVRSRV_DEVICE_TYPE_TOPAZ:
break;
}
}
-
+
psDeviceNode = psDeviceNode->psNext;
}
PDUMPINIT();
SYS_SPECIFIC_DATA_SET(&gsSysSpecificData, SYS_SPECIFIC_DATA_PDUMP_INIT);
-
+
eError = PVRSRVInitialiseDevice (gui32SGXDeviceID);
if (eError != PVRSRV_OK)
{
ui32Mask = POULSBO_THALIA_MASK;
-
+
ui32RegData = OSReadHWReg(gsPoulsboRegsCPUVaddr, POULSBO_INTERRUPT_IDENTITY_REG);
OSWriteHWReg(gsPoulsboRegsCPUVaddr, POULSBO_INTERRUPT_IDENTITY_REG, ui32RegData | ui32Mask);
-
+
ui32RegData = OSReadHWReg(gsPoulsboRegsCPUVaddr, POULSBO_INTERRUPT_MASK_REG);
OSWriteHWReg(gsPoulsboRegsCPUVaddr, POULSBO_INTERRUPT_MASK_REG, ui32RegData & (~ui32Mask));
-
+
ui32RegData = OSReadHWReg(gsPoulsboRegsCPUVaddr, POULSBO_INTERRUPT_ENABLE_REG);
OSWriteHWReg(gsPoulsboRegsCPUVaddr, POULSBO_INTERRUPT_ENABLE_REG, ui32RegData | ui32Mask);
#endif
PVR_UNREFERENCED_PARAMETER(psSysData);
}
-#endif
+#endif
#if !defined(SUPPORT_DRI_DRM_EXT)
static IMG_VOID SysDisableInterrupts(SYS_DATA *psSysData)
IMG_UINT32 ui32Mask;
ui32Mask = POULSBO_THALIA_MASK;
-
+
ui32RegData = OSReadHWReg(gsPoulsboRegsCPUVaddr, POULSBO_INTERRUPT_ENABLE_REG);
OSWriteHWReg(gsPoulsboRegsCPUVaddr, POULSBO_INTERRUPT_ENABLE_REG, ui32RegData & (~ui32Mask));
-
+
ui32RegData = OSReadHWReg(gsPoulsboRegsCPUVaddr, POULSBO_INTERRUPT_MASK_REG);
OSWriteHWReg(gsPoulsboRegsCPUVaddr, POULSBO_INTERRUPT_MASK_REG, ui32RegData | ui32Mask);
#endif
PVR_UNREFERENCED_PARAMETER(psSysData);
}
-#endif
+#endif
PVRSRV_ERROR SysFinalise(IMG_VOID)
{
PVRSRV_ERROR eError = PVRSRV_OK;
-
+
eError = OSInstallMISR(gpsSysData);
if (eError != PVRSRV_OK)
{
return eError;
}
SYS_SPECIFIC_DATA_SET(&gsSysSpecificData, SYS_SPECIFIC_DATA_LISR_INSTALLED);
-#endif
+#endif
#if (defined(SYS_USING_INTERRUPTS) && !defined(SUPPORT_DRI_DRM_EXT))
SysEnableInterrupts(gpsSysData);
#endif
#if defined(__linux__)
-
+
eError = SysCreateVersionString(gpsSysData);
if (eError != PVRSRV_OK)
{
return eError;
}
}
-#endif
+#endif
if (SYS_SPECIFIC_DATA_TEST(psSysSpecData, SYS_SPECIFIC_DATA_MISR_INSTALLED))
{
if (SYS_SPECIFIC_DATA_TEST(psSysSpecData, SYS_SPECIFIC_DATA_SGX_INITIALISED))
{
-
+
eError = PVRSRVDeinitialiseDevice(gui32SGXDeviceID);
if (eError != PVRSRV_OK)
{
#if !defined(NO_HARDWARE)
-
+
OSUnMapPhysToLin(gsPoulsboRegsCPUVaddr,
POULSBO_REG_SIZE,
PVRSRV_HAP_KERNEL_ONLY|PVRSRV_HAP_UNCACHED,
PVR_UNREFERENCED_PARAMETER(psSysData);
PVR_UNREFERENCED_PARAMETER(psDeviceNode);
-
+
ui32Data = OSReadHWReg(gsPoulsboRegsCPUVaddr, POULSBO_INTERRUPT_IDENTITY_REG);
if (ui32Data & POULSBO_THALIA_MASK)
ui32Devices |= DEVICE_MSVDX_INTERRUPT;
}
-
+
ui32DIMMask = OSReadHWReg(gsPoulsboRegsCPUVaddr, POULSBO_INTERRUPT_ENABLE_REG);
ui32DIMMask &= ~(POULSBO_THALIA_MASK | POULSBO_MSVDX_MASK);
-
+
if (ui32Data & ui32DIMMask)
{
ui32Devices |= DEVICE_DISP_INTERRUPT;
}
return (ui32Devices);
-#else
+#else
PVR_UNREFERENCED_PARAMETER(psSysData);
PVR_UNREFERENCED_PARAMETER(psDeviceNode);
return 0;
-#endif
+#endif
}
IMG_VOID SysClearInterrupts(SYS_DATA* psSysData, IMG_UINT32 ui32ClearBits)
{
OSWriteHWReg(gsPoulsboRegsCPUVaddr, POULSBO_INTERRUPT_IDENTITY_REG, ui32Mask);
}
-#else
+#else
PVR_UNREFERENCED_PARAMETER(psSysData);
PVR_UNREFERENCED_PARAMETER(ui32ClearBits);
-#endif
+#endif
}
-PVRSRV_ERROR SysGetDeviceMemoryMap(PVRSRV_DEVICE_TYPE eDeviceType,
+PVRSRV_ERROR SysGetDeviceMemoryMap(PVRSRV_DEVICE_TYPE eDeviceType,
IMG_VOID **ppvDeviceMap)
{
switch(eDeviceType)
{
case PVRSRV_DEVICE_TYPE_SGX:
{
-
+
*ppvDeviceMap = (IMG_VOID*)&gsSGXDeviceMap;
break;
}
PVR_DPF((PVR_DBG_ERROR,"SysGetDeviceMemoryMap: unsupported device type"));
}
}
- return PVRSRV_OK;
+ return PVRSRV_OK;
}
-IMG_DEV_PHYADDR SysCpuPAddrToDevPAddr (PVRSRV_DEVICE_TYPE eDeviceType,
+IMG_DEV_PHYADDR SysCpuPAddrToDevPAddr (PVRSRV_DEVICE_TYPE eDeviceType,
IMG_CPU_PHYADDR CpuPAddr)
{
IMG_DEV_PHYADDR DevPAddr;
PVR_UNREFERENCED_PARAMETER(eDeviceType);
-
+
DevPAddr.uiAddr = CpuPAddr.uiAddr;
return DevPAddr;
{
IMG_CPU_PHYADDR cpu_paddr;
-
+
cpu_paddr.uiAddr = sys_paddr.uiAddr;
return cpu_paddr;
}
IMG_SYS_PHYADDR SysCpuPAddrToSysPAddr (IMG_CPU_PHYADDR cpu_paddr)
{
IMG_SYS_PHYADDR sys_paddr;
-
-
+
+
sys_paddr.uiAddr = cpu_paddr.uiAddr;
return sys_paddr;
}
PVR_UNREFERENCED_PARAMETER(eDeviceType);
-
+
DevPAddr.uiAddr = SysPAddr.uiAddr;
-
+
return DevPAddr;
}
PVR_UNREFERENCED_PARAMETER(eDeviceType);
-
+
SysPAddr.uiAddr = DevPAddr.uiAddr;
return SysPAddr;
IMG_VOID SysRegisterExternalDevice(PVRSRV_DEVICE_NODE *psDeviceNode)
{
-
- psDeviceNode->ui32SOCInterruptBit = DEVICE_DISP_INTERRUPT;
+
+ psDeviceNode->ui32SOCInterruptBit = DEVICE_DISP_INTERRUPT;
}
PVR_UNREFERENCED_PARAMETER(psDeviceNode);
}
-PVRSRV_ERROR SysOEMFunction ( IMG_UINT32 ui32ID,
+PVRSRV_ERROR SysOEMFunction ( IMG_UINT32 ui32ID,
IMG_VOID *pvIn,
IMG_UINT32 ulInSize,
IMG_VOID *pvOut,
case PVRSRV_DEVICE_TYPE_SGX:
{
PVRSRV_SGXDEV_INFO *psDevInfo = (PVRSRV_SGXDEV_INFO *)psDeviceNodeList->pvDevice;
-
+
if (SYS_SPECIFIC_DATA_TEST(&gsSysSpecificData, SYS_SPECIFIC_DATA_PM_UNMAP_SGX_REGS))
{
psDevInfo->pvRegsBaseKM = OSMapPhysToLin(gsSGXDeviceMap.sRegsCpuPBase,
{
if (SYS_SPECIFIC_DATA_TEST(&gsSysSpecificData, SYS_SPECIFIC_DATA_PM_UNMAP_SGX_HP))
{
-
+
psDevInfo->pvHostPortBaseKM = OSMapPhysToLin(gsSGXDeviceMap.sHPCpuPBase,
gsSGXDeviceMap.ui32HPSize,
PVRSRV_HAP_KERNEL_ONLY|PVRSRV_HAP_UNCACHED,
psDevInfo->ui32HPSize = gsSGXDeviceMap.ui32HPSize;
psDevInfo->sHPSysPAddr = gsSGXDeviceMap.sHPSysPBase;
}
-#endif
+#endif
break;
}
default:
{
PVRSRV_SGXDEV_INFO *psDevInfo = (PVRSRV_SGXDEV_INFO *)psDeviceNodeList->pvDevice;
#if !(defined(NO_HARDWARE) && defined(__linux__))
-
+
if (psDevInfo->pvRegsBaseKM)
{
OSUnMapPhysToLin(psDevInfo->pvRegsBaseKM,
SYS_SPECIFIC_DATA_SET(&gsSysSpecificData, SYS_SPECIFIC_DATA_PM_UNMAP_SGX_REGS);
}
-#endif
+#endif
psDevInfo->pvRegsBaseKM = IMG_NULL;
psDevInfo->ui32RegSize = 0;
#if defined(SGX_FEATURE_HOST_PORT)
if (gsSGXDeviceMap.ui32Flags & SGX_HOSTPORT_PRESENT)
{
-
+
if (psDevInfo->pvHostPortBaseKM)
{
OSUnMapPhysToLin(psDevInfo->pvHostPortBaseKM,
psDevInfo->ui32HPSize = 0;
psDevInfo->sHPSysPAddr.uiAddr = 0;
}
-#endif
+#endif
break;
}
default:
}
#if !(defined(NO_HARDWARE) || defined(__linux__))
-
+
OSUnMapPhysToLin(gsPoulsboRegsCPUVaddr,
POULSBO_REG_SIZE,
PVRSRV_HAP_KERNEL_ONLY|PVRSRV_HAP_UNCACHED,
IMG_NULL);
-
+
OSUnMapPhysToLin(gsPoulsboDisplayRegsCPUVaddr,
POULSBO_DISPLAY_REG_SIZE,
PVRSRV_HAP_KERNEL_ONLY|PVRSRV_HAP_UNCACHED,
IMG_NULL);
-#endif
+#endif
return PVRSRV_OK;
}
-#endif
+#endif
PVRSRV_ERROR SysSystemPrePowerState(PVRSRV_SYS_POWER_STATE eNewPowerState)
if ((eNewPowerState == PVRSRV_SYS_POWER_STATE_D3) &&
(gpsSysData->eCurrentPowerState < PVRSRV_SYS_POWER_STATE_D3))
{
-
+
if (SYS_SPECIFIC_DATA_TEST(&gsSysSpecificData, SYS_SPECIFIC_DATA_IRQ_ENABLED))
{
SysDisableInterrupts(gpsSysData);
SYS_SPECIFIC_DATA_SET(&gsSysSpecificData, SYS_SPECIFIC_DATA_PM_UNINSTALL_LISR);
SYS_SPECIFIC_DATA_CLEAR(&gsSysSpecificData, SYS_SPECIFIC_DATA_LISR_INSTALLED);
}
-#endif
-
+#endif
+
SysUnmapRegisters();
eError = OSPCISuspendDev(gsSysSpecificData.hSGXPCI);
}
}
return eError;
-#else
+#else
PVR_UNREFERENCED_PARAMETER(eNewPowerState);
return PVRSRV_ERROR_NOT_SUPPORTED;
-#endif
+#endif
}
PVRSRV_ERROR SysSystemPostPowerState(PVRSRV_SYS_POWER_STATE eNewPowerState)
return eError;
}
-
+
eError = SysLocateDevices(gpsSysData);
return eError;
}
-
+
eError = SysMapInRegisters();
if (eError != PVRSRV_OK)
{
SYS_SPECIFIC_DATA_SET(&gsSysSpecificData, SYS_SPECIFIC_DATA_LISR_INSTALLED);
SYS_SPECIFIC_DATA_CLEAR(&gsSysSpecificData, SYS_SPECIFIC_DATA_PM_UNINSTALL_LISR);
}
-#endif
+#endif
if (SYS_SPECIFIC_DATA_TEST(&gsSysSpecificData, SYS_SPECIFIC_DATA_PM_IRQ_DISABLE))
{
}
}
return eError;
-#else
+#else
PVR_UNREFERENCED_PARAMETER(eNewPowerState);
return PVRSRV_ERROR_NOT_SUPPORTED;
-#endif
+#endif
}
}
#if defined(PVR_MDFLD_SYS_MSVDX_AND_TOPAZ)
else if (ui32DeviceIndex == gui32MRSTMSVDXDeviceID)
- {
+ {
psb_irq_uninstall_islands(gpDrmDevice, OSPM_VIDEO_DEC_ISLAND);
if (ospm_power_is_hw_on(OSPM_DISPLAY_ISLAND)) {
ospm_power_island_down(OSPM_VIDEO_DEC_ISLAND);
ospm_power_using_hw_end(OSPM_DISPLAY_ISLAND);
#endif
#endif
-#endif
+#endif
}
return PVRSRV_OK;
}
else if (ui32DeviceIndex == gui32MRSTMSVDXDeviceID)
{
PVR_DPF((PVR_DBG_MESSAGE,"SysDevicePrePowerState: Restore MSVDX power"));
- if (ospm_power_is_hw_on(OSPM_DISPLAY_ISLAND)) {
+ if (ospm_power_is_hw_on(OSPM_DISPLAY_ISLAND)) {
ospm_power_island_up(OSPM_VIDEO_DEC_ISLAND);
} else {
ospm_power_island_up(OSPM_DISPLAY_ISLAND);
ospm_power_island_up(OSPM_VIDEO_DEC_ISLAND);
ospm_power_island_down(OSPM_DISPLAY_ISLAND);
}
-#if 0
+#if 0
#if defined(SUPPORT_DRI_DRM_EXT)
if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, true))
{
ospm_power_island_up(OSPM_VIDEO_ENC_ISLAND);
ospm_power_island_down(OSPM_DISPLAY_ISLAND);
}
-#if 0
+#if 0
#if defined(SUPPORT_DRI_DRM_EXT)
if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, true))
{
#endif
#endif
}
-#endif
+#endif
}
return PVRSRV_OK;
if (gpsSGXDevNode != IMG_NULL)
{
- bStatus = (*gpsSGXDevNode->pfnDeviceISR)(gpsSGXDevNode->pvISRData);
+ bStatus = (*gpsSGXDevNode->pfnDeviceISR)(gpsSGXDevNode->pvISRData);
if (bStatus)
{
OSScheduleMISR((IMG_VOID *)gpsSGXDevNode->psSysData);
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#define SYS_SGX_USSE_COUNT (2)
#define POULSBO_REGS_OFFSET 0x00000
-#define POULSBO_REG_SIZE 0x2100
+#define POULSBO_REG_SIZE 0x2100
#define SGX_REGS_OFFSET 0x80000
#if defined(SGX544)
#define POULSBO_VSYNC_PIPEB_EVENT_MASK (1<<4)
#define POULSBO_DISPLAY_REGS_OFFSET 0x70000
-#define POULSBO_DISPLAY_REG_SIZE 0x2000
+#define POULSBO_DISPLAY_REG_SIZE 0x2000
#define POULSBO_DISPLAY_A_CONFIG 0x00008
#define POULSBO_DISPLAY_A_STATUS_SELECT 0x00024
#if defined(SGX_FEATURE_HOST_PORT)
#define SYS_SGX_HP_SIZE 0x8000000
-
+
#define SYS_SGX_HOSTPORT_BASE_DEVVADDR 0xD0000000
#if defined(FIX_HW_BRN_22997) && defined(FIX_HW_BRN_23030)
-
+
#define SYS_SGX_HOSTPORT_BRN23030_OFFSET 0x7C00000
#endif
#endif
-
+
typedef struct
{
union
IMG_UINT16 aui16PCISpace[128];
IMG_UINT32 aui32PCISpace[64];
#endif
- struct
+ struct
{
IMG_UINT16 ui16VenID;
IMG_UINT16 ui16DevID;
extern IMG_UINT32 gui32MRSTDisplayDeviceID;
extern IMG_UINT32 gui32MRSTMSVDXDeviceID;
extern IMG_UINT32 gui32MRSTTOPAZDeviceID;
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#define SYS_DEVICE_COUNT 10
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#define SYS_SPECIFIC_DATA_ALLOC_DUMMY_SGX_REGS 0x00000008
#if defined(SUPPORT_MSVDX)
#define SYS_SPECIFIC_DATA_ALLOC_DUMMY_MSVDX_REGS 0x00000020
-#endif
-#endif
+#endif
+#endif
#define SYS_SPECIFIC_DATA_SGX_INITIALISED 0x00000040
#if defined(SUPPORT_MSVDX)
#define SYS_SPECIFIC_DATA_MSVDX_INITIALISED 0x00000080
-#endif
+#endif
#define SYS_SPECIFIC_DATA_MISR_INSTALLED 0x00000100
#define SYS_SPECIFIC_DATA_LISR_INSTALLED 0x00000200
#define SYS_SPECIFIC_DATA_PDUMP_INIT 0x00000400
#define SYS_SPECIFIC_DATA_CLEAR(psSysSpecData, flag) ((IMG_VOID)((psSysSpecData)->ui32SysSpecificData &= ~(flag)))
#define SYS_SPECIFIC_DATA_TEST(psSysSpecData, flag) (((psSysSpecData)->ui32SysSpecificData & (flag)) != 0)
-
-
+
+
typedef struct _SYS_SPECIFIC_DATA_TAG_
{
-
+
IMG_UINT32 ui32SysSpecificData;
#ifdef __linux__
PVRSRV_PCI_DEV_HANDLE hSGXPCI;
IMG_UINT32 ui32SGXFreqListIndex;
} SYS_SPECIFIC_DATA;
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
**************************************************************************/
IMG_UINT32 ui32OutBufferSize; // size of output data buffer
} IOCTL_PACKAGE;
-IMG_UINT32 DeviceIoControl(IMG_UINT32 hDevice,
- IMG_UINT32 ui32ControlCode,
- IMG_VOID *pInBuffer,
+IMG_UINT32 DeviceIoControl(IMG_UINT32 hDevice,
+ IMG_UINT32 ui32ControlCode,
+ IMG_VOID *pInBuffer,
IMG_UINT32 ui32InBufferSize,
- IMG_VOID *pOutBuffer,
- IMG_UINT32 ui32OutBufferSize,
- IMG_UINT32 *pui32BytesReturned);
+ IMG_VOID *pOutBuffer,
+ IMG_UINT32 ui32OutBufferSize,
+ IMG_UINT32 *pui32BytesReturned);
#endif /* _LINUXSRV_H__*/
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
IMG_VOID IMG_CALLCONV ExtDBGDrivSetConnectNotifier(DBGKM_CONNECT_NOTIFIER fn_notifier)
{
-
+
g_fnDBGKMNotifier = fn_notifier;
}
{
IMG_VOID * pvRet;
-
+
HostAquireMutex(g_pvAPIMutex);
pvRet=DBGDrivCreateStream(pszName, ui32CapMode, ui32OutMode, ui32Flags, ui32Size);
-
+
HostReleaseMutex(g_pvAPIMutex);
return pvRet;
void IMG_CALLCONV ExtDBGDrivDestroyStream(PDBG_STREAM psStream)
{
-
+
HostAquireMutex(g_pvAPIMutex);
DBGDrivDestroyStream(psStream);
-
+
HostReleaseMutex(g_pvAPIMutex);
return;
{
IMG_VOID * pvRet;
-
+
HostAquireMutex(g_pvAPIMutex);
pvRet=DBGDrivFindStream(pszName, bResetStream);
else
{
PVR_DPF((PVR_DBG_ERROR, "pfnConnectNotifier not initialised.\n"));
- }
-
+ }
+
HostReleaseMutex(g_pvAPIMutex);
return pvRet;
{
IMG_UINT32 ui32Ret;
-
+
HostAquireMutex(g_pvAPIMutex);
ui32Ret=DBGDrivWriteString(psStream, pszString, ui32Level);
-
+
HostReleaseMutex(g_pvAPIMutex);
return ui32Ret;
{
IMG_UINT32 ui32Ret;
-
+
HostAquireMutex(g_pvAPIMutex);
ui32Ret=DBGDrivReadString(psStream, pszString, ui32Limit);
-
+
HostReleaseMutex(g_pvAPIMutex);
return ui32Ret;
{
IMG_UINT32 ui32Ret;
-
+
HostAquireMutex(g_pvAPIMutex);
ui32Ret=DBGDrivWrite(psStream, pui8InBuf, ui32InBuffSize, ui32Level);
-
+
HostReleaseMutex(g_pvAPIMutex);
return ui32Ret;
{
IMG_UINT32 ui32Ret;
-
+
HostAquireMutex(g_pvAPIMutex);
ui32Ret=DBGDrivRead(psStream, bReadInitBuffer, ui32OutBuffSize, pui8OutBuf);
-
+
HostReleaseMutex(g_pvAPIMutex);
return ui32Ret;
void IMG_CALLCONV ExtDBGDrivSetCaptureMode(PDBG_STREAM psStream,IMG_UINT32 ui32Mode,IMG_UINT32 ui32Start,IMG_UINT32 ui32End,IMG_UINT32 ui32SampleRate)
{
-
+
HostAquireMutex(g_pvAPIMutex);
DBGDrivSetCaptureMode(psStream, ui32Mode, ui32Start, ui32End, ui32SampleRate);
-
+
HostReleaseMutex(g_pvAPIMutex);
return;
void IMG_CALLCONV ExtDBGDrivSetOutputMode(PDBG_STREAM psStream,IMG_UINT32 ui32OutMode)
{
-
+
HostAquireMutex(g_pvAPIMutex);
DBGDrivSetOutputMode(psStream, ui32OutMode);
-
+
HostReleaseMutex(g_pvAPIMutex);
return;
void IMG_CALLCONV ExtDBGDrivSetDebugLevel(PDBG_STREAM psStream,IMG_UINT32 ui32DebugLevel)
{
-
+
HostAquireMutex(g_pvAPIMutex);
DBGDrivSetDebugLevel(psStream, ui32DebugLevel);
-
+
HostReleaseMutex(g_pvAPIMutex);
return;
void IMG_CALLCONV ExtDBGDrivSetFrame(PDBG_STREAM psStream,IMG_UINT32 ui32Frame)
{
-
+
HostAquireMutex(g_pvAPIMutex);
DBGDrivSetFrame(psStream, ui32Frame);
-
+
HostReleaseMutex(g_pvAPIMutex);
return;
{
IMG_UINT32 ui32Ret;
-
+
HostAquireMutex(g_pvAPIMutex);
ui32Ret=DBGDrivGetFrame(psStream);
-
+
HostReleaseMutex(g_pvAPIMutex);
return ui32Ret;
{
IMG_BOOL bRet;
-
+
HostAquireMutex(g_pvAPIMutex);
bRet = DBGDrivIsLastCaptureFrame(psStream);
-
+
HostReleaseMutex(g_pvAPIMutex);
return bRet;
{
IMG_BOOL bRet;
-
+
HostAquireMutex(g_pvAPIMutex);
bRet = DBGDrivIsCaptureFrame(psStream, bCheckPreviousFrame);
-
+
HostReleaseMutex(g_pvAPIMutex);
return bRet;
void IMG_CALLCONV ExtDBGDrivOverrideMode(PDBG_STREAM psStream,IMG_UINT32 ui32Mode)
{
-
+
HostAquireMutex(g_pvAPIMutex);
DBGDrivOverrideMode(psStream, ui32Mode);
-
+
HostReleaseMutex(g_pvAPIMutex);
return;
void IMG_CALLCONV ExtDBGDrivDefaultMode(PDBG_STREAM psStream)
{
-
+
HostAquireMutex(g_pvAPIMutex);
DBGDrivDefaultMode(psStream);
-
+
HostReleaseMutex(g_pvAPIMutex);
return;
{
IMG_UINT32 ui32Ret;
-
+
HostAquireMutex(g_pvAPIMutex);
ui32Ret=DBGDrivWrite2(psStream, pui8InBuf, ui32InBuffSize, ui32Level);
-
+
HostReleaseMutex(g_pvAPIMutex);
return ui32Ret;
{
IMG_UINT32 ui32Ret;
-
+
HostAquireMutex(g_pvAPIMutex);
ui32Ret=DBGDrivWritePersist(psStream, pui8InBuf, ui32InBuffSize, ui32Level);
PVR_DPF((PVR_DBG_ERROR, "An error occurred in DBGDrivWritePersist."));
}
-
+
HostReleaseMutex(g_pvAPIMutex);
return ui32Ret;
{
IMG_UINT32 ui32Ret;
-
+
HostAquireMutex(g_pvAPIMutex);
ui32Ret=DBGDrivWriteStringCM(psStream, pszString, ui32Level);
-
+
HostReleaseMutex(g_pvAPIMutex);
return ui32Ret;
IMG_UINT32 IMG_CALLCONV ExtDBGDrivWriteCM(PDBG_STREAM psStream,IMG_UINT8 * pui8InBuf,IMG_UINT32 ui32InBuffSize,IMG_UINT32 ui32Level)
{
IMG_UINT32 ui32Ret;
-
-
+
+
HostAquireMutex(g_pvAPIMutex);
-
+
ui32Ret=DBGDrivWriteCM(psStream, pui8InBuf, ui32InBuffSize, ui32Level);
-
-
+
+
HostReleaseMutex(g_pvAPIMutex);
-
+
return ui32Ret;
}
void IMG_CALLCONV ExtDBGDrivSetMarker(PDBG_STREAM psStream, IMG_UINT32 ui32Marker)
{
-
+
HostAquireMutex(g_pvAPIMutex);
DBGDrivSetMarker(psStream, ui32Marker);
-
+
HostReleaseMutex(g_pvAPIMutex);
return;
{
IMG_UINT32 ui32Marker;
-
+
HostAquireMutex(g_pvAPIMutex);
ui32Marker = DBGDrivGetMarker(psStream);
-
+
HostReleaseMutex(g_pvAPIMutex);
return ui32Marker;
{
IMG_UINT32 ui32Ret;
-
+
HostAquireMutex(g_pvAPIMutex);
ui32Ret = DBGDrivWriteLF(psStream, pui8InBuf, ui32InBuffSize, ui32Level, ui32Flags);
-
+
HostReleaseMutex(g_pvAPIMutex);
return ui32Ret;
{
IMG_UINT32 ui32Ret;
-
+
HostAquireMutex(g_pvAPIMutex);
ui32Ret = DBGDrivReadLF(psStream, ui32OutBuffSize, pui8OutBuf);
-
+
HostReleaseMutex(g_pvAPIMutex);
return ui32Ret;
IMG_VOID IMG_CALLCONV ExtDBGDrivStartInitPhase(PDBG_STREAM psStream)
{
-
+
HostAquireMutex(g_pvAPIMutex);
DBGDrivStartInitPhase(psStream);
-
+
HostReleaseMutex(g_pvAPIMutex);
return;
IMG_VOID IMG_CALLCONV ExtDBGDrivStopInitPhase(PDBG_STREAM psStream)
{
-
+
HostAquireMutex(g_pvAPIMutex);
DBGDrivStopInitPhase(psStream);
-
+
HostReleaseMutex(g_pvAPIMutex);
return;
{
IMG_UINT32 ui32Ret;
-
+
HostAquireMutex(g_pvAPIMutex);
ui32Ret = DBGDrivGetStreamOffset(psStream);
-
+
HostReleaseMutex(g_pvAPIMutex);
return ui32Ret;
IMG_VOID IMG_CALLCONV ExtDBGDrivSetStreamOffset(PDBG_STREAM psStream, IMG_UINT32 ui32StreamOffset)
{
-
+
HostAquireMutex(g_pvAPIMutex);
DBGDrivSetStreamOffset(psStream, ui32StreamOffset);
-
+
HostReleaseMutex(g_pvAPIMutex);
}
{
#if defined(SUPPORT_DBGDRV_EVENT_OBJECTS)
DBGDrivWaitForEvent(eEvent);
-#else
- PVR_UNREFERENCED_PARAMETER(eEvent);
-#endif
+#else
+ PVR_UNREFERENCED_PARAMETER(eEvent);
+#endif
}
IMG_UINT32 AtoI(IMG_CHAR *szIn)
IMG_INT iPos;
IMG_CHAR bc;
-
+
while (szIn[iLen] > 0)
{
iLen ++;
}
-
+
if (iLen == 0)
{
return (0);
}
-
+
iPos=0;
while (szIn[iPos] == '0')
{
szIn[iPos]='0';
}
-
+
for (iPos = iLen - 1; iPos >= 0; iPos --)
{
bc = szIn[iPos];
- if ( (bc >= 'a') && (bc <= 'f') && ui32Base == 16)
+ if ( (bc >= 'a') && (bc <= 'f') && ui32Base == 16)
{
bc -= 'a' - 0xa;
}
else
- if ( (bc >= 'A') && (bc <= 'F') && ui32Base == 16)
+ if ( (bc >= 'A') && (bc <= 'F') && ui32Base == 16)
{
bc -= 'A' - 0xa;
}
else
- if ((bc >= '0') && (bc <= '9'))
+ if ((bc >= '0') && (bc <= '9'))
{
bc -= '0';
}
static void Write(PDBG_STREAM psStream,IMG_PUINT8 pui8Data,IMG_UINT32 ui32InBuffSize)
{
-
+
if (!psStream->bCircularAllowed)
{
-
+
}
if ((psStream->ui32WPtr + ui32InBuffSize) > psStream->ui32Size)
{
-
+
IMG_UINT32 ui32B1 = psStream->ui32Size - psStream->ui32WPtr;
IMG_UINT32 ui32B2 = ui32InBuffSize - ui32B1;
-
+
HostMemCopy((IMG_PVOID)((IMG_UINTPTR_T)psStream->pvBase + psStream->ui32WPtr),
(IMG_PVOID) pui8Data,
ui32B1);
-
+
HostMemCopy(psStream->pvBase,
(IMG_PVOID)(pui8Data + ui32B1),
ui32B2);
-
+
psStream->ui32WPtr = ui32B2;
}
else
- {
+ {
HostMemCopy((IMG_PVOID)((IMG_UINTPTR_T)psStream->pvBase + psStream->ui32WPtr),
(IMG_PVOID) pui8Data,
ui32InBuffSize);
pScreen += g_ui32Line * 160;
-
+
i=0;
do
g_ui32Line++;
}
-
+
if (g_ui32Line == g_ui32MonoLines)
{
HostMemSet((IMG_VOID *)(DBGDRIV_MONOBASE + (160 * (g_ui32MonoLines - 1))),0,160);
}
-#endif
+#endif
}
static IMG_UINT32 WriteExpandingBuffer(PDBG_STREAM psStream,IMG_UINT8 * pui8InBuf,IMG_UINT32 ui32InBuffSize)
{
IMG_UINT ui32Space;
-
+
ui32Space = SpaceInStream(psStream);
-
+
if ((psStream->psCtrl->ui32OutMode & DEBUG_OUTMODE_STREAMENABLE) == 0)
{
return(0);
}
-
+
if (psStream->psCtrl->ui32Flags & DEBUG_FLAGS_NO_BUF_EXPANDSION)
{
-
+
if (ui32Space < 32)
{
IMG_UINT32 ui32NewBufSize;
-
+
ui32NewBufSize = 2 * psStream->ui32Size;
ui32NewBufSize += ui32InBuffSize;
}
-
+
if (!ExpandStreamBuffer(psStream,ui32NewBufSize))
{
}
else
{
-
+
PVR_DPF((PVR_DBG_ERROR, "WriteExpandingBuffer: Unable to expand %x. Out of memory.", (IMG_UINTPTR_T) psStream));
InvalidateAllStreams();
return (0xFFFFFFFFUL);
}
}
-
+
ui32Space = SpaceInStream(psStream);
PVR_DPF((PVR_DBGDRIV_MESSAGE, "Expanded buffer, free space = %x",
}
}
-
+
if (ui32Space <= (ui32InBuffSize + 4))
{
ui32InBuffSize = ui32Space - 4;
}
-
+
Write(psStream,pui8InBuf,ui32InBuffSize);
PDBG_LASTFRAME_BUFFER psLFBuffer;
PDBG_STREAM_CONTROL psCtrl;
IMG_UINT32 ui32Off;
- IMG_VOID * pvBase;
+ IMG_VOID * pvBase;
static IMG_CHAR pszNameInitSuffix[] = "_Init";
IMG_UINT32 ui32OffSuffix;
-
+
psStream = (PDBG_STREAM) DBGDrivFindStream(pszName, IMG_FALSE);
return ((IMG_VOID *) psStream);
}
-
+
psStream = HostNonPageablePageAlloc(1);
psInitStream = HostNonPageablePageAlloc(1);
return((IMG_VOID *) 0);
}
-
+
if ((ui32Flags & DEBUG_FLAGS_USE_NONPAGED_MEM) != 0)
{
pvBase = HostNonPageablePageAlloc(ui32Size);
return((IMG_VOID *) 0);
}
-
+
psCtrl->ui32Flags = ui32Flags;
psCtrl->ui32CapMode = ui32CapMode;
psCtrl->ui32OutMode = ui32OutMode;
psCtrl->ui32SampleRate = 1;
psCtrl->bInitPhaseComplete = IMG_FALSE;
-
+
psStream->psNext = 0;
psStream->pvBase = pvBase;
psStream->ui32Marker = 0;
psStream->bCircularAllowed = IMG_TRUE;
psStream->ui32InitPhaseWOff = 0;
+
-
-
+
if ((ui32Flags & DEBUG_FLAGS_USE_NONPAGED_MEM) != 0)
{
pvBase = HostNonPageablePageAlloc(ui32Size);
if (!pvBase)
{
PVR_DPF((PVR_DBG_ERROR,"DBGDriv: Couldn't alloc InitStream buffer\n\r"));
-
+
if ((psStream->psCtrl->ui32Flags & DEBUG_FLAGS_USE_NONPAGED_MEM) != 0)
{
HostNonPageablePageFree(psStream->pvBase);
return((IMG_VOID *) 0);
}
-
+
psInitStream->psNext = 0;
psInitStream->pvBase = pvBase;
psInitStream->psCtrl = psCtrl;
psInitStream->ui32Marker = 0;
psInitStream->bCircularAllowed = IMG_FALSE;
psInitStream->ui32InitPhaseWOff = 0;
-
+
psStream->psInitStream = psInitStream;
-
+
psLFBuffer->psStream = psStream;
psLFBuffer->ui32BufLen = 0UL;
g_ui32HotkeyMiddumpStart = 0xffffffffUL;
g_ui32HotkeyMiddumpEnd = 0xffffffffUL;
-
+
ui32Off = 0;
ui32Off++;
}
while ((pszName[ui32Off] != 0) && (ui32Off < (4096UL - sizeof(DBG_STREAM))));
- psStream->szName[ui32Off] = pszName[ui32Off];
-
+ psStream->szName[ui32Off] = pszName[ui32Off];
+
ui32OffSuffix = 0;
do
}
while ( (pszNameInitSuffix[ui32OffSuffix] != 0) &&
(ui32Off < (4096UL - sizeof(DBG_STREAM))));
- psInitStream->szName[ui32Off] = pszNameInitSuffix[ui32OffSuffix];
-
+ psInitStream->szName[ui32Off] = pszNameInitSuffix[ui32OffSuffix];
+
psStream->psNext = g_psStreamList;
g_psStreamList = psStream;
g_psLFBufferList = psLFBuffer;
AddSIDEntry(psStream);
-
+
return((IMG_VOID *) psStream);
}
PVR_DPF((PVR_DBG_MESSAGE, "DBGDriv: Destroying stream %s\r\n", psStream->szName ));
-
+
if (!StreamValid(psStream))
{
}
RemoveSIDEntry(psStream);
-
+
psLFBuffer = FindLFBuf(psStream);
-
+
psStreamThis = g_psStreamList;
psStreamPrev = 0;
psLFThis = psLFThis->psNext;
}
}
-
+
if (psStream->psCtrl->ui32CapMode & DEBUG_CAPMODE_HOTKEY)
{
DeactivateHotKeys();
}
-
+
if ((psStream->psCtrl->ui32Flags & DEBUG_FLAGS_USE_NONPAGED_MEM) != 0)
{
HostPageablePageFree(psStream->pvBase);
HostPageablePageFree(psStream->psInitStream->pvBase);
}
-
+
HostNonPageablePageFree(psStream->psInitStream);
HostNonPageablePageFree(psStream);
HostNonPageablePageFree(psLFBuffer);
pszName,
(bResetStream == IMG_TRUE) ? "with reset" : "no reset"));
-
+
for (psThis = g_psStreamList; psThis != IMG_NULL; psThis = psThis->psNext)
{
}
{
-
-
+
+
psStream->psInitStream->ui32InitPhaseWOff = psStream->psInitStream->ui32WPtr;
PVR_DPF((PVR_DBGDRIV_MESSAGE, "Set %s client marker bo %x, total bw %x",
psStream->szName,
IMG_UINT32 ui32Off = 0;
IMG_UINT32 ui32WPtr = psStream->ui32WPtr;
IMG_PUINT8 pui8Buffer = (IMG_UINT8 *) psStream->pvBase;
-
+
PVR_DPF((PVR_DBG_ERROR, "DBGDrivInvalidateStream: An error occurred for stream %s\r\n", psStream->szName ));
+
+
-
-
-
+
ui32Space = SpaceInStream(psStream);
-
+
if(ui32Space > 0)
{
ui32Space--;
pui8Buffer[ui32WPtr++] = '\0';
psStream->ui32WPtr = ui32WPtr;
-
+
psStream->psCtrl->ui32Flags |= DEBUG_FLAGS_READONLY;
}
IMG_UINT32 IMG_CALLCONV DBGDrivWriteStringCM(PDBG_STREAM psStream,IMG_CHAR * pszString,IMG_UINT32 ui32Level)
{
-
+
if (!StreamValidForWrite(psStream))
{
return(0xFFFFFFFFUL);
}
-
+
if (psStream->psCtrl->ui32CapMode & DEBUG_CAPMODE_FRAMED)
{
IMG_UINT32 ui32WPtr;
IMG_UINT8 * pui8Buffer;
-
+
if (!StreamValidForWrite(psStream))
{
return(0xFFFFFFFFUL);
}
-
+
if ((psStream->psCtrl->ui32DebugLevel & ui32Level) == 0)
{
return(0xFFFFFFFFUL);
}
-
+
if ((psStream->psCtrl->ui32OutMode & DEBUG_OUTMODE_ASYNC) == 0)
PVR_DPF((PVR_DBG_MESSAGE,"%s: %s\r\n",psStream->szName, pszString));
}
-
+
if (psStream->psCtrl->ui32OutMode & DEBUG_OUTMODE_MONO)
{
}
}
-
+
if (
!(
return(0xFFFFFFFFUL);
}
-
+
ui32Space=SpaceInStream(psStream);
-
+
if(ui32Space > 0)
{
ui32Space--;
if (ui32Len < ui32Space)
{
-
+
pui8Buffer[ui32WPtr] = (IMG_UINT8)pszString[ui32Len];
ui32Len++;
ui32WPtr++;
ui32WPtr = 0;
}
-
+
psStream->ui32WPtr = ui32WPtr;
psStream->ui32DataWritten+= ui32Len;
} else
IMG_UINT32 ui32Offset;
IMG_UINT8 *pui8Buff;
-
+
if (!StreamValidForRead(psStream))
{
return(0);
}
-
+
pui8Buff = (IMG_UINT8 *)psStream->pvBase;
ui32Offset = psStream->ui32RPtr;
return(0);
}
-
+
ui32Len = 0;
while((pui8Buff[ui32Offset] != 0) && (ui32Offset != psStream->ui32WPtr))
ui32Offset++;
ui32Len++;
-
+
if (ui32Offset == psStream->ui32Size)
{
ui32OutLen = ui32Len + 1;
-
+
if (ui32Len > ui32Limit)
{
return(0);
}
-
+
ui32Offset = psStream->ui32RPtr;
ui32Len = 0;
ui32Offset++;
ui32Len++;
-
+
if (ui32Offset == psStream->ui32Size)
{
IMG_UINT32 ui32Space;
DBG_STREAM *psStream;
-
+
if (!StreamValidForWrite(psMainStream))
{
return(0xFFFFFFFFUL);
}
-
+
if ((psMainStream->psCtrl->ui32DebugLevel & ui32Level) == 0)
{
return(0xFFFFFFFFUL);
}
-
+
if (psMainStream->psCtrl->ui32CapMode & DEBUG_CAPMODE_FRAMED)
{
if ((psMainStream->psCtrl->ui32Flags & DEBUG_FLAGS_ENABLESAMPLE) == 0)
{
-
+
return(ui32InBuffSize);
}
}
{
if ((psMainStream->psCtrl->ui32Current != g_ui32HotKeyFrame) || (g_bHotKeyPressed == IMG_FALSE))
{
-
+
return(ui32InBuffSize);
}
}
psStream = psMainStream->psInitStream;
}
-
+
ui32Space=SpaceInStream(psStream);
psStream->ui32RPtr,
psStream->ui32WPtr));
-
+
if ((psStream->psCtrl->ui32OutMode & DEBUG_OUTMODE_STREAMENABLE) == 0)
{
return(0);
}
-
+
if (ui32Space <= (ui32InBuffSize + 4))
{
ui32InBuffSize = ui32Space - 8;
}
-
+
Write(psStream,(IMG_UINT8 *) &ui32InBuffSize,4);
Write(psStream,pui8InBuf,ui32InBuffSize);
IMG_UINT32 IMG_CALLCONV DBGDrivWriteCM(PDBG_STREAM psStream,IMG_UINT8 * pui8InBuf,IMG_UINT32 ui32InBuffSize,IMG_UINT32 ui32Level)
{
-
+
if (!StreamValidForWrite(psStream))
{
return(0xFFFFFFFFUL);
}
-
+
if (psStream->psCtrl->ui32CapMode & DEBUG_CAPMODE_FRAMED)
{
if ((psStream->psCtrl->ui32Flags & DEBUG_FLAGS_ENABLESAMPLE) == 0)
{
-
+
return(ui32InBuffSize);
}
}
{
if ((psStream->psCtrl->ui32Current != g_ui32HotKeyFrame) || (g_bHotKeyPressed == IMG_FALSE))
{
-
+
return(ui32InBuffSize);
}
}
DBG_STREAM *psStream;
PVR_UNREFERENCED_PARAMETER(ui32Level);
-
+
if (!StreamValidForWrite(psMainStream))
{
return(0xFFFFFFFFUL);
}
-
+
psStream = psMainStream->psInitStream;
if(psStream->bCircularAllowed == IMG_TRUE)
{
{
DBG_STREAM *psStream;
-
+
if (!StreamValidForWrite(psMainStream))
{
return(0xFFFFFFFFUL);
}
-
+
if ((psMainStream->psCtrl->ui32DebugLevel & ui32Level) == 0)
{
IMG_UINT32 ui32Data;
DBG_STREAM *psStream;
-
+
if (!StreamValidForRead(psMainStream))
{
psStream = psMainStream;
}
-
+
if (psStream->ui32RPtr == psStream->ui32WPtr ||
((psStream->ui32InitPhaseWOff > 0) &&
(psStream->ui32RPtr >= psStream->ui32InitPhaseWOff)) )
return(0);
}
-
+
if (psStream->ui32RPtr <= psStream->ui32WPtr)
{
ui32Data = psStream->ui32WPtr + (psStream->ui32Size - psStream->ui32RPtr);
}
-
+
if ((psStream->ui32InitPhaseWOff > 0) &&
(psStream->ui32InitPhaseWOff < psStream->ui32WPtr))
ui32Data = psStream->ui32InitPhaseWOff - psStream->ui32RPtr;
}
-
+
if (ui32Data > ui32OutBuffSize)
{
psStream->ui32RPtr,
psStream->ui32WPtr));
-
+
if ((psStream->ui32RPtr + ui32Data) > psStream->ui32Size)
- {
+ {
IMG_UINT32 ui32B1 = psStream->ui32Size - psStream->ui32RPtr;
IMG_UINT32 ui32B2 = ui32Data - ui32B1;
-
+
HostMemCopy((IMG_VOID *) pui8OutBuf,
(IMG_VOID *)((IMG_UINTPTR_T)psStream->pvBase + psStream->ui32RPtr),
ui32B1);
-
+
HostMemCopy((IMG_VOID *)(pui8OutBuf + ui32B1),
psStream->pvBase,
ui32B2);
-
+
psStream->ui32RPtr = ui32B2;
}
else
- {
+ {
HostMemCopy((IMG_VOID *) pui8OutBuf,
(IMG_VOID *)((IMG_UINTPTR_T)psStream->pvBase + psStream->ui32RPtr),
ui32Data);
-
+
psStream->ui32RPtr += ui32Data;
-
+
if (psStream->ui32RPtr == psStream->ui32Size)
{
psStream->ui32RPtr = 0;
void IMG_CALLCONV DBGDrivSetCaptureMode(PDBG_STREAM psStream,IMG_UINT32 ui32Mode,IMG_UINT32 ui32Start,IMG_UINT32 ui32End,IMG_UINT32 ui32SampleRate)
{
-
+
if (!StreamValid(psStream))
{
psStream->psCtrl->ui32End = ui32End;
psStream->psCtrl->ui32SampleRate = ui32SampleRate;
-
+
if (psStream->psCtrl->ui32CapMode & DEBUG_CAPMODE_HOTKEY)
{
void IMG_CALLCONV DBGDrivSetOutputMode(PDBG_STREAM psStream,IMG_UINT32 ui32OutMode)
{
-
+
if (!StreamValid(psStream))
{
void IMG_CALLCONV DBGDrivSetDebugLevel(PDBG_STREAM psStream,IMG_UINT32 ui32DebugLevel)
{
-
+
if (!StreamValid(psStream))
{
void IMG_CALLCONV DBGDrivSetFrame(PDBG_STREAM psStream,IMG_UINT32 ui32Frame)
{
-
+
if (!StreamValid(psStream))
{
}
}
-
+
if (g_bHotKeyRegistered)
{
g_bHotKeyRegistered = IMG_FALSE;
if (!g_bHotKeyPressed)
{
-
+
g_ui32HotKeyFrame = psStream->psCtrl->ui32Current + 2;
-
+
g_bHotKeyPressed = IMG_TRUE;
}
+
-
- if (((psStream->psCtrl->ui32CapMode & DEBUG_CAPMODE_FRAMED) != 0) &&
+ if (((psStream->psCtrl->ui32CapMode & DEBUG_CAPMODE_FRAMED) != 0) &&
((psStream->psCtrl->ui32CapMode & DEBUG_CAPMODE_HOTKEY) != 0))
{
if (!g_bHotkeyMiddump)
{
-
+
g_ui32HotkeyMiddumpStart = g_ui32HotKeyFrame + 1;
g_ui32HotkeyMiddumpEnd = 0xffffffff;
g_bHotkeyMiddump = IMG_TRUE;
}
else
{
-
+
g_ui32HotkeyMiddumpEnd = g_ui32HotKeyFrame;
PVR_DPF((PVR_DBG_MESSAGE,"Turning off sampling\n"));
}
}
-
+
if (psStream->psCtrl->ui32Current > g_ui32HotKeyFrame)
{
IMG_UINT32 IMG_CALLCONV DBGDrivGetFrame(PDBG_STREAM psStream)
{
-
+
if (!StreamValid(psStream))
{
{
IMG_UINT32 ui32NextFrame;
-
+
if (!StreamValid(psStream))
{
{
IMG_UINT32 ui32FrameShift = bCheckPreviousFrame ? 1UL : 0UL;
-
+
if (!StreamValid(psStream))
{
if (psStream->psCtrl->ui32CapMode & DEBUG_CAPMODE_FRAMED)
{
-
+
if (g_bHotkeyMiddump)
{
if ((psStream->psCtrl->ui32Current >= (g_ui32HotkeyMiddumpStart - ui32FrameShift)) &&
void IMG_CALLCONV DBGDrivOverrideMode(PDBG_STREAM psStream,IMG_UINT32 ui32Mode)
{
-
+
if (!StreamValid(psStream))
{
void IMG_CALLCONV DBGDrivDefaultMode(PDBG_STREAM psStream)
{
-
+
if (!StreamValid(psStream))
{
IMG_VOID IMG_CALLCONV DBGDrivSetClientMarker(PDBG_STREAM psStream, IMG_UINT32 ui32Marker)
{
-
+
if (!StreamValid(psStream))
{
void IMG_CALLCONV DBGDrivSetMarker(PDBG_STREAM psStream, IMG_UINT32 ui32Marker)
{
-
+
if (!StreamValid(psStream))
{
IMG_UINT32 IMG_CALLCONV DBGDrivGetMarker(PDBG_STREAM psStream)
{
-
+
if (!StreamValid(psStream))
{
{
PDBG_STREAM psStream;
-
+
if (!StreamValid(psMainStream))
{
{
PDBG_STREAM psStream;
-
+
if (!StreamValid(psMainStream))
{
{
PDBG_LASTFRAME_BUFFER psLFBuffer;
-
+
if (!StreamValidForWrite(psStream))
{
return(0xFFFFFFFFUL);
}
-
+
if ((psStream->psCtrl->ui32DebugLevel & ui32Level) == 0)
{
return(0xFFFFFFFFUL);
}
-
+
if ((psStream->psCtrl->ui32CapMode & DEBUG_CAPMODE_FRAMED) != 0)
{
if ((psStream->psCtrl->ui32Flags & DEBUG_FLAGS_ENABLESAMPLE) == 0)
{
-
+
return(ui32InBuffSize);
}
}
{
if ((psStream->psCtrl->ui32Current != g_ui32HotKeyFrame) || (g_bHotKeyPressed == IMG_FALSE))
{
-
+
return(ui32InBuffSize);
}
}
if (ui32Flags & WRITELF_FLAGS_RESETBUF)
{
-
+
ui32InBuffSize = (ui32InBuffSize > LAST_FRAME_BUF_SIZE) ? LAST_FRAME_BUF_SIZE : ui32InBuffSize;
HostMemCopy((IMG_VOID *)psLFBuffer->ui8Buffer, (IMG_VOID *)pui8InBuf, ui32InBuffSize);
}
else
{
-
+
ui32InBuffSize = ((psLFBuffer->ui32BufLen + ui32InBuffSize) > LAST_FRAME_BUF_SIZE) ? (LAST_FRAME_BUF_SIZE - psLFBuffer->ui32BufLen) : ui32InBuffSize;
HostMemCopy((IMG_VOID *)(&psLFBuffer->ui8Buffer[psLFBuffer->ui32BufLen]), (IMG_VOID *)pui8InBuf, ui32InBuffSize);
PDBG_LASTFRAME_BUFFER psLFBuffer;
IMG_UINT32 ui32Data;
-
+
if (!StreamValidForRead(psStream))
{
psLFBuffer = FindLFBuf(psStream);
-
+
ui32Data = (ui32OutBuffSize < psLFBuffer->ui32BufLen) ? ui32OutBuffSize : psLFBuffer->ui32BufLen;
-
+
HostMemCopy((IMG_VOID *)pui8OutBuf, (IMG_VOID *)psLFBuffer->ui8Buffer, ui32Data);
IMG_UINT32 ui32NewROffset;
IMG_UINT32 ui32SpaceInOldBuf;
-
+
if (psStream->ui32Size >= ui32NewSize)
{
return IMG_FALSE;
}
-
+
ui32SpaceInOldBuf = SpaceInStream(psStream);
-
+
ui32NewSizeInPages = ((ui32NewSize + 0xfffUL) & ~0xfffUL) / 4096UL;
if(psStream->bCircularAllowed)
{
-
+
if (psStream->ui32RPtr <= psStream->ui32WPtr)
{
-
+
HostMemCopy(pvNewBuf,
(IMG_VOID *)((IMG_UINTPTR_T)psStream->pvBase + psStream->ui32RPtr),
else
{
IMG_UINT32 ui32FirstCopySize;
-
-
+
+
ui32FirstCopySize = psStream->ui32Size - psStream->ui32RPtr;
-
+
HostMemCopy(pvNewBuf,
(IMG_VOID *)((IMG_UINTPTR_T)psStream->pvBase + psStream->ui32RPtr),
ui32FirstCopySize);
-
-
+
+
HostMemCopy((IMG_VOID *)((IMG_UINTPTR_T)pvNewBuf + ui32FirstCopySize),
(IMG_VOID *)(IMG_PBYTE)psStream->pvBase,
}
else
{
-
+
HostMemCopy(pvNewBuf, psStream->pvBase, psStream->ui32WPtr);
ui32NewROffset = psStream->ui32RPtr;
}
+
-
-
+
ui32NewWOffset = psStream->ui32Size - ui32SpaceInOldBuf;
-
+
if ((psStream->psCtrl->ui32Flags & DEBUG_FLAGS_USE_NONPAGED_MEM) != 0)
{
HostPageablePageFree(psStream->pvBase);
}
-
+
psStream->pvBase = pvNewBuf;
psStream->ui32RPtr = ui32NewROffset;
if (psStream->bCircularAllowed)
{
-
+
if (psStream->ui32RPtr > psStream->ui32WPtr)
{
ui32Space = psStream->ui32RPtr - psStream->ui32WPtr;
}
else
{
-
+
ui32Space = psStream->ui32Size - psStream->ui32WPtr;
}
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
IMG_VOID MonoOut(IMG_CHAR * pszString,IMG_BOOL bNewLine);
IMG_SID PStream2SID(PDBG_STREAM psStream);
-PDBG_STREAM SID2PStream(IMG_SID hStream);
+PDBG_STREAM SID2PStream(IMG_SID hStream);
IMG_BOOL AddSIDEntry(PDBG_STREAM psStream);
IMG_BOOL RemoveSIDEntry(PDBG_STREAM psStream);
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
{
if (psStream == gaSID_Xlat_Table[iIdx].psStream)
{
-
+
return (IMG_SID)iIdx+1;
}
}
PDBG_STREAM SID2PStream(IMG_SID hStream)
{
-
+
IMG_INT32 iIdx = (IMG_INT32)hStream-1;
if (iIdx >= 0 && iIdx < MAX_SID_ENTRIES)
{
if (psStream == gaSID_Xlat_Table[iIdx].psStream)
{
-
+
return IMG_TRUE;
}
if (gaSID_Xlat_Table[iIdx].psStream == (PDBG_STREAM)IMG_NULL)
{
-
+
gaSID_Xlat_Table[iIdx].psStream = psStream;
return IMG_TRUE;
}
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
IMG_VOID HostWaitForEvent(DBG_EVENT eEvent);
IMG_VOID HostSignalEvent(DBG_EVENT eEvent);
IMG_VOID HostDestroyEventObjects(IMG_VOID);
-#endif
+#endif
#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
IMG_VOID ReadInHotKeys(IMG_VOID)
{
- g_PrivateHotKeyData.ui32ScanCode = 0x58;
+ g_PrivateHotKeyData.ui32ScanCode = 0x58;
g_PrivateHotKeyData.ui32ShiftState = 0x0;
-
+
#if 0
if (_RegOpenKey(HKEY_LOCAL_MACHINE,pszRegPath,&hKey) == ERROR_SUCCESS)
{
-
+
QueryReg(hKey,"ui32ScanCode",&g_PrivateHotKeyData.ui32ScanCode);
QueryReg(hKey,"ui32ShiftState",&g_PrivateHotKeyData.ui32ShiftState);
if (!g_bHotKeyPressed)
{
-
+
g_ui32HotKeyFrame = psStream->psCtrl->ui32Current + 2;
-
+
g_bHotKeyPressed = IMG_TRUE;
}
IMG_VOID ActivateHotKeys(PDBG_STREAM psStream)
{
-
+
ReadInHotKeys();
-
+
if (!g_PrivateHotKeyData.sHotKeyInfo.hHotKey)
{
{
PVR_DPF((PVR_DBG_MESSAGE,"Activate HotKey for PDUMP.\n"));
-
+
g_PrivateHotKeyData.sHotKeyInfo.pvStream = psStream;
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
IMG_UINT32 ui32ShiftState;
IMG_UINT32 ui32HotKeyProc;
IMG_VOID *pvStream;
- IMG_UINT32 hHotKey;
+ IMG_UINT32 hHotKey;
} HOTKEYINFO, *PHOTKEYINFO;
typedef struct _privatehotkeydata
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#ifdef LINUX
#include <asm/uaccess.h>
-#endif
+#endif
#include "img_types.h"
#include "dbgdrvif.h"
}
else
{
-
+
*pui32OutLen = 0;
return(IMG_FALSE);
}
}
else
{
-
+
*pui32OutLen = 0;
return(IMG_FALSE);
}
}
else
{
-
+
*pui32OutLen = 0;
return(IMG_FALSE);
}
}
else
{
-
+
*pui32BytesCopied = 0;
return(IMG_FALSE);
}
}
else
{
-
+
*pui32BytesCopied = 0;
return(IMG_FALSE);
}
}
else
{
-
+
*pui32BytesCopied = 0;
return(IMG_FALSE);
}
}
else
{
-
+
*pui32BytesCopied = 0;
return(IMG_FALSE);
}
}
else
{
-
+
return(IMG_FALSE);
}
}
}
else
{
-
+
return(IMG_FALSE);
}
}
}
else
{
-
+
return(IMG_FALSE);
}
}
}
else
{
-
+
return(IMG_FALSE);
}
}
pui32Current = (IMG_UINT32 *) pvOutBuffer;
psStream = SID2PStream(*(IMG_SID *)pvInBuffer);
-
+
if (psStream != (PDBG_STREAM)IMG_NULL)
{
*pui32Current = ExtDBGDrivGetFrame(psStream);
}
else
{
-
+
*pui32Current = 0;
return(IMG_FALSE);
}
}
else
{
-
+
*pui32Current = 0;
return(IMG_FALSE);
}
}
else
{
-
+
return(IMG_FALSE);
}
}
}
else
{
-
+
return(IMG_FALSE);
}
}
}
else
{
-
+
return(IMG_FALSE);
}
}
}
else
{
-
+
*pui32Current = 0;
return(IMG_FALSE);
}
}
else
{
-
+
return(IMG_FALSE);
}
}
}
else
{
-
+
*pui32BytesCopied = 0;
return(IMG_FALSE);
}
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#include <linux/wait.h>
#include <linux/jiffies.h>
#include <linux/delay.h>
-#endif
+#endif
#include "img_types.h"
#include "pvr_debug.h"
{
pszFileName = pszLeafName;
}
-#endif
+#endif
bTrace = (IMG_BOOL)(ui32DebugLevel & DBGPRIV_CALLTRACE) ? IMG_TRUE : IMG_FALSE;
char *szBufferEnd = szBuffer;
char *szBufferLimit = szBuffer + sizeof(szBuffer) - 1;
-
+
*szBufferLimit = '\0';
snprintf(szBufferEnd, szBufferLimit - szBufferEnd, "PVR_K:");
szBufferEnd += strlen(szBufferEnd);
-
+
if (bTrace == IMG_FALSE)
{
switch(ui32DebugLevel)
va_end (vaArgs);
szBufferEnd += strlen(szBufferEnd);
-
+
if (bTrace == IMG_FALSE)
{
- snprintf(szBufferEnd, szBufferLimit - szBufferEnd,
+ snprintf(szBufferEnd, szBufferLimit - szBufferEnd,
" [%d, %s]", (int)ui32Line, pszFileName);
szBufferEnd += strlen(szBufferEnd);
}
printk(KERN_INFO "%s\r\n", szBuffer);
}
}
-#endif
+#endif
IMG_VOID HostMemSet(IMG_VOID *pvDest, IMG_UINT8 ui8Value, IMG_UINT32 ui32Size)
{
IMG_UINT32 HostReadRegistryDWORDFromString(char *pcKey, char *pcValueName, IMG_UINT32 *pui32Data)
{
-
+
return 0;
}
IMG_VOID * HostMapKrnBufIntoUser(IMG_VOID * pvKrnAddr, IMG_UINT32 ui32Size, IMG_VOID **ppvMdl)
{
-
+
return IMG_NULL;
}
IMG_VOID HostUnMapKrnBufFromUser(IMG_VOID * pvUserAddr, IMG_VOID * pvMdl, IMG_VOID * pvProcess)
{
-
+
}
IMG_VOID HostCreateRegDeclStreams(IMG_VOID)
{
-
+
}
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
switch(eEvent)
{
case DBG_EVENT_STREAM_DATA:
-
+
wait_event_interruptible_timeout(sStreamDataEvent, iStreamData != 0, EVENT_WAIT_TIMEOUT_JIFFIES);
iStreamData = 0;
break;
default:
-
+
msleep_interruptible(EVENT_WAIT_TIMEOUT_MS);
break;
}
IMG_VOID HostDestroyEventObjects(IMG_VOID)
{
}
-#endif
+#endif
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ *
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#include "pvr_drm_shared.h"
#include "pvr_drm.h"
-#else
+#else
#define DRVNAME "dbgdrv"
MODULE_SUPPORTED_DEVICE(DRVNAME);
.mmap = dbgdrv_mmap,
};
-#endif
+#endif
IMG_VOID DBGDrvGetServiceTable(IMG_VOID **fn_table);
class_destroy(psDbgDrvClass);
#endif
unregister_chrdev(AssignedMajorNumber, DRVNAME);
-#endif
+#endif
#if defined(SUPPORT_DBGDRV_EVENT_OBJECTS)
HostDestroyEventObjects();
#endif
int err = -EBUSY;
#endif
-
+
if ((g_pvAPIMutex=HostCreateMutex()) == IMG_NULL)
{
return -ENOMEM;
}
#if defined(SUPPORT_DBGDRV_EVENT_OBJECTS)
-
+
(void) HostCreateEventObjects();
#endif
}
#if defined(LDM_PLATFORM) || defined(LDM_PCI)
-
+
psDbgDrvClass = class_create(THIS_MODULE, DRVNAME);
if (IS_ERR(psDbgDrvClass))
{
__func__, PTR_ERR(psDev)));
goto ErrDestroyClass;
}
-#endif
-#endif
+#endif
+#endif
return 0;
class_destroy(psDbgDrvClass);
#endif
return err;
-#endif
+#endif
}
#if defined(SUPPORT_DRI_DRM)
goto init_failed;
}
-
+
cmd = MAKEIOCTLINDEX(pIP->ui32Cmd) - DEBUG_SERVICE_IOCTL_BASE - 1;
if(pIP->ui32Cmd == DEBUG_SERVICE_READ)