2 * Copyright (C) 2011-2012 ARM Limited. All rights reserved.
4 * This program is free software and is provided to you under the terms of the GNU General Public License version 2
5 * as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence.
7 * A copy of the licence is included with the program, and can also be obtained from Free Software
8 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
11 #include "mali_kernel_common.h"
15 #if defined(CONFIG_MALI400_PROFILING)
16 #include "mali_osk_profiling.h"
19 _mali_osk_errcode_t _mali_ukk_vsync_event_report(_mali_uk_vsync_event_report_s *args)
21 _mali_uk_vsync_event event = (_mali_uk_vsync_event)args->event;
22 MALI_IGNORE(event); /* event is not used for release code, and that is OK */
24 #if defined(CONFIG_MALI400_PROFILING)
26 * Manually generate user space events in kernel space.
27 * This saves user space from calling kernel space twice in this case.
28 * We just need to remember to add pid and tid manually.
30 if ( event==_MALI_UK_VSYNC_EVENT_BEGIN_WAIT)
32 _mali_osk_profiling_add_event(MALI_PROFILING_EVENT_TYPE_SUSPEND |
33 MALI_PROFILING_EVENT_CHANNEL_SOFTWARE |
34 MALI_PROFILING_EVENT_REASON_SUSPEND_RESUME_SW_VSYNC,
35 _mali_osk_get_pid(), _mali_osk_get_tid(), 0, 0, 0);
38 if (event==_MALI_UK_VSYNC_EVENT_END_WAIT)
41 _mali_osk_profiling_add_event(MALI_PROFILING_EVENT_TYPE_RESUME |
42 MALI_PROFILING_EVENT_CHANNEL_SOFTWARE |
43 MALI_PROFILING_EVENT_REASON_SUSPEND_RESUME_SW_VSYNC,
44 _mali_osk_get_pid(), _mali_osk_get_tid(), 0, 0, 0);
48 MALI_DEBUG_PRINT(4, ("Received VSYNC event: %d\n", event));