mali_kernel_vsync.c 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * This confidential and proprietary software may be used only as
  3. * authorised by a licensing agreement from ARM Limited
  4. * (C) COPYRIGHT 2011-2013 ARM Limited
  5. * ALL RIGHTS RESERVED
  6. * The entire notice above must be reproduced on all authorised
  7. * copies and copies may only be made to the extent permitted
  8. * by a licensing agreement from ARM Limited.
  9. */
  10. #include "mali_kernel_common.h"
  11. #include "mali_osk.h"
  12. #include "mali_ukk.h"
  13. #if defined(CONFIG_MALI400_PROFILING)
  14. #include "mali_osk_profiling.h"
  15. #endif
  16. _mali_osk_errcode_t _mali_ukk_vsync_event_report(_mali_uk_vsync_event_report_s *args)
  17. {
  18. _mali_uk_vsync_event event = (_mali_uk_vsync_event)args->event;
  19. MALI_IGNORE(event); /* event is not used for release code, and that is OK */
  20. #if defined(CONFIG_MALI400_PROFILING)
  21. /*
  22. * Manually generate user space events in kernel space.
  23. * This saves user space from calling kernel space twice in this case.
  24. * We just need to remember to add pid and tid manually.
  25. */
  26. if ( event==_MALI_UK_VSYNC_EVENT_BEGIN_WAIT) {
  27. _mali_osk_profiling_add_event(MALI_PROFILING_EVENT_TYPE_SUSPEND |
  28. MALI_PROFILING_EVENT_CHANNEL_SOFTWARE |
  29. MALI_PROFILING_EVENT_REASON_SUSPEND_RESUME_SW_VSYNC,
  30. _mali_osk_get_pid(), _mali_osk_get_tid(), 0, 0, 0);
  31. }
  32. if (event==_MALI_UK_VSYNC_EVENT_END_WAIT) {
  33. _mali_osk_profiling_add_event(MALI_PROFILING_EVENT_TYPE_RESUME |
  34. MALI_PROFILING_EVENT_CHANNEL_SOFTWARE |
  35. MALI_PROFILING_EVENT_REASON_SUSPEND_RESUME_SW_VSYNC,
  36. _mali_osk_get_pid(), _mali_osk_get_tid(), 0, 0, 0);
  37. }
  38. #endif
  39. MALI_DEBUG_PRINT(4, ("Received VSYNC event: %d\n", event));
  40. MALI_SUCCESS;
  41. }