Commit 4fba2916 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

media: atomisp: get rid of the hrt/hive_isp_css_mm_hrt abstraction layer



Simplify the code by removing this extra memory management
abstraction layer.

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 23239943
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -53,7 +53,6 @@ atomisp-objs += \
	pci/hmm/hmm_dynamic_pool.o \
	pci/hmm/hmm.o \
	pci/hmm/hmm_reserved_pool.o \
	pci/hrt/hive_isp_css_mm_hrt.o \
	pci/ia_css_device_access.o \
	pci/ia_css_memory_access.o \
	pci/isp/kernels/aa/aa_2/ia_css_aa2.host.o \
+15 −9
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@
#include "atomisp_compat.h"
#include "atomisp_cmd.h"

#include "hrt/hive_isp_css_mm_hrt.h"
#include "memory_access/memory_access.h"
#include "ia_css.h"

@@ -353,16 +352,23 @@ int atomisp_acc_map(struct atomisp_sub_device *asd, struct atomisp_acc_map *map)
		}

		pgnr = DIV_ROUND_UP(map->length, PAGE_SIZE);
		cssptr = hrt_isp_css_mm_alloc_user_ptr(map->length,
						       map->user_ptr,
						       pgnr,
						       (map->flags & ATOMISP_MAP_FLAG_CACHED));
		if (pgnr < ((PAGE_ALIGN(map->length)) >> PAGE_SHIFT)) {
			dev_err(atomisp_dev,
				"user space memory size is less than the expected size..\n");
			return -ENOMEM;
		} else if (pgnr > ((PAGE_ALIGN(map->length)) >> PAGE_SHIFT)) {
			dev_err(atomisp_dev,
				"user space memory size is large than the expected size..\n");
			return -ENOMEM;
		}

		cssptr = hmm_alloc(map->length, HMM_BO_USER, 0, map->user_ptr,
				   map->flags & ATOMISP_MAP_FLAG_CACHED);

	} else {
		/* Allocate private buffer. */
		if (map->flags & ATOMISP_MAP_FLAG_CACHED)
			cssptr = hrt_isp_css_mm_calloc_cached(map->length);
		else
			cssptr = hrt_isp_css_mm_calloc(map->length);
		cssptr = hmm_alloc(map->length, HMM_BO_PRIVATE, 0, NULL,
				   map->flags & ATOMISP_MAP_FLAG_CACHED);
	}

	if (!cssptr)
+1 −1
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@
#include "atomisp_subdev.h"
#include "atomisp_dfs_tables.h"

#include "hrt/hive_isp_css_mm_hrt.h"
#include <hmm/hmm.h>

#include "sh_css_hrt.h"
#include "sh_css_defs.h"
+1 −1
Original line number Diff line number Diff line
@@ -261,7 +261,7 @@ void atomisp_css_frame_free(struct ia_css_frame *frame);
int atomisp_css_frame_map(struct ia_css_frame **frame,
			  const struct ia_css_frame_info *info,
			  const void __user *data, uint16_t attribute,
			  void *context);
			  unsigned int pgnr);

int atomisp_css_set_black_frame(struct atomisp_sub_device *asd,
				const struct ia_css_frame *raw_black_frame);
+2 −4
Original line number Diff line number Diff line
@@ -32,8 +32,6 @@
#include "atomisp_ioctl.h"
#include "atomisp_acc.h"

#include "hrt/hive_isp_css_mm_hrt.h"

#include <asm/intel-mid.h>

#include "ia_css_debug.h"
@@ -2187,9 +2185,9 @@ void atomisp_css_frame_free(struct ia_css_frame *frame)
int atomisp_css_frame_map(struct ia_css_frame **frame,
			  const struct ia_css_frame_info *info,
			  const void __user *data, uint16_t attribute,
			  void *context)
			  unsigned int pgnr)
{
	if (ia_css_frame_map(frame, info, data, attribute, context)
	if (ia_css_frame_map(frame, info, data, attribute, pgnr)
	    != IA_CSS_SUCCESS)
		return -ENOMEM;

Loading