}
/* Init ISP memory management */
- hrt_isp_css_mm_init();
+ hmm_init();
err = devm_request_threaded_irq(&dev->dev, dev->irq,
atomisp_isr, atomisp_isr_thread,
css_init_fail:
devm_free_irq(&dev->dev, dev->irq, isp);
request_irq_fail:
- hrt_isp_css_mm_clear();
+ hmm_cleanup();
hmm_pool_unregister(HMM_POOL_TYPE_RESERVED);
hmm_pool_fail:
destroy_workqueue(isp->wdt_work_queue);
atomisp_acc_cleanup(isp);
atomisp_css_unload_firmware(isp);
- hrt_isp_css_mm_clear();
+ hmm_cleanup();
pm_runtime_forbid(&dev->dev);
pm_runtime_get_noresume(&dev->dev);
void
mmgr_free(hrt_vaddress vaddr)
{
- hrt_isp_css_mm_free(vaddr);
+ hmm_free(vaddr);
}
void
{
struct hmm_buffer_object *bo;
+ WARN_ON(!virt);
+
bo = hmm_bo_device_search_start(&bo_device, (unsigned int)virt);
if (!bo) {
hmm_mem_stat.tol_cnt -= bo->pgnr;
hmm_bo_unbind(bo);
-
hmm_bo_free_pages(bo);
-
hmm_bo_unref(bo);
}
#define __page_align(size) (((size) + (PAGE_SIZE-1)) & (~(PAGE_SIZE-1)))
-static unsigned init_done;
-void hrt_isp_css_mm_init(void)
-{
- hmm_init();
- init_done = 1;
-}
-
int hrt_isp_css_mm_set(ia_css_ptr virt_addr, int c, size_t bytes)
{
if (virt_addr)
return -EFAULT;
}
-void hrt_isp_css_mm_free(ia_css_ptr virt_addr)
-{
- if (virt_addr)
- hmm_free(virt_addr);
-}
-
-void hrt_isp_css_mm_clear(void)
-{
- if (init_done) {
- hmm_cleanup();
- init_done = 0;
- }
-}
-
static void *my_userptr;
static unsigned my_num_pages;
static enum hrt_userptr_type my_usr_type;
enum hrt_userptr_type type,
bool cached)
{
- if (!init_done)
- hrt_isp_css_mm_init();
#ifdef CONFIG_ION
if (type == HRT_USR_ION)
return hmm_alloc(bytes, HMM_BO_ION, 0,
ia_css_ptr hrt_isp_css_mm_alloc_cached(size_t bytes)
{
- if (!init_done)
- hrt_isp_css_mm_init();
-
if (my_userptr == NULL)
return hmm_alloc(bytes, HMM_BO_PRIVATE, 0, 0,
HMM_CACHED);
unsigned int pgnr;
};
-void hrt_isp_css_mm_init(void);
void hrt_isp_css_mm_set_user_ptr(void *userptr,
unsigned int num_pages, enum hrt_userptr_type);
ia_css_ptr hrt_isp_css_mm_calloc(size_t bytes);
ia_css_ptr hrt_isp_css_mm_calloc_cached(size_t bytes);
-/* Free memory, given a virtual address */
-void hrt_isp_css_mm_free(ia_css_ptr virt_addr);
-
/* Store data to a virtual address */
int hrt_isp_css_mm_load(ia_css_ptr virt_addr, void *data, size_t bytes);
the display driver on the FPGA system */
phys_addr_t hrt_isp_css_virt_to_phys(ia_css_ptr virt_addr);
-void hrt_isp_css_mm_clear(void);
#endif /* _hive_isp_css_mm_hrt_h_ */
void mmgr_free(ia_css_ptr vaddr)
{
-/* "free()" should accept NULL, "hrt_isp_css_mm_free()" may not */
+/* "free()" should accept NULL, "hmm_free()" may not */
if (vaddr)
- hrt_isp_css_mm_free(vaddr);
+ hmm_free(vaddr);
}
ia_css_ptr mmgr_alloc_attr(const size_t size, const uint16_t attribute)