1 /* 2 * drivers/amlogic/media/frame_provider/decoder/utils/decoder_mmu_box.h 3 * 4 * Copyright (C) 2016 Amlogic, Inc. All rights reserved. 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 * more details. 15 * 16 */ 17 18 #ifndef DECODER_BUFFER_BOX 19 #define DECODER_BUFFER_BOX 20 21 void *decoder_mmu_box_alloc_box(const char *name, 22 int channel_id, 23 int max_num, 24 int min_size_M, 25 int mem_flags); 26 27 int decoder_mmu_box_sc_check(void *handle, int is_tvp); 28 29 int decoder_mmu_box_alloc_idx( 30 void *handle, int idx, int num_pages, 31 unsigned int *mmu_index_adr); 32 33 int decoder_mmu_box_free_idx_tail(void *handle, int idx, 34 int start_release_index); 35 36 int decoder_mmu_box_free_idx(void *handle, int idx); 37 38 int decoder_mmu_box_free(void *handle); 39 40 int decoder_mmu_box_move_keep_idx(void *box_handle, 41 int keep_idx); 42 int decoder_mmu_box_free_keep(int keep_id); 43 int decoder_mmu_box_free_all_keep(void); 44 void *decoder_mmu_box_get_mem_handle(void *box_handle, int idx); 45 bool decoder_mmu_box_valide_check(void *box); 46 void decoder_mmu_try_to_release_box(void *handle); 47 int decoder_mmu_box_init(void); 48 void decoder_mmu_box_exit(void); 49 50 #endif 51