pci/hmm/hmm.o \
pci/hmm/hmm_reserved_pool.o \
pci/ia_css_device_access.o \
- pci/ia_css_memory_access.o \
pci/isp/kernels/aa/aa_2/ia_css_aa2.host.o \
pci/isp/kernels/anr/anr_1.0/ia_css_anr.host.o \
pci/isp/kernels/anr/anr_2/ia_css_anr2.host.o \
#include "hmm/hmm_pool.h"
#include "ia_css_types.h"
+#define mmgr_NULL ((ia_css_ptr)0)
+#define mmgr_EXCEPTION ((ia_css_ptr)-1)
+
int hmm_pool_register(unsigned int pool_size, enum hmm_pool_type pool_type);
void hmm_pool_unregister(enum hmm_pool_type pool_type);
#include <linux/init.h>
#include <media/v4l2-event.h>
+#include "hmm.h"
+
#include "atomisp_acc.h"
#include "atomisp_internal.h"
#include "atomisp_compat.h"
#include "atomisp_cmd.h"
-#include "memory_access/memory_access.h"
#include "ia_css.h"
static const struct {
#include "type_support.h"
#include "device_access/device_access.h"
-#include "memory_access/memory_access.h"
#include "atomisp_acc.h"
* more details.
*/
+#include "hmm.h"
+
#include "ia_css_refcount.h"
-#include "memory_access/memory_access.h"
#include "sh_css_defs.h"
#include "platform_support.h"
#include "debug.h"
+#include "hmm.h"
+
#ifndef __INLINE_DEBUG__
#include "debug_private.h"
#endif /* __INLINE_DEBUG__ */
-#include "memory_access.h"
#define __INLINE_SP__
#include "sp.h"
#define __INLINE_ISP__
#include "isp.h"
-#include "memory_access.h"
#include "assert_support.h"
+++ /dev/null
-/*
- * Support for Intel Camera Imaging ISP subsystem.
- * Copyright (c) 2015-2017, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- */
-
-#ifndef __MEMORY_ACCESS_H_INCLUDED__
-#define __MEMORY_ACCESS_H_INCLUDED__
-
-/*!
- * \brief
- * Define the public interface for virtual memory
- * access functions. Access types are limited to
- * those defined in <stdint.h>
- *
- * The address representation is private to the system
- * and represented as "ia_css_ptr" rather than a
- * pointer, as the memory allocation cannot be accessed
- * by dereferencing but reaquires load and store access
- * functions
- *
- * The page table selection or virtual memory context;
- * The page table base index; Is implicit. This page
- * table base index must be set by the implementation
- * of the access function
- *
- * "store" is a transfer to the system
- * "load" is a transfer from the system
- *
- * Allocation properties can be specified by setting
- * attributes (see below) in case of multiple physical
- * memories the memory ID is encoded on the attribute
- *
- * Allocations in the same physical memory, but in a
- * different (set of) page tables can be shared through
- * a page table information mapping function
- */
-
-#include <type_support.h>
-#include "platform_support.h" /* for __func__ */
-
-/*
- * User provided file that defines the (sub)system address types:
- * - ia_css_ptr a type that can hold the (sub)system virtual address range
- */
-#include "system_types.h"
-
-/*
- * The MMU base address is a physical address, thus the same type is used
- * as for the device base address
- */
-#include "device_access.h"
-
-#include "hmm/hmm.h"
-
-/*!
- * \brief
- * Bit masks for specialised allocation functions
- * the default is "uncached", "not contiguous",
- * "not page aligned" and "not cleared"
- *
- * Forcing alignment (usually) returns a pointer
- * at an alignment boundary that is offset from
- * the allocated pointer. Without storing this
- * pointer/offset, we cannot free it. The memory
- * manager is responsible for the bookkeeping, e.g.
- * the allocation function creates a sentinel
- * within the allocation referencable from the
- * returned pointer/address.
- */
-
-#define mmgr_NULL ((ia_css_ptr)0)
-#define mmgr_EXCEPTION ((ia_css_ptr)-1)
-
-/*! Return the address of an allocation in memory
-
- \param size[in] Size in bytes of the allocation
- \param attribute[in] Bit vector specifying the properties
- of the allocation including zero initialisation
-
- \return vaddress
- */
-
-ia_css_ptr mmgr_alloc_attr(const size_t size, const uint16_t attribute);
-
-#endif /* __MEMORY_ACCESS_H_INCLUDED__ */
+++ /dev/null
-/*
- * Support for Intel Camera Imaging ISP subsystem.
- * Copyright (c) 2015-2017, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- */
-
-#include <memory_access.h>
-
-ia_css_ptr mmgr_alloc_attr(const size_t size, const uint16_t attrs)
-{
- return hmm_alloc(size, HMM_BO_PRIVATE, 0, NULL, attrs);
-}
#if !defined(HAS_NO_HMEM)
-#include "memory_access.h"
#include "ia_css_types.h"
#include "sh_css_internal.h"
#include "assert_support.h"
* more details.
*/
+#include "hmm.h"
+
#include "ia_css_frame_public.h"
#define IA_CSS_INCLUDE_CONFIGURATIONS
#include "ia_css_isp_configs.h"
#include "sh_css_params.h"
#include "ia_css_binary.h"
#include "ia_css_debug.h"
-#include "memory_access.h"
#include "assert_support.h"
#include "ia_css_dvs.host.h"
#if !defined(HAS_NO_HMEM)
-#include "memory_access.h"
#include "ia_css_types.h"
#include "sh_css_internal.h"
#include "sh_css_frac.h"
* more details.
*/
-#include "memory_access.h"
+#include "hmm.h"
+
#include "assert_support.h"
#include "ia_css_debug.h"
#include "ia_css_sdis_types.h"
HIVE_ISP_DDR_WORD_BYTES);
me->size = hor_size + ver_size;
- me->data_ptr = mmgr_alloc_attr(me->size, 0);
+ me->data_ptr = hmm_alloc(me->size, HMM_BO_PRIVATE, 0, NULL, 0);
if (me->data_ptr == mmgr_NULL)
goto err;
me->hor_size = hor_size;
* more details.
*/
+#include "hmm.h"
+
#include <assert_support.h>
-#include "memory_access.h"
#include "ia_css_debug.h"
#include "ia_css_sdis2.host.h"
* grid->aligned_height * IA_CSS_DVS2_NUM_COEF_TYPES;
me->size = 2 * size;
- me->data_ptr = mmgr_alloc_attr(me->size, 0);
+ me->data_ptr = hmm_alloc(me->size, HMM_BO_PRIVATE, 0, NULL, 0);
if (me->data_ptr == mmgr_NULL)
goto err;
me->hor_proj = me->data_ptr;
#include "type_support.h"
#include "mmu/isp_mmu.h"
#include "mmu/sh_mmu_mrfld.h"
-#include "memory_access/memory_access.h"
#include "atomisp_compat.h"
#define MERR_VALID_PTE_MASK 0x80000000
#include <math_support.h>
#include <gdc_device.h> /* HR_GDC_N */
+
+#include "hmm.h"
+
#include "isp.h" /* ISP_VEC_NELEMS */
#include "ia_css_binary.h"
#include "camera/pipe/interface/ia_css_pipe_binarydesc.h"
-#include "memory_access.h"
#include "assert_support.h"
*/
#include "debug.h"
-#include "memory_access.h"
#ifndef __INLINE_INPUT_SYSTEM__
#define __INLINE_INPUT_SYSTEM__
void sh_css_init_ddr_debug_queue(void)
{
ia_css_ptr ddr_debug_queue_addr =
- mmgr_alloc_attr(sizeof(debug_data_ddr_t), 0);
+ hmm_alloc(sizeof(debug_data_ddr_t), HMM_BO_PRIVATE, 0, NULL, 0);
const struct ia_css_fw_info *fw;
unsigned int HIVE_ADDR_debug_buffer_ddr_address;
/*#include "sp.h"*/ /* host2sp_enqueue_frame_data() */
-#include "memory_access.h"
#include "assert_support.h"
#include "platform_support.h" /* hrt_sleep() */
* more details.
*/
+#include "hmm.h"
+
#include "ia_css_frame.h"
#include <math_support.h>
#include "assert_support.h"
#include "ia_css_debug.h"
#include "isp.h"
#include "sh_css_internal.h"
-#include "memory_access.h"
#include "atomisp_internal.h"
#define NV12_TILEY_TILE_WIDTH 128
if (pgnr < ((PAGE_ALIGN(me->data_bytes)) >> PAGE_SHIFT)) {
dev_err(atomisp_dev,
"user space memory size is less than the expected size..\n");
- return -ENOMEM;
+ err = -ENOMEM;
+ goto error;
} else if (pgnr > ((PAGE_ALIGN(me->data_bytes)) >> PAGE_SHIFT)) {
dev_err(atomisp_dev,
"user space memory size is large than the expected size..\n");
- return -ENOMEM;
+ err = -ENOMEM;
+ goto error;
}
- return hmm_alloc(me->data_bytes, HMM_BO_USER, 0, data,
- attribute & ATOMISP_MAP_FLAG_CACHED);
+ me->data = hmm_alloc(me->data_bytes, HMM_BO_USER, 0, data,
+ attribute & ATOMISP_MAP_FLAG_CACHED);
if (me->data == mmgr_NULL)
err = IA_CSS_ERR_INVALID_ARGUMENTS;
}
+error:
if (err != IA_CSS_SUCCESS) {
sh_css_free(me);
me = NULL;
#ifdef ISP2401
IA_CSS_ENTER_LEAVE_PRIVATE("frame->data_bytes=%d\n", frame->data_bytes);
#endif
- frame->data = mmgr_alloc_attr(frame->data_bytes,
- frame->contiguous ?
- ATOMISP_MAP_FLAG_CONTIGUOUS : 0);
+ frame->data = hmm_alloc(frame->data_bytes,
+ HMM_BO_PRIVATE, 0, NULL,
+ frame->contiguous ?
+ ATOMISP_MAP_FLAG_CONTIGUOUS : 0);
if (frame->data == mmgr_NULL)
return IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
* more details.
*/
-#include "memory_access.h"
+#include "hmm.h"
+
#include "ia_css_pipeline.h"
#include "ia_css_isp_param.h"
goto cleanup;
}
if (pclass != IA_CSS_PARAM_CLASS_PARAM) {
- css_params->params[pclass][mem].address = mmgr_alloc_attr(size, 0);
+ css_params->params[pclass][mem].address = hmm_alloc(size, HMM_BO_PRIVATE, 0, NULL, 0);
if (!css_params->params[pclass][mem].address) {
err = IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
goto cleanup;
* more details.
*/
+#include "hmm.h"
+
#include "ia_css_debug.h"
#include "sw_event_global.h" /* encode_sw_event */
#include "sp.h" /* cnd_sp_irq_enable() */
#include "assert_support.h"
-#include "memory_access.h"
#include "sh_css_sp.h"
#include "ia_css_pipeline.h"
#include "ia_css_isp_param.h"
* more details.
*/
+#include "hmm.h"
+
#include "type_support.h"
#include "queue_access.h"
#include "ia_css_circbuf.h"
#include "sp.h"
-#include "memory_access.h"
#include "assert_support.h"
int ia_css_queue_load(
* more details.
*/
+#include "hmm.h"
#include "ia_css_rmgr.h"
#include <type_support.h>
#include <assert_support.h>
#include <platform_support.h> /* memset */
-#include <memory_access.h> /* mmmgr_alloc_attr */
#include <ia_css_debug.h>
/*
}
if ((*handle)->vptr == 0x0) {
/* we need to allocate */
- (*handle)->vptr = mmgr_alloc_attr((*handle)->size, 0);
+ (*handle)->vptr = hmm_alloc((*handle)->size, HMM_BO_PRIVATE, 0, NULL, 0);
} else {
/* we popped a buffer */
return;
* more details.
*/
+#include "hmm.h"
+
#include "ia_css_types.h"
#define __INLINE_SP__
#include "sp.h"
-#include "memory_access.h"
#include "assert_support.h"
#include "ia_css_spctrl.h"
#include "ia_css_debug.h"
* Data used to be stored separately, because of access alignment constraints,
* fix the FW generation instead
*/
- code_addr = mmgr_alloc_attr(spctrl_cfg->code_size, 0);
+ code_addr = hmm_alloc(spctrl_cfg->code_size, HMM_BO_PRIVATE, 0, NULL, 0);
if (code_addr == mmgr_NULL)
return IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
hmm_store(code_addr, spctrl_cfg->code, spctrl_cfg->code_size);
#include <linux/slab.h>
#include <linux/vmalloc.h>
+#include "hmm.h"
+
#include "ia_css.h"
#include "sh_css_hrt.h" /* only for file 2 MIPI */
#include "ia_css_buffer.h"
#include "ia_css_isys.h"
#endif
-#include "memory_access.h"
#include "tag.h"
#include "assert_support.h"
#include "math_support.h"
#include <linux/slab.h>
#include <linux/vmalloc.h>
+#include "hmm.h"
+
#include <math_support.h>
#include "platform_support.h"
#include "sh_css_firmware.h"
#include "sh_css_internal.h"
#include "ia_css_isp_param.h"
-#include "memory_access.h"
#include "assert_support.h"
#include "string_support.h"
ia_css_ptr
sh_css_load_blob(const unsigned char *blob, unsigned int size)
{
- ia_css_ptr target_addr = mmgr_alloc_attr(size, 0);
+ ia_css_ptr target_addr = hmm_alloc(size, HMM_BO_PRIVATE, 0, NULL, 0);
/* this will allocate memory aligned to a DDR word boundary which
is required for the CSS DMA to read the instructions. */
"ia_css_mmu_invalidate_cache() leave\n");
}
-/* Deprecated, this is an HRT backend function (memory_access.h) */
void
sh_css_mmu_set_page_table_base_index(hrt_data base_index)
{
#include <ia_css_err.h>
#include <ia_css_types.h>
#include "ia_css_debug.h"
-#include "memory_access.h"
static struct ia_css_dvs_6axis_config *
alloc_dvs_6axis_table(const struct ia_css_resolution *frame_res,
#define IA_CSS_INCLUDE_PARAMETERS
#define IA_CSS_INCLUDE_ACC_PARAMETERS
+#include "hmm.h"
#include "sh_css_params.h"
#include "ia_css_queue.h"
#include "sw_event_global.h" /* Event IDs */
#include "sh_css_sp.h"
#include "ia_css_pipeline.h"
#include "ia_css_debug.h"
-#include "memory_access.h"
#include "ia_css_isp_param.h"
#include "ia_css_isp_params.h"
id = IA_CSS_REFCOUNT_PARAM_BUFFER;
ia_css_refcount_decrement(id, *curr_buf);
- *curr_buf = ia_css_refcount_increment(id, mmgr_alloc_attr(needed_size,
- mmgr_attribute));
+ *curr_buf = ia_css_refcount_increment(id, hmm_alloc(needed_size,
+ HMM_BO_PRIVATE, 0,
+ NULL,
+ mmgr_attribute));
if (!*curr_buf) {
*err = IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
me->hmem_size = CEIL_MUL(me->hmem_size, HIVE_ISP_DDR_WORD_BYTES);
me->size = me->dmem_size + me->vmem_size * 2 + me->hmem_size;
- me->data_ptr = mmgr_alloc_attr(me->size, 0);
+ me->data_ptr = hmm_alloc(me->size, HMM_BO_PRIVATE, 0, NULL, 0);
if (me->data_ptr == mmgr_NULL) {
sh_css_free(me);
me = NULL;
md->info = *metadata_info;
md->exp_id = 0;
- md->address = mmgr_alloc_attr(metadata_info->size, 0);
+ md->address = hmm_alloc(metadata_info->size, HMM_BO_PRIVATE, 0, NULL, 0);
if (md->address == mmgr_NULL)
goto error;
ddr_ptrs_size->isp_param = params_size;
ddr_ptrs->isp_param =
ia_css_refcount_increment(IA_CSS_REFCOUNT_PARAM_BUFFER,
- mmgr_alloc_attr(params_size, 0));
+ hmm_alloc(params_size, HMM_BO_PRIVATE, 0, NULL, 0));
succ &= (ddr_ptrs->isp_param != mmgr_NULL);
ddr_ptrs_size->macc_tbl = sizeof(struct ia_css_macc_table);
ddr_ptrs->macc_tbl =
ia_css_refcount_increment(IA_CSS_REFCOUNT_PARAM_BUFFER,
- mmgr_alloc_attr(sizeof(struct ia_css_macc_table), 0));
+ hmm_alloc(sizeof(struct ia_css_macc_table), HMM_BO_PRIVATE, 0, NULL, 0));
succ &= (ddr_ptrs->macc_tbl != mmgr_NULL);
*isp_params_out = params;
for (i = 0; i < SH_CSS_MAX_STAGES; i++) {
xmem_sp_stage_ptrs[p][i] =
ia_css_refcount_increment(-1,
- mmgr_alloc_attr(sizeof(struct sh_css_sp_stage),
- ATOMISP_MAP_FLAG_CLEARED));
+ hmm_alloc(sizeof(struct sh_css_sp_stage),
+ HMM_BO_PRIVATE, 0, NULL,
+ ATOMISP_MAP_FLAG_CLEARED));
xmem_isp_stage_ptrs[p][i] =
ia_css_refcount_increment(-1,
- mmgr_alloc_attr(sizeof(struct sh_css_sp_stage),
- ATOMISP_MAP_FLAG_CLEARED));
+ hmm_alloc(sizeof(struct sh_css_sp_stage),
+ HMM_BO_PRIVATE, 0, NULL,
+ ATOMISP_MAP_FLAG_CLEARED));
if ((xmem_sp_stage_ptrs[p][i] == mmgr_NULL) ||
(xmem_isp_stage_ptrs[p][i] == mmgr_NULL)) {
ia_css_config_xnr_table();
sp_ddr_ptrs = ia_css_refcount_increment(-1,
- mmgr_alloc_attr(CEIL_MUL(sizeof(struct sh_css_ddr_address_map),
- HIVE_ISP_DDR_WORD_BYTES),
- ATOMISP_MAP_FLAG_CLEARED));
+ hmm_alloc(CEIL_MUL(sizeof(struct sh_css_ddr_address_map),
+ HIVE_ISP_DDR_WORD_BYTES),
+ HMM_BO_PRIVATE, 0, NULL,
+ ATOMISP_MAP_FLAG_CLEARED));
xmem_sp_group_ptrs = ia_css_refcount_increment(-1,
- mmgr_alloc_attr(sizeof(struct sh_css_sp_group),
- ATOMISP_MAP_FLAG_CLEARED));
+ hmm_alloc(sizeof(struct sh_css_sp_group),
+ HMM_BO_PRIVATE, 0, NULL,
+ ATOMISP_MAP_FLAG_CLEARED));
if ((sp_ddr_ptrs == mmgr_NULL) ||
(xmem_sp_group_ptrs == mmgr_NULL))
/* Note that allocation is in ipu address space. */
inline ia_css_ptr sh_css_params_alloc_gdc_lut(void)
{
- return mmgr_alloc_attr(sizeof(zoom_table), 0);
+ return hmm_alloc(sizeof(zoom_table), HMM_BO_PRIVATE, 0, NULL, 0);
}
inline void sh_css_params_free_gdc_lut(ia_css_ptr addr)
if (!stream_started) {
if (!atomisp_hw_is_isp2401)
- pipe->scaler_pp_lut = mmgr_alloc_attr(sizeof(zoom_table), 0);
+ pipe->scaler_pp_lut = hmm_alloc(sizeof(zoom_table), HMM_BO_PRIVATE, 0, NULL, 0);
else
pipe->scaler_pp_lut = sh_css_params_alloc_gdc_lut();
host_lut_store((void *)zoom_table);
if (!atomisp_hw_is_isp2401)
- default_gdc_lut = mmgr_alloc_attr(sizeof(zoom_table), 0);
+ default_gdc_lut = hmm_alloc(sizeof(zoom_table), HMM_BO_PRIVATE, 0, NULL, 0);
else
default_gdc_lut = sh_css_params_alloc_gdc_lut();
assert(out);
*out = ia_css_refcount_increment(IA_CSS_REFCOUNT_PARAM_SET_POOL,
- mmgr_alloc_attr(sizeof(struct ia_css_isp_parameter_set_info), 0));
+ hmm_alloc(sizeof(struct ia_css_isp_parameter_set_info), HMM_BO_PRIVATE, 0, NULL, 0));
succ = (*out != mmgr_NULL);
if (succ)
hmm_store(*out,
* more details.
*/
+#include "hmm.h"
+
#include "sh_css_sp.h"
#if !defined(HAS_NO_INPUT_FORMATTER)
/*#include "sp.h"*/ /* host2sp_enqueue_frame_data() */
-#include "memory_access.h"
#include "assert_support.h"
#include "platform_support.h" /* hrt_sleep() */