diff options
author | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2015-10-22 15:04:56 +0200 |
---|---|---|
committer | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2015-10-22 15:04:56 +0200 |
commit | b99374450c03bf5081b88995d91d34fb9b2fd040 (patch) | |
tree | b6f525d915504ad8bd99bdb2dadcca345a4ad3a3 /drivers/gpu/mali400/r3p2/mali/common/mali_memory.h | |
parent | a39819e88ea4546218b581d7f061a99ca91d825b (diff) | |
parent | e2f984e707f517f24041b70018770b20b71cb6a6 (diff) | |
download | kernel_samsung_smdk4412-b99374450c03bf5081b88995d91d34fb9b2fd040.zip kernel_samsung_smdk4412-b99374450c03bf5081b88995d91d34fb9b2fd040.tar.gz kernel_samsung_smdk4412-b99374450c03bf5081b88995d91d34fb9b2fd040.tar.bz2 |
Merge remote-tracking branch 'github/cm-11.0'
Conflicts:
firmware/Makefile
firmware/epen/W9001_B713.bin.ihex
firmware/epen/W9001_B746.bin.ihex
firmware/epen/W9001_B746JD.bin.ihex
firmware/epen/W9001_B746L.bin.ihex
firmware/epen/W9001_B746S.bin.ihex
Diffstat (limited to 'drivers/gpu/mali400/r3p2/mali/common/mali_memory.h')
-rw-r--r-- | drivers/gpu/mali400/r3p2/mali/common/mali_memory.h | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/drivers/gpu/mali400/r3p2/mali/common/mali_memory.h b/drivers/gpu/mali400/r3p2/mali/common/mali_memory.h new file mode 100644 index 0000000..537c346 --- /dev/null +++ b/drivers/gpu/mali400/r3p2/mali/common/mali_memory.h @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2010-2012 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. + */ + +#ifndef __MALI_MEMORY_H__ +#define __MALI_MEMORY_H__ + +#include "mali_osk.h" +#include "mali_session.h" + +/** @brief Initialize Mali memory subsystem + * + * Allocate and initialize internal data structures. Must be called before + * allocating Mali memory. + * + * @return On success _MALI_OSK_ERR_OK, othervise some error code describing the error. + */ +_mali_osk_errcode_t mali_memory_initialize(void); + +/** @brief Terminate Mali memory system + * + * Clean up and release internal data structures. + */ +void mali_memory_terminate(void); + +/** @brief Start new Mali memory session + * + * Allocate and prepare session specific memory allocation data data. The + * session page directory, lock, and descriptor map is set up. + * + * @param mali_session_data pointer to the session data structure + */ +_mali_osk_errcode_t mali_memory_session_begin(struct mali_session_data *mali_session_data); + +/** @brief Close a Mali memory session + * + * Release session specific memory allocation related data. + * + * @param mali_session_data pointer to the session data structure + */ +void mali_memory_session_end(struct mali_session_data *mali_session_data); + +/** @brief Allocate a page table page + * + * Allocate a page for use as a page directory or page table. The page is + * mapped into kernel space. + * + * @return _MALI_OSK_ERR_OK on success, othervise an error code + * @param table_page GPU pointer to the allocated page + * @param mapping CPU pointer to the mapping of the allocated page + */ +_mali_osk_errcode_t mali_mmu_get_table_page(u32 *table_page, mali_io_address *mapping); + +/** @brief Release a page table page + * + * Release a page table page allocated through \a mali_mmu_get_table_page + * + * @param pa the GPU address of the page to release + */ +void mali_mmu_release_table_page(u32 pa); + + +/** @brief Parse resource and prepare the OS memory allocator + * + * @param size Maximum size to allocate for Mali GPU. + * @return _MALI_OSK_ERR_OK on success, otherwise failure. + */ +_mali_osk_errcode_t mali_memory_core_resource_os_memory(u32 size); + +/** @brief Parse resource and prepare the dedicated memory allocator + * + * @param start Physical start address of dedicated Mali GPU memory. + * @param size Size of dedicated Mali GPU memory. + * @return _MALI_OSK_ERR_OK on success, otherwise failure. + */ +_mali_osk_errcode_t mali_memory_core_resource_dedicated_memory(u32 start, u32 size); + +mali_allocation_engine mali_mem_get_memory_engine(void); + +#endif /* __MALI_MEMORY_H__ */ |