/drivers/gpu/pvr/srvkm.h

https://bitbucket.org/wisechild/galaxy-nexus · C++ Header · 78 lines · 34 code · 19 blank · 25 comment · 2 complexity · 938032e34058b0cb768f515d695ee51c MD5 · raw file

  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. #ifndef SRVKM_H
  27. #define SRVKM_H
  28. #if defined(__cplusplus)
  29. extern "C" {
  30. #endif
  31. #ifdef PVR_DISABLE_LOGGING
  32. #define PVR_LOG(X)
  33. #else
  34. #define PVR_LOG(X) PVRSRVReleasePrintf X;
  35. #endif
  36. IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVReleasePrintf(const IMG_CHAR *pszFormat, ...) IMG_FORMAT_PRINTF(1, 2);
  37. IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVProcessConnect(IMG_UINT32 ui32PID, IMG_UINT32 ui32Flags);
  38. IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVProcessDisconnect(IMG_UINT32 ui32PID);
  39. IMG_IMPORT IMG_VOID PVRSRVScheduleDevicesKM(IMG_VOID);
  40. IMG_VOID IMG_CALLCONV PVRSRVSetDCState(IMG_UINT32 ui32State);
  41. PVRSRV_ERROR IMG_CALLCONV PVRSRVSaveRestoreLiveSegments(IMG_HANDLE hArena, IMG_PBYTE pbyBuffer, IMG_SIZE_T *puiBufSize, IMG_BOOL bSave);
  42. IMG_VOID PVRSRVScheduleDeviceCallbacks(IMG_VOID);
  43. #if defined (__cplusplus)
  44. }
  45. #endif
  46. #define LOOP_UNTIL_TIMEOUT(TIMEOUT) \
  47. {\
  48. IMG_UINT32 uiOffset, uiStart, uiCurrent; \
  49. IMG_INT32 iNotLastLoop; \
  50. for(uiOffset = 0, uiStart = OSClockus(), uiCurrent = uiStart + 1, iNotLastLoop = 1;\
  51. ((uiCurrent - uiStart + uiOffset) < (TIMEOUT)) || iNotLastLoop--; \
  52. uiCurrent = OSClockus(), \
  53. uiOffset = uiCurrent < uiStart ? IMG_UINT32_MAX - uiStart : uiOffset, \
  54. uiStart = uiCurrent < uiStart ? 0 : uiStart)
  55. #define END_LOOP_UNTIL_TIMEOUT() \
  56. }
  57. IMG_IMPORT
  58. const IMG_CHAR *PVRSRVGetErrorStringKM(PVRSRV_ERROR eError);
  59. #endif