author | Gareth Stockwell <gareth.stockwell@accenture.com> |
Fri, 22 Oct 2010 11:59:21 +0100 | |
branch | bug235_bringup_0 |
changeset 208 | 7df094ed4a3f |
parent 185 | c4bff43bf8eb |
permissions | -rwxr-xr-x |
153
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
1 |
// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
2 |
// All rights reserved. |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
3 |
// This component and the accompanying materials are made available |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
4 |
// under the terms of "Eclipse Public License v1.0" |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
5 |
// which accompanies this distribution, and is available |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
7 |
// |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
8 |
// Initial Contributors: |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
9 |
// Nokia Corporation - initial contribution. |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
10 |
// |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
11 |
// Contributors: |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
12 |
// |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
13 |
// Description: |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
14 |
// Header file for guest video driver |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
15 |
|
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
16 |
#ifndef __GUESTVIDEODRIVER_H__ |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
17 |
#define __GUESTVIDEODRIVER_H__ |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
18 |
|
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
19 |
#include <e32cmn.h> |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
20 |
#include <e32std.h> |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
21 |
#include <babitflags.h> |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
22 |
|
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
23 |
#include "guestvideodrivercommon.h" |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
24 |
|
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
25 |
class RemoteFunctionCallData; |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
26 |
|
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
27 |
//Local request buffering size |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
28 |
const TInt KRequestBufferSize = 20000; |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
29 |
|
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
30 |
/** |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
31 |
* Guest video driver user API. One instance exists per process. |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
32 |
*/ |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
33 |
NONSHARABLE_CLASS(RGuestVideoDriver) : public RBusLogicalChannel |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
34 |
{ |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
35 |
public: |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
36 |
// Default constructor |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
37 |
IMPORT_C RGuestVideoDriver(); |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
38 |
|
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
39 |
// Destructor |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
40 |
IMPORT_C ~RGuestVideoDriver(); |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
41 |
|
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
42 |
/** |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
43 |
* Opens this driver handle. Calls RBusLogicalChannel::DoCreate. |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
44 |
* |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
45 |
* @return System wide error code |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
46 |
*/ |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
47 |
IMPORT_C TInt Open(); |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
48 |
|
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
49 |
/** |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
50 |
* Executes a command |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
51 |
* @param aRequestData Remote function call |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
52 |
*/ |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
53 |
IMPORT_C void ExecuteCommand(RemoteFunctionCallData& aRequestData); |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
54 |
|
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
55 |
/** |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
56 |
* Flushes any buffered commands. |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
57 |
*/ |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
58 |
IMPORT_C void Flush(); |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
59 |
|
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
60 |
IMPORT_C TInt MapToHWAddress( const TInt aChunkHandle, TUint32& aHWAddress ); |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
61 |
|
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
62 |
IMPORT_C TInt EglGetSgHandles( const TUint64 aId, TUint64 *aSgHandles ); |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
63 |
|
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
64 |
/** |
185
c4bff43bf8eb
Refactoring of frame buffer references to surface buffer
Matt Plumtree <matt.plumtree@nokia.com>
parents:
153
diff
changeset
|
65 |
* Gets Base Address of Surface Buffer |
153
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
66 |
* @param aHWAddress returned Base Address |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
67 |
* |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
68 |
* @note A base address of 0 is invalid, and indicates a failure to |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
69 |
* obtain the base address. |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
70 |
*/ |
185
c4bff43bf8eb
Refactoring of frame buffer references to surface buffer
Matt Plumtree <matt.plumtree@nokia.com>
parents:
153
diff
changeset
|
71 |
IMPORT_C TInt GetSurfaceBufferBaseAddress( TUint32& aHWAddress ); |
153
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
72 |
|
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
73 |
|
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
74 |
private: |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
75 |
/* |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
76 |
Buffer, or send if it needs a reply, a command to the virtual video hardware |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
77 |
@param aRFC Remote function call to buffer |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
78 |
@return ETrue if buffering succeeds, otherwise the aRFC needs to be executed directly |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
79 |
*/ |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
80 |
TBool BufferCommand( RemoteFunctionCallData& aRFC ); |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
81 |
|
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
82 |
// Sends buffered commands |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
83 |
void SendBuffer(); |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
84 |
|
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
85 |
private: |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
86 |
TBool iIsOpen; |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
87 |
RMutex iThreadLock; |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
88 |
/** |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
89 |
* Request buffer |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
90 |
*/ |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
91 |
TUint32 iProcessId; |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
92 |
TBuf8<KRequestBufferSize> iBuffer; |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
93 |
}; |
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
94 |
|
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
95 |
|
d8f29c307082
Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents:
146
diff
changeset
|
96 |
#endif // __GUESTVIDEODRIVER_H__ |