guestrendering/guestvideodriver/ldd/src/virtualvideohwchannel.cpp
branchbug235_bringup_0
changeset 2 e8ccf068ac7f
parent 1 d8d95053303a
child 4 e6f11c873cdf
equal deleted inserted replaced
1:d8d95053303a 2:e8ccf068ac7f
    15  *  information which may not be disclosed to others without the
    15  *  information which may not be disclosed to others without the
    16  *  prior written consent of Nokia.
    16  *  prior written consent of Nokia.
    17  * =============================================================================
    17  * =============================================================================
    18  */
    18  */
    19 
    19 
    20 // INCLUDE FILES
       
    21 #include <kernel/kernel.h>
    20 #include <kernel/kernel.h>
    22 #include <assp.h>
    21 #include <assp.h>
    23 
    22 
    24 #include "virtualvideohwchannel.h"
    23 #include <graphics/virtualvideohwchannel.h>
    25 #include "virtualvideohwdeviceinterface.h"
    24 #include <graphics/virtualvideohwdeviceinterface.h>
    26 #include "platsimvideodriverprotocol.h"
    25 #include <graphics/guestvideodriverprotocol.h>
    27 #include "platsimvideodrivercommon.h"
    26 #include <graphics/guestvideodrivercommon.h>
    28 #include "devicereqhandler.h"
    27 #include <graphics/devicereqhandler.h>
       
    28 
    29 #include "serializedfunctioncall.h"
    29 #include "serializedfunctioncall.h"
    30 
       
    31 
       
    32 // CONSTANTS
       
    33 // ============================ MEMBER FUNCTIONS ===============================
       
    34 
    30 
    35 // -----------------------------------------------------------------------------
    31 // -----------------------------------------------------------------------------
    36 // DVirtualVideoHwChannel::DVirtualVideoHwChannel
    32 // DVirtualVideoHwChannel::DVirtualVideoHwChannel
    37 // -----------------------------------------------------------------------------
    33 // -----------------------------------------------------------------------------
    38 //
    34 //
   111 // DVirtualVideoHwChannel::DoCreate
   107 // DVirtualVideoHwChannel::DoCreate
   112 // -----------------------------------------------------------------------------
   108 // -----------------------------------------------------------------------------
   113 //
   109 //
   114 TInt DVirtualVideoHwChannel::DoCreate( TInt /*aUnit*/, const TDesC* /*aInfo*/, const TVersion& aVer )
   110 TInt DVirtualVideoHwChannel::DoCreate( TInt /*aUnit*/, const TDesC* /*aInfo*/, const TVersion& aVer )
   115     {
   111     {
   116     using namespace PlatsimVideoDriver;
   112     using namespace GuestVideoDriver;
   117     TInt err = KErrNone;
   113     TInt err = KErrNone;
   118     
   114     
   119     if ( ! Kern::QueryVersionSupported(
   115     if ( ! Kern::QueryVersionSupported(
   120             TVersion(
   116             TVersion(
   121                     KMajorVer,
   117                     KMajorVer,
   139         TInt aReqNo,
   135         TInt aReqNo,
   140         TRequestStatus* aStatus,
   136         TRequestStatus* aStatus,
   141         TAny* a1,
   137         TAny* a1,
   142         TAny* a2 )
   138         TAny* a2 )
   143     {
   139     {
   144     using namespace PlatsimVideoDriver;
   140     using namespace GuestVideoDriver;
   145 
   141 
   146     // Default error condition
   142     // Default error condition
   147     TInt err = KErrNone; 
   143     TInt err = KErrNone; 
   148 
   144 
   149     switch( aReqNo )
   145     switch( aReqNo )
   174     return err;
   170     return err;
   175     }
   171     }
   176 
   172 
   177 
   173 
   178 
   174 
       
   175 #ifdef FAISALMEMON_S4_SGIMAGE
   179 TInt DVirtualVideoHwChannel::GetSgImageMetaData(TSgImageMetaData& aSgInfo, const TUint64 aId)
   176 TInt DVirtualVideoHwChannel::GetSgImageMetaData(TSgImageMetaData& aSgInfo, const TUint64 aId)
   180 	{
   177 	{
   181 	VVHW_TRACE("DVirtualVideoHwChannel::OpenSgImageMetaData 0x%lx", aId );
   178 	VVHW_TRACE("DVirtualVideoHwChannel::OpenSgImageMetaData 0x%lx", aId );
   182 	DSgResource* sgResource = NULL;
   179 	DSgResource* sgResource = NULL;
   183 	TInt metaDataErr = SgExtension::FindAndOpenResource( aId, sgResource );//Open the sgimage resource
   180 	TInt metaDataErr = SgExtension::FindAndOpenResource( aId, sgResource );//Open the sgimage resource
   194 
   191 
   195 		sgResource->Close();
   192 		sgResource->Close();
   196 		}
   193 		}
   197 	return metaDataErr;
   194 	return metaDataErr;
   198 	}
   195 	}
       
   196 #endif
   199 
   197 
   200 
   198 
   201 // -----------------------------------------------------------------------------
   199 // -----------------------------------------------------------------------------
   202 // DVirtualVideoHwChannel::DoControl
   200 // DVirtualVideoHwChannel::DoControl
   203 // -----------------------------------------------------------------------------
   201 // -----------------------------------------------------------------------------
   206         DThread*& aUserThread,
   204         DThread*& aUserThread,
   207         TInt aFunction,
   205         TInt aFunction,
   208         TAny* a1,
   206         TAny* a1,
   209         TAny* a2 )
   207         TAny* a2 )
   210     {
   208     {
   211     using namespace PlatsimVideoDriver;
   209     using namespace GuestVideoDriver;
   212     
   210     
   213     // Default error condition
   211     // Default error condition
   214     TInt err = KErrNone; 
   212     TInt err = KErrNone; 
   215 
   213 
   216     switch( aFunction )
   214     switch( aFunction )
   240                     err = KErrGeneral;
   238                     err = KErrGeneral;
   241                     }
   239                     }
   242                 }
   240                 }
   243             break;
   241             break;
   244             }
   242             }
       
   243 #ifdef FAISALMEMON_S4_SGIMAGE
   245         case ERequestSgHandles:
   244         case ERequestSgHandles:
   246             {
   245             {
   247             VVHW_TRACE("DVirtualVideoHwChannel::DoControl - ERequestSgHandles" );
   246             VVHW_TRACE("DVirtualVideoHwChannel::DoControl - ERequestSgHandles" );
   248             TPckgBuf<TUint64> sgId;
   247             TPckgBuf<TUint64> sgId;
   249             err = Kern::ThreadDesRead( aUserThread, a1, sgId, 0, 0 );
   248             err = Kern::ThreadDesRead( aUserThread, a1, sgId, 0, 0 );
   269             	{
   268             	{
   270 				VVHW_TRACE("DVirtualVideoHwChannel::DoControl - ThreadDesRead err=%i", err );
   269 				VVHW_TRACE("DVirtualVideoHwChannel::DoControl - ThreadDesRead err=%i", err );
   271                 }
   270                 }
   272             break;
   271             break;
   273             }
   272             }
       
   273 #endif
   274         default:
   274         default:
   275             {
   275             {
   276             // Other functions are not supported
   276             // Other functions are not supported
   277             err = KErrNotSupported;
   277             err = KErrNotSupported;
   278             }
   278             }