author | Matt Plumtree <matt.plumtree@nokia.com> |
Mon, 08 Nov 2010 15:40:06 +0000 | |
branch | bug235_bringup_0 |
changeset 74 | 4ba73111e824 |
parent 71 | 243bbc1d70db |
permissions | -rw-r--r-- |
24 | 1 |
// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
2 |
// All rights reserved. |
|
3 |
// This component and the accompanying materials are made available |
|
4 |
// under the terms of "Eclipse Public License v1.0" |
|
5 |
// which accompanies this distribution, and is available |
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 |
// |
|
8 |
// Initial Contributors: |
|
9 |
// Nokia Corporation - initial contribution. |
|
10 |
// |
|
11 |
// Contributors: |
|
12 |
// |
|
13 |
// Description: |
|
14 |
// |
|
15 |
||
16 |
#ifndef KHRONOSAPIWRAPPER_H |
|
17 |
#define KHRONOSAPIWRAPPER_H |
|
18 |
||
19 |
#ifndef PSU_PLATFORMTHREADING_H |
|
20 |
#include "platformthreading.h" |
|
21 |
#endif |
|
22 |
||
23 |
#ifndef PSU_PLATFORMTYPES_H |
|
24 |
#include "platformtypes.h" |
|
25 |
#endif |
|
26 |
||
27 |
#include "requestbuffer.h" |
|
28 |
||
29 |
class APIWrapperStack; |
|
30 |
class RemoteFunctionCall; |
|
31 |
class RemoteFunctionCallData; |
|
32 |
class DriverAPIWrapper; |
|
33 |
class OpenVGAPIWrapper; |
|
34 |
class EGLAPIWrapper; |
|
35 |
class OGLES11Wrapper; |
|
36 |
||
37 |
#define KHRONOS_API_W_MULTITHREAD |
|
38 |
||
39 |
#ifdef WIN32 |
|
40 |
#ifdef KHRONOSAPIWRAPPER_EXPORTS |
|
41 |
#define KHRONOSAPIWRAPPER_API __declspec(dllexport) |
|
42 |
#else |
|
43 |
#define KHRONOSAPIWRAPPER_API __declspec(dllimport) |
|
44 |
#endif |
|
45 |
#else |
|
46 |
#define KHRONOSAPIWRAPPER_API |
|
47 |
#endif |
|
48 |
||
49 |
class MGraphicsVHWCallback; |
|
74
4ba73111e824
Provide alternative constructor for Nokia internal use (PlatSim compatibility).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
71
diff
changeset
|
50 |
class protocol_MGraphicsVHWCallback; |
24 | 51 |
|
52 |
class KHRONOSAPIWRAPPER_API KhronosAPIWrapper: private MRequestBufferBookKeepingReader |
|
53 |
{ |
|
54 |
public: |
|
55 |
||
30
f204b762818d
Rename use of "frame" buffer to "surface" buffer, to reduce confusion.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
24
diff
changeset
|
56 |
KhronosAPIWrapper( MGraphicsVHWCallback* aServiceIf, void* surfacebuffer, |
24 | 57 |
void* inputdata, void* outputdata ); |
74
4ba73111e824
Provide alternative constructor for Nokia internal use (PlatSim compatibility).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
71
diff
changeset
|
58 |
KhronosAPIWrapper( protocol_MGraphicsVHWCallback* aServiceIf, void* surfacebuffer, |
4ba73111e824
Provide alternative constructor for Nokia internal use (PlatSim compatibility).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
71
diff
changeset
|
59 |
void* inputdata, void* outputdata ); |
71
243bbc1d70db
Expose wrapper C interface for Syborg from KhronosAPIWrapper. Needs update to QEMU!
Matt Plumtree <matt.plumtree@nokia.com>
parents:
53
diff
changeset
|
60 |
virtual ~KhronosAPIWrapper(); |
24 | 61 |
|
62 |
void WorkerThread(); |
|
63 |
||
64 |
unsigned long Execute(); |
|
65 |
unsigned long InputParameterOffset(); |
|
66 |
||
67 |
void SetInputBufferTail(uint32_t p_val); |
|
68 |
uint32_t InputBufferTail(); |
|
69 |
void SetInputBufferHead(uint32_t p_val); |
|
70 |
uint32_t InputBufferHead(); |
|
71 |
void SetInputBufferReadCount(uint32_t p_val); |
|
72 |
uint32_t InputBufferReadCount(); |
|
73 |
void SetInputBufferWriteCount(uint32_t p_val); |
|
74 |
uint32_t InputBufferWriteCount(); |
|
75 |
void IncrementInputBufferReadCount( TUint32 aReadCount ); |
|
76 |
TUint32 InputMaxTailIndex(); |
|
77 |
void SetInputMaxTailIndex( TUint32 aIndex ); |
|
78 |
||
79 |
//For the purpose of wrappers that need each other's services |
|
80 |
DriverAPIWrapper* GetDriverWrapper() { return m_DriverAPIWrapper; } |
|
81 |
EGLAPIWrapper* GetEGLWrapper() { return m_EGLWrapper; } |
|
82 |
||
83 |
private: |
|
74
4ba73111e824
Provide alternative constructor for Nokia internal use (PlatSim compatibility).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
71
diff
changeset
|
84 |
void Construct( MGraphicsVHWCallback* aServiceIf, void* surfacebuffer, |
4ba73111e824
Provide alternative constructor for Nokia internal use (PlatSim compatibility).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
71
diff
changeset
|
85 |
void* inputdata, void* outputdata ); |
24 | 86 |
//From MRequestBufferBookKeeping |
87 |
TUint32 GetWriteCount(); |
|
88 |
void IncrementReadCount( TUint32 aReadCount ); |
|
89 |
TUint32 GetReadCount(); |
|
90 |
||
91 |
TUint32 BufferTail(); |
|
92 |
void SetBufferTail( TUint32 aIndex ); |
|
93 |
TUint32 BufferHead(); |
|
94 |
||
95 |
TUint32 MaxTailIndex(); |
|
96 |
void SetMaxTailIndex( TUint32 aIndex ); |
|
97 |
||
98 |
protected: |
|
99 |
int HandleNextRequest(); |
|
100 |
bool m_initDone; |
|
101 |
void* m_currentResult; |
|
102 |
void* m_currentInput; |
|
103 |
MGraphicsVHWCallback* iServiceIf; |
|
104 |
Psu::PLATFORM_THREAD_T m_threadHandle; |
|
105 |
Psu::PLATFORM_SEMAPHORE_T m_SemapHandle; |
|
106 |
bool m_exit; |
|
30
f204b762818d
Rename use of "frame" buffer to "surface" buffer, to reduce confusion.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
24
diff
changeset
|
107 |
void* m_surfaceBuffer; |
24 | 108 |
|
109 |
//Input buffer |
|
110 |
Psu::PLATFORM_MUTEX_T m_InputBufferMutex; |
|
111 |
uint32_t m_InputBufferTail; |
|
112 |
uint32_t m_InputBufferHead; |
|
113 |
uint32_t m_InputBufferReadCount; |
|
114 |
uint32_t m_InputbufferWriteCount; |
|
115 |
uint32_t m_InputBufferMaxTailIndex; |
|
116 |
private: |
|
117 |
RequestBufferReader* m_InputRequestBuffer; |
|
118 |
APIWrapperStack* iStack; |
|
119 |
TUint32 m_lastProcessId; |
|
120 |
TUint32 m_lastThreadId; |
|
121 |
int m_lastVgError; |
|
122 |
int m_lastEglError; |
|
123 |
DriverAPIWrapper* m_DriverAPIWrapper; |
|
124 |
OpenVGAPIWrapper* m_OpenVGWrapper; |
|
125 |
OGLES11Wrapper* m_OGLESWrapper; |
|
126 |
EGLAPIWrapper* m_EGLWrapper; |
|
127 |
||
128 |
RemoteFunctionCallData* iRFCData; |
|
129 |
}; |
|
130 |
#endif |