1/* 2 * Support for Medfield PNW Camera Imaging ISP subsystem. 3 * 4 * Copyright (c) 2010 Intel Corporation. All Rights Reserved. 5 * 6 * Copyright (c) 2010 Silicon Hive www.siliconhive.com. 7 * 8 * This program is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU General Public License version 10 * 2 as published by the Free Software Foundation. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * 18 */ 19 20#ifndef _hive_isp_css_mm_hrt_h_ 21#define _hive_isp_css_mm_hrt_h_ 22 23#include <hmm/hmm.h> 24#include <hrt/hive_isp_css_custom_host_hrt.h> 25 26#define HRT_BUF_FLAG_CACHED (1 << 0) 27 28enum hrt_userptr_type { 29 HRT_USR_PTR = 0, 30#ifdef CONFIG_ION 31 HRT_USR_ION, 32#endif 33}; 34 35struct hrt_userbuffer_attr { 36 enum hrt_userptr_type type; 37 unsigned int pgnr; 38}; 39 40void hrt_isp_css_mm_set_user_ptr(void *userptr, 41 unsigned int num_pages, enum hrt_userptr_type); 42 43/* Allocate memory, returns a virtual address */ 44ia_css_ptr hrt_isp_css_mm_alloc(size_t bytes); 45ia_css_ptr hrt_isp_css_mm_alloc_user_ptr(size_t bytes, void *userptr, 46 unsigned int num_pages, 47 enum hrt_userptr_type, 48 bool cached); 49ia_css_ptr hrt_isp_css_mm_alloc_cached(size_t bytes); 50 51/* allocate memory and initialize with zeros, 52 returns a virtual address */ 53ia_css_ptr hrt_isp_css_mm_calloc(size_t bytes); 54ia_css_ptr hrt_isp_css_mm_calloc_cached(size_t bytes); 55 56#endif /* _hive_isp_css_mm_hrt_h_ */ 57