Display/display_chipset_api.inl
changeset 0 bb4b476bbb96
equal deleted inserted replaced
-1:000000000000 0:bb4b476bbb96
       
     1 /*
       
     2   display_chipset_api.inl
       
     3 
       
     4   Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     5   All rights reserved.
       
     6 
       
     7   This program and the accompanying materials are made available 
       
     8   under the terms of the Eclipse Public License v1.0 which accompanies 
       
     9   this distribution, and is available at 
       
    10   http://www.eclipse.org/legal/epl-v10.html
       
    11 
       
    12   Initial Contributors:
       
    13   Nokia Corporation - initial contribution.
       
    14 
       
    15   Contributors:
       
    16 */
       
    17 
       
    18 /** @file
       
    19 
       
    20 Inline methods of display chipset driver API
       
    21 
       
    22 @publishedDeviceAbstraction
       
    23 */
       
    24 
       
    25 /*- Include Files  ----------------------------------------------------------*/
       
    26 
       
    27 /*- Data Types --------------------------------------------------------------*/
       
    28 
       
    29 /*- Enumerations ------------------------------------------------------------*/
       
    30 
       
    31 /** Error codes */
       
    32 typedef enum  
       
    33     {
       
    34     /* Init */
       
    35     DISP_FUNC_DISP_API_VERSION = 0,
       
    36     DISP_FUNC_GET_NUMBER_OF_CAPABILITIES,
       
    37     DISP_FUNC_GET_CAPABILITIES,
       
    38     DISP_FUNC_BIND_DISPLAY_NUMBER,
       
    39     DISP_FUNC_UNBIND_DISPLAY_NUMBER,
       
    40 
       
    41     /* Control */
       
    42     DISP_FUNC_SET_FINAL_VIEW,
       
    43     DISP_FUNC_CLONE_OUTPUT,
       
    44     DISP_FUNC_POWER_CONTROL,
       
    45     DISP_FUNC_DRIVER_MESSAGE,
       
    46 
       
    47     /* Flush */
       
    48     DISP_FUNC_PREPARE_FLUSH,
       
    49     DISP_FUNC_FLUSH,
       
    50 
       
    51     /* Commands */
       
    52     DISP_FUNC_CLEAR_LIST,
       
    53     DISP_FUNC_APPEND_COMMAND,
       
    54     DISP_FUNC_APPEND_PARAMETER,
       
    55     DISP_FUNC_APPEND_READ,
       
    56     DISP_FUNC_APPEND_READ_RAW,
       
    57     DISP_FUNC_PROCESS_LIST,
       
    58 
       
    59     /* Memory */
       
    60     DISP_FUNC_ALLOCATE_BUFFER,
       
    61     DISP_FUNC_CALCULATE_MEMORY_SIZE,
       
    62     DISP_FUNC_INITIALISE_BUFFER,
       
    63     DISP_FUNC_DEALLOCATE_BUFFER,
       
    64     DISP_FUNC_GET_WORK_BUFFER,
       
    65 
       
    66     DISP_FUNC_SIZE_OF_ARRAY,
       
    67     } DISPE_FUNCTIONS;
       
    68 
       
    69 /*- Data Structs ------------------------------------------------------------*/
       
    70 
       
    71 /*- Constants ---------------------------------------------------------------*/
       
    72 
       
    73 /*- Functions ---------------------------------------------------------------*/
       
    74 
       
    75 /*== Init ===================================================================*/
       
    76 
       
    77 /*---------------------------------------------------------------------------*/
       
    78 /**
       
    79     @see header
       
    80 */
       
    81 inline uint32 dispApiVersion(API_POINTER api)
       
    82     {
       
    83 
       
    84     typedef uint32 (*DISPT_API_VERSION)();
       
    85     DISPT_API_VERSION function = ( DISPT_API_VERSION ) api[ DISP_FUNC_DISP_API_VERSION ];
       
    86     return function();
       
    87 
       
    88     }
       
    89 
       
    90 /*---------------------------------------------------------------------------*/
       
    91 /**
       
    92     @see header
       
    93 */
       
    94 inline uint32 dispGetNumberOfCapabilities(API_POINTER api)
       
    95     {
       
    96 
       
    97     typedef uint32 (*DISPT_GET_NUMBER_OF_CAPABILITIES)();
       
    98     DISPT_GET_NUMBER_OF_CAPABILITIES function = ( DISPT_GET_NUMBER_OF_CAPABILITIES ) api[ DISP_FUNC_GET_NUMBER_OF_CAPABILITIES ];
       
    99     return function();
       
   100 
       
   101     }
       
   102 
       
   103 /*---------------------------------------------------------------------------*/
       
   104 /**
       
   105     @see header
       
   106 */
       
   107 inline DISPE_ERROR dispGetCapabilities(API_POINTER api, uint32 capabilityNumber, DISPS_CAPABILITIES* capability)
       
   108     {
       
   109 
       
   110     typedef DISPE_ERROR (*DISPT_GET_CAPABILITIES)(uint32 capabilityNumber, DISPS_CAPABILITIES* capability);
       
   111     DISPT_GET_CAPABILITIES function = ( DISPT_GET_CAPABILITIES ) api[ DISP_FUNC_GET_CAPABILITIES ];
       
   112     return function( capabilityNumber, capability );
       
   113 
       
   114     }
       
   115 
       
   116 /*---------------------------------------------------------------------------*/
       
   117 /**
       
   118     @see header
       
   119 */
       
   120 inline DISPE_ERROR dispBindDisplayNumber(API_POINTER api, DISPE_BUS busInterface, void* cbParam,
       
   121                                          IDENTIFIER* identifier, const DISPS_HW_SETTINGS* displaySettings)
       
   122     {
       
   123 
       
   124     typedef DISPE_ERROR (*DISPT_BIND_DISPLAY_NUMBER)(DISPE_BUS busInterface, void* cbParam,
       
   125                                                      IDENTIFIER* identifier, const DISPS_HW_SETTINGS* displaySettings);
       
   126     DISPT_BIND_DISPLAY_NUMBER function = ( DISPT_BIND_DISPLAY_NUMBER ) api[ DISP_FUNC_BIND_DISPLAY_NUMBER ];
       
   127     return function( busInterface, cbParam, identifier, displaySettings );
       
   128 
       
   129     }
       
   130 
       
   131 /*---------------------------------------------------------------------------*/
       
   132 /**
       
   133     @see header
       
   134 */
       
   135 inline DISPE_ERROR dispUnbindDisplayNumber(API_POINTER api, IDENTIFIER identifier)
       
   136     {
       
   137 
       
   138     typedef DISPE_ERROR (*DISPT_UNBIND_DISPLAY_NUMBER)(IDENTIFIER identifier);
       
   139     DISPT_UNBIND_DISPLAY_NUMBER function = ( DISPT_UNBIND_DISPLAY_NUMBER ) api[ DISP_FUNC_UNBIND_DISPLAY_NUMBER ];
       
   140     return function( identifier );
       
   141 
       
   142     }
       
   143 
       
   144 
       
   145 /*== Control ================================================================*/
       
   146 
       
   147 
       
   148 /*---------------------------------------------------------------------------*/
       
   149 /**
       
   150     @see header
       
   151 */
       
   152 inline DISPE_ERROR dispSetFinalView(API_POINTER api, IDENTIFIER identifier, const DISPS_FINAL_VIEW* finalView)
       
   153     {
       
   154 
       
   155     typedef DISPE_ERROR (*DISPT_SET_FINAL_VIEW)(IDENTIFIER identifier, const DISPS_FINAL_VIEW* finalView);
       
   156     DISPT_SET_FINAL_VIEW function = ( DISPT_SET_FINAL_VIEW ) api[ DISP_FUNC_SET_FINAL_VIEW ];
       
   157     return function( identifier, finalView );
       
   158 
       
   159     }
       
   160 
       
   161 /*---------------------------------------------------------------------------*/
       
   162 /**
       
   163     @see header
       
   164 */
       
   165 inline DISPE_ERROR dispCloneOutput(API_POINTER api, IDENTIFIER identifier, const DISPE_BUS destinationBus)
       
   166     {
       
   167 
       
   168     typedef DISPE_ERROR (*DISPT_CLONE_OUTPUT)(IDENTIFIER identifier, const DISPE_BUS destinationBus);
       
   169     DISPT_CLONE_OUTPUT function = ( DISPT_CLONE_OUTPUT ) api[ DISP_FUNC_CLONE_OUTPUT ];
       
   170     return function( identifier, destinationBus );
       
   171 
       
   172     }
       
   173 
       
   174 /*---------------------------------------------------------------------------*/
       
   175 /**
       
   176     @see header
       
   177 */
       
   178 inline DISPE_ERROR dispPowerControl(API_POINTER api, IDENTIFIER identifier, DISPE_PWR_MODE powerMode, DISPT_READY_CB callback)
       
   179     {
       
   180 
       
   181     typedef DISPE_ERROR (*DISPT_POWER_CONTROL)(IDENTIFIER identifier, DISPE_PWR_MODE powerMode, DISPT_READY_CB callback);
       
   182     DISPT_POWER_CONTROL function = ( DISPT_POWER_CONTROL ) api[ DISP_FUNC_POWER_CONTROL ];
       
   183     return function( identifier, powerMode, callback );
       
   184 
       
   185     }
       
   186 
       
   187 /*---------------------------------------------------------------------------*/
       
   188 /**
       
   189     @see header
       
   190 */
       
   191 inline DISPE_ERROR dispDriverMessage(API_POINTER api, IDENTIFIER identifier, CHIPSET_DRV_NAME receiver,
       
   192                                      DISPE_DRV_MSG message, uint32 param, DISPT_MSG_CB callback)
       
   193     {
       
   194 
       
   195     typedef DISPE_ERROR (*DISPT_DRIVER_MESSAGE)(IDENTIFIER identifier, CHIPSET_DRV_NAME receiver,
       
   196                                                 DISPE_DRV_MSG message, uint32 param, DISPT_MSG_CB callback);
       
   197     DISPT_DRIVER_MESSAGE function = ( DISPT_DRIVER_MESSAGE ) api[ DISP_FUNC_DRIVER_MESSAGE ];
       
   198     return function( identifier, receiver, message, param, callback );
       
   199 
       
   200     }
       
   201 
       
   202 
       
   203 /*== Flush ==================================================================*/
       
   204 
       
   205 
       
   206 /*---------------------------------------------------------------------------*/
       
   207 /**
       
   208     @see header
       
   209 */
       
   210 inline DISPE_ERROR dispPrepareFlush(API_POINTER api, IDENTIFIER identifier, const DISPS_UPDATE* changedArea, DISPT_READY_CB callback)
       
   211     {
       
   212 
       
   213     typedef DISPE_ERROR (*DISPT_PREPARE_FLUSH)(IDENTIFIER identifier, const DISPS_UPDATE* changedArea, DISPT_READY_CB callback);
       
   214     DISPT_PREPARE_FLUSH function = ( DISPT_PREPARE_FLUSH ) api[ DISP_FUNC_PREPARE_FLUSH ];
       
   215     return function( identifier, changedArea, callback );
       
   216 
       
   217     }
       
   218 
       
   219 /*---------------------------------------------------------------------------*/
       
   220 /**
       
   221     @see header
       
   222 */
       
   223 inline DISPE_ERROR dispFlush(API_POINTER api, IDENTIFIER identifier, DISPT_READY_CB callback)
       
   224     {
       
   225 
       
   226     typedef DISPE_ERROR (*DISPT_FLUSH)(IDENTIFIER identifier, DISPT_READY_CB callback);
       
   227     DISPT_FLUSH function = ( DISPT_FLUSH ) api[ DISP_FUNC_FLUSH ];
       
   228     return function( identifier, callback );
       
   229 
       
   230     }
       
   231 
       
   232 
       
   233 /*== Commands ===============================================================*/
       
   234 
       
   235 
       
   236 /*---------------------------------------------------------------------------*/
       
   237 /**
       
   238     @see header
       
   239 */
       
   240 inline DISPE_ERROR dispClearList(API_POINTER api, IDENTIFIER identifier)
       
   241     {
       
   242 
       
   243     typedef DISPE_ERROR (*DISPT_CLEAR_LIST)(IDENTIFIER identifier);
       
   244     DISPT_CLEAR_LIST function = ( DISPT_CLEAR_LIST ) api[ DISP_FUNC_CLEAR_LIST ];
       
   245     return function( identifier );
       
   246 
       
   247     }
       
   248 
       
   249 /*---------------------------------------------------------------------------*/
       
   250 /**
       
   251     @see header
       
   252 */
       
   253 inline DISPE_ERROR dispAppendCommand(API_POINTER api, IDENTIFIER identifier, uint32 command)
       
   254     {
       
   255 
       
   256     typedef DISPE_ERROR (*DISPT_APPEND_COMMAND)(IDENTIFIER identifier, uint32 command);
       
   257     DISPT_APPEND_COMMAND function = ( DISPT_APPEND_COMMAND ) api[ DISP_FUNC_APPEND_COMMAND ];
       
   258     return function( identifier, command );
       
   259 
       
   260     }
       
   261 
       
   262 /*---------------------------------------------------------------------------*/
       
   263 /**
       
   264     @see header
       
   265 */
       
   266 inline DISPE_ERROR dispAppendParameter(API_POINTER api, IDENTIFIER identifier, uint32 parameter)
       
   267     {
       
   268 
       
   269     typedef DISPE_ERROR (*DISPT_APPEND_PARAMETER)(IDENTIFIER identifier, uint32 parameter);
       
   270     DISPT_APPEND_PARAMETER function = ( DISPT_APPEND_PARAMETER ) api[ DISP_FUNC_APPEND_PARAMETER ];
       
   271     return function( identifier, parameter );
       
   272 
       
   273     }
       
   274 
       
   275 /*---------------------------------------------------------------------------*/
       
   276 /**
       
   277     @see header
       
   278 */
       
   279 inline DISPE_ERROR dispAppendRead(API_POINTER api, IDENTIFIER identifier, uint32 lengthInBytes, void* readBuffer)
       
   280     {
       
   281 
       
   282     typedef DISPE_ERROR (*DISPT_APPEND_READ)(IDENTIFIER identifier, uint32 lengthInBytes, void* readBuffer);
       
   283     DISPT_APPEND_READ function = ( DISPT_APPEND_READ ) api[ DISP_FUNC_APPEND_READ ];
       
   284     return function( identifier, lengthInBytes, readBuffer );
       
   285 
       
   286     }
       
   287 
       
   288 /*---------------------------------------------------------------------------*/
       
   289 /**
       
   290     @see header
       
   291 */
       
   292 inline DISPE_ERROR dispAppendReadRaw(API_POINTER api, IDENTIFIER identifier, uint32 lengthInBytes, void* readBuffer, uint32 readBufferOneLine, uint32 readBufferStride)
       
   293     {
       
   294 
       
   295     typedef DISPE_ERROR (*DISPT_APPEND_READ_RAW)(IDENTIFIER identifier, uint32 lengthInBytes,
       
   296                          void* readBuffer, uint32 readBufferOneLine, uint32 readBufferStride);
       
   297     DISPT_APPEND_READ_RAW function = ( DISPT_APPEND_READ_RAW ) api[ DISP_FUNC_APPEND_READ_RAW ];
       
   298     return function( identifier, lengthInBytes, readBuffer, readBufferOneLine, readBufferStride );
       
   299 
       
   300     }
       
   301 
       
   302 /*---------------------------------------------------------------------------*/
       
   303 /**
       
   304     @see header
       
   305 */
       
   306 inline DISPE_ERROR dispProcessList(API_POINTER api, IDENTIFIER identifier, DISPT_READY_CB callback)
       
   307     {
       
   308 
       
   309     typedef DISPE_ERROR (*DISPT_PROCESS_LIST)(IDENTIFIER identifier, DISPT_READY_CB callback);
       
   310     DISPT_PROCESS_LIST function = ( DISPT_PROCESS_LIST ) api[ DISP_FUNC_PROCESS_LIST ];
       
   311     return function( identifier, callback );
       
   312 
       
   313     }
       
   314 
       
   315 
       
   316 /*== Memory =================================================================*/
       
   317 
       
   318 
       
   319 /*---------------------------------------------------------------------------*/
       
   320 /**
       
   321     @see header
       
   322 */
       
   323 inline DISPE_ERROR dispAllocateBuffer(API_POINTER api, IDENTIFIER identifier, const DISPS_BUFFER* bufferInfo, DISPS_BUFFER* allocatedBuffer)
       
   324     {
       
   325 
       
   326     typedef DISPE_ERROR (*DISPT_ALLOCATE_BUFFER)(IDENTIFIER identifier, const DISPS_BUFFER* bufferInfo, DISPS_BUFFER* allocatedBuffer);
       
   327     DISPT_ALLOCATE_BUFFER function = ( DISPT_ALLOCATE_BUFFER ) api[ DISP_FUNC_ALLOCATE_BUFFER ];
       
   328     return function( identifier, bufferInfo, allocatedBuffer );
       
   329 
       
   330     }
       
   331 
       
   332 /*---------------------------------------------------------------------------*/
       
   333 /**
       
   334     @see header
       
   335 */
       
   336 inline DISPE_ERROR dispCalculateMemorySize(API_POINTER api, IDENTIFIER identifier, const DISPS_BUFFER* bufferInfo, uint32* neededMemorySize)
       
   337     {
       
   338 
       
   339     typedef DISPE_ERROR (*DISPT_CALCULATE_MEMORY_SIZE)(IDENTIFIER identifier, const DISPS_BUFFER* bufferInfo, uint32* neededMemorySize);
       
   340     DISPT_CALCULATE_MEMORY_SIZE function = ( DISPT_CALCULATE_MEMORY_SIZE ) api[ DISP_FUNC_CALCULATE_MEMORY_SIZE ];
       
   341     return function( identifier, bufferInfo, neededMemorySize );
       
   342 
       
   343     }
       
   344 
       
   345 /*---------------------------------------------------------------------------*/
       
   346 /**
       
   347     @see header
       
   348 */
       
   349 inline DISPE_ERROR dispInitialiseBuffer(API_POINTER api, IDENTIFIER identifier, const DISPS_BUFFER* bufferInfo, DISPS_BUFFER* allocatedBuffer)
       
   350     {
       
   351 
       
   352     typedef DISPE_ERROR (*DISPT_INITIALISE_BUFFER)(IDENTIFIER identifier, const DISPS_BUFFER* bufferInfo, DISPS_BUFFER* allocatedBuffer);
       
   353     DISPT_INITIALISE_BUFFER function = ( DISPT_INITIALISE_BUFFER ) api[ DISP_FUNC_INITIALISE_BUFFER ];
       
   354     return function( identifier, bufferInfo, allocatedBuffer );
       
   355 
       
   356     }
       
   357 
       
   358 /*---------------------------------------------------------------------------*/
       
   359 /**
       
   360     @see header
       
   361 */
       
   362 inline DISPE_ERROR dispDeallocateBuffer(API_POINTER api, IDENTIFIER identifier, const DISPS_BUFFER* bufferToBeRemoved)
       
   363     {
       
   364 
       
   365     typedef DISPE_ERROR (*DISPT_DEALLOCATE_BUFFER)(IDENTIFIER identifier, const DISPS_BUFFER* bufferToBeRemoved);
       
   366     DISPT_DEALLOCATE_BUFFER function = ( DISPT_DEALLOCATE_BUFFER ) api[ DISP_FUNC_DEALLOCATE_BUFFER ];
       
   367     return function( identifier, bufferToBeRemoved );
       
   368 
       
   369     }
       
   370 
       
   371 /*---------------------------------------------------------------------------*/
       
   372 /**
       
   373     @see header
       
   374 */
       
   375 inline DISPE_ERROR dispGetWorkBuffer(API_POINTER api, IDENTIFIER identifier, const DISPS_RECTANGLE* fetchedArea, DISPS_BUFFER* fetchedWorkBuffer)
       
   376     {
       
   377 
       
   378     typedef DISPE_ERROR (*DISPT_GET_WORK_BUFFER)(IDENTIFIER identifier, const DISPS_RECTANGLE* fetchedArea, DISPS_BUFFER* fetchedWorkBuffer);
       
   379     DISPT_GET_WORK_BUFFER function = ( DISPT_GET_WORK_BUFFER ) api[ DISP_FUNC_GET_WORK_BUFFER ];
       
   380     return function( identifier, fetchedArea, fetchedWorkBuffer );
       
   381 
       
   382     }
       
   383 
       
   384 /* End of File */
       
   385