diff options
author | Xinliang Liu <xinliang.liu@linaro.org> | 2015-12-23 17:32:42 +0800 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2016-02-02 19:32:29 -0800 |
commit | b6ee9bc31cd139fd8feb8f0a7963f5af98b46691 (patch) | |
tree | 494a811a9f69f79c213d57955e9d8d9b0d77c765 /drivers/gpu/arm/utgard/common/mali_session.c | |
parent | e718041d13e35f8d0ee162f959a899aa1f6de72c (diff) | |
download | hikey-linaro-b6ee9bc31cd139fd8feb8f0a7963f5af98b46691.tar.gz |
drivers/gpu: update ARM Mali Utgard to r6p0 driver
Add ARM Mali Utgard driver from this release:
DX910-SW-99002-r6p0-01rel0
This is a direct file drop from the public release original archive.
Signed-off-by: Xinliang Liu <xinliang.liu@linaro.org>
Diffstat (limited to 'drivers/gpu/arm/utgard/common/mali_session.c')
-rw-r--r-- | drivers/gpu/arm/utgard/common/mali_session.c | 50 |
1 files changed, 42 insertions, 8 deletions
diff --git a/drivers/gpu/arm/utgard/common/mali_session.c b/drivers/gpu/arm/utgard/common/mali_session.c index 2cc6b76ff552..e0a2805b13d3 100644 --- a/drivers/gpu/arm/utgard/common/mali_session.c +++ b/drivers/gpu/arm/utgard/common/mali_session.c @@ -1,9 +1,9 @@ /* - * Copyright (C) 2012-2014 ARM Limited. All rights reserved. - * + * Copyright (C) 2012-2015 ARM Limited. All rights reserved. + * * This program is free software and is provided to you under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence. - * + * * A copy of the licence is included with the program, and can also be obtained from Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ @@ -12,15 +12,21 @@ #include "mali_osk_list.h" #include "mali_session.h" #include "mali_ukk.h" +#ifdef MALI_MEM_SWAP_TRACKING +#include "mali_memory_swap_alloc.h" +#endif _MALI_OSK_LIST_HEAD(mali_sessions); static u32 mali_session_count = 0; _mali_osk_spinlock_irq_t *mali_sessions_lock = NULL; +wait_queue_head_t pending_queue; _mali_osk_errcode_t mali_session_initialize(void) { _MALI_OSK_INIT_LIST_HEAD(&mali_sessions); + /* init wait queue for big varying job */ + init_waitqueue_head(&pending_queue); mali_sessions_lock = _mali_osk_spinlock_irq_init( _MALI_OSK_LOCKFLAG_ORDERED, @@ -61,6 +67,11 @@ u32 mali_session_get_count(void) return mali_session_count; } +wait_queue_head_t *mali_session_get_wait_queue(void) +{ + return &pending_queue; +} + /* * Get the max completed window jobs from all active session, * which will be used in window render frame per sec calculate @@ -93,18 +104,41 @@ void mali_session_memory_tracking(_mali_osk_print_ctx *print_ctx) struct mali_session_data *session, *tmp; u32 mali_mem_usage; u32 total_mali_mem_size; +#ifdef MALI_MEM_SWAP_TRACKING + u32 swap_pool_size; + u32 swap_unlock_size; +#endif MALI_DEBUG_ASSERT_POINTER(print_ctx); mali_session_lock(); MALI_SESSION_FOREACH(session, tmp, link) { - _mali_osk_ctxprintf(print_ctx, " %-25s %-10u %-10u %-15u %-15u %-10u %-10u\n", +#ifdef MALI_MEM_SWAP_TRACKING + _mali_osk_ctxprintf(print_ctx, " %-25s %-10u %-10u %-15u %-15u %-10u %-10u %-10u\n", session->comm, session->pid, - session->mali_mem_array[MALI_MEM_OS] + session->mali_mem_array[MALI_MEM_BLOCK], session->max_mali_mem_allocated, - session->mali_mem_array[MALI_MEM_EXTERNAL], session->mali_mem_array[MALI_MEM_UMP], - session->mali_mem_array[MALI_MEM_DMA_BUF]); + (atomic_read(&session->mali_mem_allocated_pages)) * _MALI_OSK_MALI_PAGE_SIZE, + session->max_mali_mem_allocated_size, + (atomic_read(&session->mali_mem_array[MALI_MEM_EXTERNAL])) * _MALI_OSK_MALI_PAGE_SIZE, + (atomic_read(&session->mali_mem_array[MALI_MEM_UMP])) * _MALI_OSK_MALI_PAGE_SIZE, + (atomic_read(&session->mali_mem_array[MALI_MEM_DMA_BUF])) * _MALI_OSK_MALI_PAGE_SIZE, + (atomic_read(&session->mali_mem_array[MALI_MEM_SWAP])) * _MALI_OSK_MALI_PAGE_SIZE + ); +#else + _mali_osk_ctxprintf(print_ctx, " %-25s %-10u %-10u %-15u %-15u %-10u %-10u \n", + session->comm, session->pid, + (atomic_read(&session->mali_mem_allocated_pages)) * _MALI_OSK_MALI_PAGE_SIZE, + session->max_mali_mem_allocated_size, + (atomic_read(&session->mali_mem_array[MALI_MEM_EXTERNAL])) * _MALI_OSK_MALI_PAGE_SIZE, + (atomic_read(&session->mali_mem_array[MALI_MEM_UMP])) * _MALI_OSK_MALI_PAGE_SIZE, + (atomic_read(&session->mali_mem_array[MALI_MEM_DMA_BUF])) * _MALI_OSK_MALI_PAGE_SIZE + ); +#endif } mali_session_unlock(); mali_mem_usage = _mali_ukk_report_memory_usage(); total_mali_mem_size = _mali_ukk_report_total_memory_size(); _mali_osk_ctxprintf(print_ctx, "Mali mem usage: %u\nMali mem limit: %u\n", mali_mem_usage, total_mali_mem_size); -}
\ No newline at end of file +#ifdef MALI_MEM_SWAP_TRACKING + mali_mem_swap_tracking(&swap_pool_size, &swap_unlock_size); + _mali_osk_ctxprintf(print_ctx, "Mali swap mem pool : %u\nMali swap mem unlock: %u\n", swap_pool_size, swap_unlock_size); +#endif +} |