upload tizen1.0 source
[kernel/linux-2.6.36.git] / drivers / media / video / samsung / mfc5x / mfc_mem.h
1 /*
2  * linux/drivers/media/video/samsung/mfc5x/mfc_mem.h
3  *
4  * Copyright (c) 2010 Samsung Electronics Co., Ltd.
5  *              http://www.samsung.com/
6  *
7  * Memory manager for Samsung MFC (Multi Function Codec - FIMV) driver
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License version 2 as
11  * published by the Free Software Foundation.
12  */
13
14 #ifndef __MFC_MEM_H_
15 #define __MFC_MEM_H_ __FILE__
16
17 #include "mfc.h"
18 #include "mfc_dev.h"
19
20 #ifdef CONFIG_VIDEO_MFC_VCM_UMP
21 #include <plat/s5p-vcm.h>
22 #endif
23
24 #ifdef CONFIG_S5P_VMEM
25 #include <linux/dma-mapping.h>
26
27 extern unsigned int s5p_vmem_vmemmap(size_t size, unsigned long va_start,
28                 unsigned long va_end);
29 extern void s5p_vfree(unsigned int cookie);
30 extern unsigned int s5p_getcookie(void *addr);
31 extern void *s5p_getaddress(unsigned int cookie);
32 extern void s5p_vmem_dmac_map_area(const void *start_addr,
33                 unsigned long size, int dir);
34 #endif
35
36 #ifdef CONFIG_VIDEO_MFC_VCM_UMP
37 struct vcm_res;
38
39 struct vcm_mmu_res {
40         struct vcm_res                  res;
41         struct list_head                bound;
42 };
43 #endif
44
45 int mfc_mem_count(void);
46 unsigned int mfc_mem_base(int port);
47 unsigned char *mfc_mem_addr(int port);
48 unsigned int mfc_mem_data_base(int port);
49 unsigned int mfc_mem_data_size(int port);
50 unsigned int mfc_mem_data_ofs(unsigned int addr, int contig);
51 unsigned int mfc_mem_base_ofs(unsigned int addr);
52 unsigned int mfc_mem_addr_ofs(unsigned int ofs, int port);
53
54 void mfc_mem_cache_clean(const void *start_addr, unsigned long size);
55 void mfc_mem_cache_inv(const void *start_addr, unsigned long size);
56
57 int mfc_init_mem_mgr(struct mfc_dev *dev);
58 void mfc_final_mem_mgr(struct mfc_dev *dev);
59
60 #ifdef CONFIG_VIDEO_MFC_VCM_UMP
61 void mfc_vcm_dump_res(struct vcm_res *res);
62 struct vcm_mmu_res *mfc_vcm_bind(unsigned int addr, unsigned int size);
63 void mfc_vcm_unbind(struct vcm_mmu_res *s_res, int flag);
64 struct vcm_res *mfc_vcm_map(struct vcm_phys *phys);
65 void mfc_vcm_unmap(struct vcm_res *res);
66 void *mfc_ump_map(struct vcm_phys *phys, unsigned long vcminfo);
67 void mfc_ump_unmap(void *handle);
68 unsigned int mfc_ump_get_id(void *handle);
69 unsigned long mfc_ump_get_virt(unsigned int secure_id);
70 #endif
71
72 #endif /* __MFC_MEM_H_ */