media: atomisp: get rid of memory_access.c
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 26 May 2020 06:40:16 +0000 (08:40 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 11 Jun 2020 16:08:30 +0000 (18:08 +0200)
Now that we have everything in place, we can get rid of the
memory_access abstraction layer.

Now, everything related to heterogeneous memory management
(hmm) is under hmm.c & related pools.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
30 files changed:
drivers/staging/media/atomisp/Makefile
drivers/staging/media/atomisp/include/hmm/hmm.h
drivers/staging/media/atomisp/pci/atomisp_acc.c
drivers/staging/media/atomisp/pci/atomisp_fops.c
drivers/staging/media/atomisp/pci/base/refcount/src/refcount.c
drivers/staging/media/atomisp/pci/hive_isp_css_common/host/debug.c
drivers/staging/media/atomisp/pci/hive_isp_css_common/host/debug_private.h
drivers/staging/media/atomisp/pci/hive_isp_css_include/memory_access/memory_access.h [deleted file]
drivers/staging/media/atomisp/pci/ia_css_memory_access.c [deleted file]
drivers/staging/media/atomisp/pci/isp/kernels/bh/bh_2/ia_css_bh.host.c
drivers/staging/media/atomisp/pci/isp/kernels/dvs/dvs_1.0/ia_css_dvs.host.c
drivers/staging/media/atomisp/pci/isp/kernels/raw_aa_binning/raw_aa_binning_1.0/ia_css_raa.host.c
drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c
drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_2/ia_css_sdis2.host.c
drivers/staging/media/atomisp/pci/mmu/sh_mmu_mrfld.c
drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c
drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c
drivers/staging/media/atomisp/pci/runtime/event/src/event.c
drivers/staging/media/atomisp/pci/runtime/frame/src/frame.c
drivers/staging/media/atomisp/pci/runtime/isp_param/src/isp_param.c
drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c
drivers/staging/media/atomisp/pci/runtime/queue/src/queue_access.c
drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c
drivers/staging/media/atomisp/pci/runtime/spctrl/src/spctrl.c
drivers/staging/media/atomisp/pci/sh_css.c
drivers/staging/media/atomisp/pci/sh_css_firmware.c
drivers/staging/media/atomisp/pci/sh_css_mmu.c
drivers/staging/media/atomisp/pci/sh_css_param_dvs.c
drivers/staging/media/atomisp/pci/sh_css_params.c
drivers/staging/media/atomisp/pci/sh_css_sp.c

index 4a77d6d6910d4c4e14506aff028d9eb92d52f0f8..01764c487b520bf6434a44f78c18732178ad2bdc 100644 (file)
@@ -54,7 +54,6 @@ atomisp-objs += \
        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 \
index a661c039a2cca724c869ece0ca1ff4ebf543ce70..5d725a6b6e10235414749a69f1b36615372ab8b7 100644 (file)
@@ -28,6 +28,9 @@
 #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);
 
index 5e7f4cd47c8f26cfd0bba61f85032dcbcf5299ec..8633afdc3f390548e47ddb4d32f43a01f8eefd89 100644 (file)
 #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 {
index fc3043bded4631b887b30be5c36efb1f1a4ed37b..1588e84a6b91996906050a72ac51529dc839b454 100644 (file)
@@ -36,7 +36,6 @@
 
 #include "type_support.h"
 #include "device_access/device_access.h"
-#include "memory_access/memory_access.h"
 
 #include "atomisp_acc.h"
 
index 52c40aaa1e5250bed28083ba4d373682cbad92e1..1616f3a38ddd7a16a2087c6bc255c212d93d71b1 100644 (file)
@@ -12,8 +12,9 @@
  * 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"
index 3a5414b8912a3cfc8a636e853b1c303494d671c9..85b054c5ec803292423301f8f505d58c53196d47 100644 (file)
 
 #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"
index f2f5b765881986968e465a14d0376e08fd83b47a..0b107ee13072f08573c99e1bea264ea4f9a1671a 100644 (file)
@@ -22,7 +22,6 @@
 #define __INLINE_ISP__
 #include "isp.h"
 
-#include "memory_access.h"
 
 #include "assert_support.h"
 
diff --git a/drivers/staging/media/atomisp/pci/hive_isp_css_include/memory_access/memory_access.h b/drivers/staging/media/atomisp/pci/hive_isp_css_include/memory_access/memory_access.h
deleted file mode 100644 (file)
index 8559b50..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * 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__ */
diff --git a/drivers/staging/media/atomisp/pci/ia_css_memory_access.c b/drivers/staging/media/atomisp/pci/ia_css_memory_access.c
deleted file mode 100644 (file)
index 79048e1..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * 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);
-}
index 6c7aa51ec079d30ab708310aa5d930eec82dde82..4f1efd6db536ca56c0d06475c9b3e935035008e6 100644 (file)
@@ -14,7 +14,6 @@
 
 #if !defined(HAS_NO_HMEM)
 
-#include "memory_access.h"
 #include "ia_css_types.h"
 #include "sh_css_internal.h"
 #include "assert_support.h"
index 775a0009e1b6415d39bff9856c2572055728d172..4dd0b0373e79d97c06d61108548f735f703f692a 100644 (file)
@@ -12,6 +12,8 @@
  * more details.
  */
 
+#include "hmm.h"
+
 #include "ia_css_frame_public.h"
 #define IA_CSS_INCLUDE_CONFIGURATIONS
 #include "ia_css_isp_configs.h"
@@ -22,7 +24,6 @@
 #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"
index 2045b974ec8abc9ee6f63bc3cf35fd22164125e6..5aaa018370efd7edf182c7bdf5153fd52e40a549 100644 (file)
@@ -14,7 +14,6 @@
 
 #if !defined(HAS_NO_HMEM)
 
-#include "memory_access.h"
 #include "ia_css_types.h"
 #include "sh_css_internal.h"
 #include "sh_css_frac.h"
index fb0e6dcbca43ca1c7dec8b11567c5af272e76314..dfd621d3f6dad170fb317a6018548fd1b695dbe8 100644 (file)
@@ -12,7 +12,8 @@
  * more details.
  */
 
-#include "memory_access.h"
+#include "hmm.h"
+
 #include "assert_support.h"
 #include "ia_css_debug.h"
 #include "ia_css_sdis_types.h"
@@ -329,7 +330,7 @@ ia_css_isp_dvs_statistics_allocate(
                            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;
index b9c7736baa44250c4a150327df3c8a91fd4c9121..ca34299b799887441d1c44296d464a081a5a6ecf 100644 (file)
@@ -12,8 +12,9 @@
  * more details.
  */
 
+#include "hmm.h"
+
 #include <assert_support.h>
-#include "memory_access.h"
 #include "ia_css_debug.h"
 #include "ia_css_sdis2.host.h"
 
@@ -295,7 +296,7 @@ ia_css_isp_dvs2_statistics_allocate(
               * 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;
index 031d7fa00510503d1a390515cd51bc8afa18b3e4..0f55978ad2bdc2f49a912f6cf9c4dc29f61f385d 100644 (file)
@@ -19,7 +19,6 @@
 #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
index 2a23b7c6aeebec822d4703088d1bd4a1ddfd2a97..c7083d9b3f10ec7f4a44c38be22af5ec1a3ad3ab 100644 (file)
@@ -14,6 +14,9 @@
 
 #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"
@@ -33,7 +36,6 @@
 
 #include "camera/pipe/interface/ia_css_pipe_binarydesc.h"
 
-#include "memory_access.h"
 
 #include "assert_support.h"
 
index 7784e39869a62e9ee045aa275e89e04fe9a3b914..c46621315e7be57f88288b766d07eb8cfb58f208 100644 (file)
@@ -13,7 +13,6 @@
  */
 
 #include "debug.h"
-#include "memory_access.h"
 
 #ifndef __INLINE_INPUT_SYSTEM__
 #define __INLINE_INPUT_SYSTEM__
@@ -2490,7 +2489,7 @@ void ia_css_debug_dump_perf_counters(void)
 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;
 
index c4578470ad8cc14b8daac2b640724bfbe504faf1..4bbed9ee2e351cff22a323687eaf281ea794b5ed 100644 (file)
@@ -29,7 +29,6 @@
 
 /*#include "sp.h"*/    /* host2sp_enqueue_frame_data() */
 
-#include "memory_access.h"
 
 #include "assert_support.h"
 #include "platform_support.h"  /* hrt_sleep() */
index 9a9c1fffd3d9ea3919c4d98b27c74b2251c2fe79..c7d15a01ec9aecbafd8c6097826fe9a7805775f5 100644 (file)
  * 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
@@ -170,20 +171,23 @@ enum ia_css_err ia_css_frame_map(struct ia_css_frame **frame,
                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;
@@ -797,9 +801,10 @@ static enum ia_css_err frame_allocate_buffer_data(struct ia_css_frame *frame)
 #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;
index 8646000fabd423f46de1db7d3c79947b8f41c705..6f7c21bbe62d5284543a7e70610d600c2a53d2d0 100644 (file)
@@ -12,7 +12,8 @@
  * more details.
  */
 
-#include "memory_access.h"
+#include "hmm.h"
+
 #include "ia_css_pipeline.h"
 #include "ia_css_isp_param.h"
 
@@ -127,7 +128,7 @@ ia_css_isp_param_allocate_isp_parameters(
                                        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;
index 8b9982de8deb9b51d364da04376f118c1297c9cc..f65d7491abd9694b893d9cb7d68f03cafa81e543 100644 (file)
  * 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"
index a2f7bacd42067eac7e087769f6b4a78c110ac4f5..ba7219644256ed6dce4fa0717c8375dd51367487 100644 (file)
  * 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(
index 714b8099e54480a91d6fc1af48ecfac023452be7..546988a1a42ef3e9e38d3eb333b7ae2725b88a0e 100644 (file)
  * 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>
 
 /*
@@ -297,7 +297,7 @@ void ia_css_rmgr_acq_vbuf(struct ia_css_rmgr_vbuf_pool *pool,
                        }
                        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;
index 142f181d1e5580967f7b6b4ac5e42eae71110acc..d361ccdd70e8a255c7ee1bf47746330056504020 100644 (file)
  * 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"
@@ -63,7 +64,7 @@ enum ia_css_err ia_css_spctrl_load_fw(sp_ID_t sp_id,
         * 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);
index a94d60819204b128e94b761797ebbd95d2ced095..4860f768349e6fdad0eb5671c2a5ac8a9ecb559c 100644 (file)
@@ -17,6 +17,8 @@
 #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"
@@ -52,7 +54,6 @@
 #include "ia_css_isys.h"
 #endif
 
-#include "memory_access.h"
 #include "tag.h"
 #include "assert_support.h"
 #include "math_support.h"
index e189d59783f8bdd37c0a940f4cac2eb8e4278eaf..ee23d28b1bef9fd2de21b1f7c1b1cb6546dfd848 100644 (file)
@@ -15,6 +15,8 @@
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
 
+#include "hmm.h"
+
 #include <math_support.h>
 #include "platform_support.h"
 #include "sh_css_firmware.h"
@@ -24,7 +26,6 @@
 #include "sh_css_internal.h"
 #include "ia_css_isp_param.h"
 
-#include "memory_access.h"
 #include "assert_support.h"
 #include "string_support.h"
 
@@ -322,7 +323,7 @@ void sh_css_unload_firmware(void)
 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. */
 
index 179b6f40be49423b55504565062caea824237f90..4965a9e5e161a3954dcd7f918651a74c5ea1ab72 100644 (file)
@@ -43,7 +43,6 @@ ia_css_mmu_invalidate_cache(void)
                            "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)
 {
index 52e29161cb355231c5d02a8e9c6d03c689d916c0..025f26a40062b91580865aecd7be2a17bbc03091 100644 (file)
@@ -18,7 +18,6 @@
 #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,
index 7bd2fd0124cbff86c8c15813e4bf811716ec7f85..f1b543a6db82f71356f030a2a97dd50802220434 100644 (file)
@@ -24,6 +24,7 @@
 #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 */
@@ -45,7 +46,6 @@
 #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"
@@ -2734,8 +2734,10 @@ static bool realloc_isp_css_mm_buf(
 
        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;
@@ -2800,7 +2802,7 @@ ia_css_isp_3a_statistics_allocate(const struct ia_css_3a_grid_info *grid)
        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;
@@ -2850,7 +2852,7 @@ ia_css_metadata_allocate(const struct ia_css_metadata_info *metadata_info)
 
        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;
 
@@ -3007,13 +3009,13 @@ sh_css_create_isp_params(struct ia_css_stream *stream,
        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;
@@ -3264,12 +3266,14 @@ sh_css_params_init(void) {
                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)) {
@@ -3286,12 +3290,14 @@ sh_css_params_init(void) {
        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))
@@ -3315,7 +3321,7 @@ static void host_lut_store(const void *lut)
 /* 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)
@@ -3355,7 +3361,7 @@ enum ia_css_err ia_css_pipe_set_bci_scaler_lut(struct ia_css_pipe *pipe,
 
        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();
 
@@ -3400,7 +3406,7 @@ enum ia_css_err sh_css_params_map_and_store_default_gdc_lut(void)
        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();
 
@@ -4540,7 +4546,7 @@ static enum ia_css_err write_ia_css_isp_parameter_set_info_to_ddr(
        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,
index 9a80968f115a9be7eb52a0a25afdcaf9691593bd..1ed060d6d855462a958b0ea4ebd8a0fc1b42323b 100644 (file)
@@ -12,6 +12,8 @@
  * more details.
  */
 
+#include "hmm.h"
+
 #include "sh_css_sp.h"
 
 #if !defined(HAS_NO_INPUT_FORMATTER)
@@ -43,7 +45,6 @@
 
 /*#include "sp.h"*/    /* host2sp_enqueue_frame_data() */
 
-#include "memory_access.h"
 
 #include "assert_support.h"
 #include "platform_support.h"  /* hrt_sleep() */