~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to drivers/gpu/pvr/sgx/sgxutils.h

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**********************************************************************
 
2
 *
 
3
 * Copyright (C) Imagination Technologies Ltd. All rights reserved.
 
4
 * 
 
5
 * This program is free software; you can redistribute it and/or modify it
 
6
 * under the terms and conditions of the GNU General Public License,
 
7
 * version 2, as published by the Free Software Foundation.
 
8
 * 
 
9
 * This program is distributed in the hope it will be useful but, except 
 
10
 * as otherwise stated in writing, without any warranty; without even the 
 
11
 * implied warranty of merchantability or fitness for a particular purpose. 
 
12
 * See the GNU General Public License for more details.
 
13
 * 
 
14
 * You should have received a copy of the GNU General Public License along with
 
15
 * this program; if not, write to the Free Software Foundation, Inc.,
 
16
 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
 
17
 * 
 
18
 * The full GNU General Public License is included in this distribution in
 
19
 * the file called "COPYING".
 
20
 *
 
21
 * Contact Information:
 
22
 * Imagination Technologies Ltd. <gpl-support@imgtec.com>
 
23
 * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
 
24
 *
 
25
 ******************************************************************************/
 
26
 
 
27
#include "perproc.h"
 
28
#include "sgxinfokm.h"
 
29
 
 
30
 
 
31
#define CCB_OFFSET_IS_VALID(type, psCCBMemInfo, psCCBKick, offset) \
 
32
        ((sizeof(type) <= (psCCBMemInfo)->uAllocSize) && \
 
33
        ((psCCBKick)->offset <= (psCCBMemInfo)->uAllocSize - sizeof(type)))
 
34
 
 
35
#define CCB_DATA_FROM_OFFSET(type, psCCBMemInfo, psCCBKick, offset) \
 
36
        ((type *)(((IMG_CHAR *)(psCCBMemInfo)->pvLinAddrKM) + \
 
37
                (psCCBKick)->offset))
 
38
 
 
39
 
 
40
IMG_IMPORT
 
41
IMG_VOID SGXTestActivePowerEvent(PVRSRV_DEVICE_NODE     *psDeviceNode,
 
42
                                                                 IMG_UINT32                     ui32CallerID);
 
43
 
 
44
IMG_IMPORT
 
45
PVRSRV_ERROR SGXScheduleCCBCommand(PVRSRV_DEVICE_NODE   *psDeviceNode,
 
46
                                                                   SGXMKIF_CMD_TYPE             eCommandType,
 
47
                                                                   SGXMKIF_COMMAND              *psCommandData,
 
48
                                                                   IMG_UINT32                   ui32CallerID,
 
49
                                                                   IMG_UINT32                   ui32PDumpFlags,
 
50
                                                                   IMG_HANDLE                   hDevMemContext,
 
51
                                                                   IMG_BOOL                             bLastInScene);
 
52
IMG_IMPORT
 
53
PVRSRV_ERROR SGXScheduleCCBCommandKM(PVRSRV_DEVICE_NODE         *psDeviceNode,
 
54
                                                                         SGXMKIF_CMD_TYPE               eCommandType,
 
55
                                                                         SGXMKIF_COMMAND                *psCommandData,
 
56
                                                                         IMG_UINT32                             ui32CallerID,
 
57
                                                                         IMG_UINT32                             ui32PDumpFlags,
 
58
                                                                         IMG_HANDLE                             hDevMemContext,
 
59
                                                                         IMG_BOOL                               bLastInScene);
 
60
 
 
61
IMG_IMPORT
 
62
PVRSRV_ERROR SGXScheduleProcessQueuesKM(PVRSRV_DEVICE_NODE *psDeviceNode);
 
63
 
 
64
IMG_IMPORT
 
65
IMG_BOOL SGXIsDevicePowered(PVRSRV_DEVICE_NODE *psDeviceNode);
 
66
 
 
67
IMG_IMPORT
 
68
IMG_HANDLE SGXRegisterHWRenderContextKM(IMG_HANDLE                              psDeviceNode,
 
69
                                                                                IMG_DEV_VIRTADDR                *psHWRenderContextDevVAddr,
 
70
                                                                                PVRSRV_PER_PROCESS_DATA *psPerProc);
 
71
 
 
72
IMG_IMPORT
 
73
IMG_HANDLE SGXRegisterHWTransferContextKM(IMG_HANDLE                            psDeviceNode,
 
74
                                                                                  IMG_DEV_VIRTADDR                      *psHWTransferContextDevVAddr,
 
75
                                                                                  PVRSRV_PER_PROCESS_DATA       *psPerProc);
 
76
 
 
77
IMG_IMPORT
 
78
PVRSRV_ERROR SGXFlushHWRenderTargetKM(IMG_HANDLE psSGXDevInfo,
 
79
                                                                          IMG_DEV_VIRTADDR psHWRTDataSetDevVAddr,
 
80
                                                                          IMG_BOOL bForceCleanup);
 
81
 
 
82
IMG_IMPORT
 
83
PVRSRV_ERROR SGXUnregisterHWRenderContextKM(IMG_HANDLE hHWRenderContext, IMG_BOOL bForceCleanup);
 
84
 
 
85
IMG_IMPORT
 
86
PVRSRV_ERROR SGXUnregisterHWTransferContextKM(IMG_HANDLE hHWTransferContext, IMG_BOOL bForceCleanup);
 
87
 
 
88
#if defined(SGX_FEATURE_2D_HARDWARE)
 
89
IMG_IMPORT
 
90
IMG_HANDLE SGXRegisterHW2DContextKM(IMG_HANDLE                          psDeviceNode,
 
91
                                                                        IMG_DEV_VIRTADDR                *psHW2DContextDevVAddr,
 
92
                                                                        PVRSRV_PER_PROCESS_DATA *psPerProc);
 
93
 
 
94
IMG_IMPORT
 
95
PVRSRV_ERROR SGXUnregisterHW2DContextKM(IMG_HANDLE hHW2DContext, IMG_BOOL bForceCleanup);
 
96
#endif
 
97
 
 
98
IMG_UINT32 SGXConvertTimeStamp(PVRSRV_SGXDEV_INFO       *psDevInfo,
 
99
                                                           IMG_UINT32                   ui32TimeWraps,
 
100
                                                           IMG_UINT32                   ui32Time);
 
101
 
 
102
PVRSRV_ERROR SGXCleanupRequest(PVRSRV_DEVICE_NODE       *psDeviceNode,
 
103
                                                        IMG_DEV_VIRTADDR        *psHWDataDevVAddr,
 
104
                                                        IMG_UINT32                      ui32CleanupType,
 
105
                                                        IMG_BOOL                        bForceCleanup);
 
106
 
 
107
IMG_IMPORT
 
108
PVRSRV_ERROR PVRSRVGetSGXRevDataKM(PVRSRV_DEVICE_NODE* psDeviceNode, IMG_UINT32 *pui32SGXCoreRev,
 
109
                                IMG_UINT32 *pui32SGXCoreID);
 
110
 
 
111
PVRSRV_ERROR SGXContextSuspend(PVRSRV_DEVICE_NODE       *psDeviceNode,
 
112
                                                           IMG_DEV_VIRTADDR             *psHWContextDevVAddr,
 
113
                                                           IMG_BOOL                             bResume);
 
114