md_buf->md_vptr,
stream_info->metadata_info.size);
} else {
- hrt_isp_css_mm_load(md_buf->metadata->address,
+ hmm_load(md_buf->metadata->address,
asd->params.metadata_user[md_type],
stream_info->metadata_info.size);
md_buf->md_vptr,
stream_info->metadata_info.size);
} else {
- hrt_isp_css_mm_load(md_buf->metadata->address,
+ hmm_load(md_buf->metadata->address,
asd->params.metadata_user[md_type],
stream_info->metadata_info.size);
load += ISP_LEFT_PAD;
for (i = 0; i < height; i++) {
- ret = hrt_isp_css_mm_load(load, buffer, width*sizeof(load));
+ ret = hmm_load(load, buffer, width*sizeof(load));
if (ret < 0)
goto remove_pad_error;
- ret = hrt_isp_css_mm_store(store, buffer, width*sizeof(store));
+ ret = hmm_store(store, buffer, width*sizeof(store));
if (ret < 0)
goto remove_pad_error;
return mmgr_alloc_attr(size * N, MMGR_ATTRIBUTE_CLEARED);
}
-void
-mmgr_clear(hrt_vaddress vaddr, const size_t size)
+void mmgr_clear(hrt_vaddress vaddr, const size_t size)
{
- hrt_isp_css_mm_set(vaddr, 0, size);
+ if (vaddr)
+ hmm_set(vaddr, 0, size);
}
-void
-mmgr_load(const hrt_vaddress vaddr, void *data, const size_t size)
+void mmgr_load(const hrt_vaddress vaddr, void *data, const size_t size)
{
- hrt_isp_css_mm_load(vaddr, data, size);
+ if (vaddr && data)
+ hmm_load(vaddr, data, size);
}
void
mmgr_store(const hrt_vaddress vaddr, const void *data, const size_t size)
{
- hrt_isp_css_mm_store(vaddr, data, size);
+ if (vaddr && data)
+ hmm_store(vaddr, data, size);
}
hrt_vaddress
#define __page_align(size) (((size) + (PAGE_SIZE-1)) & (~(PAGE_SIZE-1)))
-int hrt_isp_css_mm_set(ia_css_ptr virt_addr, int c, size_t bytes)
-{
- if (virt_addr)
- return hmm_set(virt_addr, c, bytes);
-
- return -EFAULT;
-}
-
-int hrt_isp_css_mm_load(ia_css_ptr virt_addr, void *data, size_t bytes)
-{
- if (virt_addr && data)
- return hmm_load(virt_addr, data, bytes);
- return -EFAULT;
-}
-
-int hrt_isp_css_mm_store(ia_css_ptr virt_addr, const void *data, size_t bytes)
-{
- if (virt_addr && data)
- return hmm_store(virt_addr, data, bytes);
- return -EFAULT;
-}
-
static void *my_userptr;
static unsigned my_num_pages;
static enum hrt_userptr_type my_usr_type;
return ptr;
}
-phys_addr_t hrt_isp_css_virt_to_phys(ia_css_ptr virt_addr)
-{
- return hmm_virt_to_phys(virt_addr);
-}
-
void hrt_isp_css_mm_set_user_ptr(void *userptr,
unsigned int num_pages, enum hrt_userptr_type);
-int hrt_isp_css_mm_set(ia_css_ptr virt_addr, int c, size_t bytes);
-
/* Allocate memory, returns a virtual address */
ia_css_ptr hrt_isp_css_mm_alloc(size_t bytes);
ia_css_ptr hrt_isp_css_mm_alloc_user_ptr(size_t bytes, void *userptr,
ia_css_ptr hrt_isp_css_mm_calloc(size_t bytes);
ia_css_ptr hrt_isp_css_mm_calloc_cached(size_t bytes);
-/* Store data to a virtual address */
-int hrt_isp_css_mm_load(ia_css_ptr virt_addr, void *data, size_t bytes);
-
-/* Load data from a virtual address */
-int hrt_isp_css_mm_store(ia_css_ptr virt_addr, const void *data, size_t bytes);
-
-int hrt_isp_css_mm_load_int(ia_css_ptr virt_addr, int *data);
-int hrt_isp_css_mm_load_short(ia_css_ptr virt_addr, short *data);
-int hrt_isp_css_mm_load_char(ia_css_ptr virt_addr, char *data);
-
-int hrt_isp_css_mm_store_char(ia_css_ptr virt_addr, char data);
-int hrt_isp_css_mm_store_short(ia_css_ptr virt_addr, short data);
-int hrt_isp_css_mm_store_int(ia_css_ptr virt_addr, int data);
-
-/* translate a virtual to a physical address, used to program
- the display driver on the FPGA system */
-phys_addr_t hrt_isp_css_virt_to_phys(ia_css_ptr virt_addr);
-
#endif /* _hive_isp_css_mm_hrt_h_ */
ia_css_ptr vaddr,
const size_t size)
{
- hrt_isp_css_mm_set(vaddr, 0, size);
+ hmm_set(vaddr, 0, size);
}
void mmgr_load(const ia_css_ptr vaddr, void *data, const size_t size)
{
- hrt_isp_css_mm_load(vaddr, data, size);
+ hmm_load(vaddr, data, size);
}
void mmgr_store(const ia_css_ptr vaddr, const void *data, const size_t size)
{
- hrt_isp_css_mm_store(vaddr, data, size);
+ hmm_store(vaddr, data, size);
}