Commit 23239943 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

media: atomisp: simplify hive_isp_css_mm_hrt wrapper



The code there is a wrapper for hmm/ wrapper. Simplify it,
and get rid of ION-specific code.

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 02ab7649
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -327,11 +327,6 @@ INCLUDES_cht += \
#	-I$(atomisp)/pci/css_2401_system/hrt/ \
#	-I$(atomisp)/pci/css_2401_system/hive_isp_css_2401_system_generated/ \


ifeq ($(CONFIG_ION),y)
INCLUDES += -I$(srctree)/drivers/staging/android/ion
endif

DEFINES := -DHRT_HW -DHRT_ISP_CSS_CUSTOM_HOST -DHRT_USE_VIR_ADDRS -D__HOST__
#DEFINES += -DUSE_DYNAMIC_BIN
#DEFINES += -DISP_POWER_GATING
+0 −9
Original line number Diff line number Diff line
@@ -77,9 +77,6 @@ enum hmm_bo_type {
	HMM_BO_PRIVATE,
	HMM_BO_SHARE,
	HMM_BO_USER,
#ifdef CONFIG_ION
	HMM_BO_ION,
#endif
	HMM_BO_LAST,
};

@@ -111,9 +108,6 @@ struct hmm_bo_device {

	/* list lock is used to protect the entire_bo_list */
	spinlock_t	list_lock;
#ifdef CONFIG_ION
	struct ion_client	*iclient;
#endif
	int flag;

	/* linked list for entire buffer object */
@@ -142,9 +136,6 @@ struct hmm_buffer_object {
	struct hmm_page_object	*page_obj;	/* physical pages */
	int		from_highmem;
	int		mmap_count;
#ifdef CONFIG_ION
	struct ion_handle	*ihandle;
#endif
	int		status;
	int		mem_type;
	void		*vmap_addr; /* kernel virtual address by vmap */
+1 −1
Original line number Diff line number Diff line
@@ -355,7 +355,7 @@ 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, HRT_USR_PTR,
						       pgnr,
						       (map->flags & ATOMISP_MAP_FLAG_CACHED));
	} else {
		/* Allocate private buffer. */
+0 −35
Original line number Diff line number Diff line
@@ -1205,41 +1205,6 @@ static int atomisp_qbuf(struct file *file, void *fh, struct v4l2_buffer *buf)
		}

		attributes.pgnr = pgnr;
		attributes.type = HRT_USR_PTR;
#ifdef CONFIG_ION
		if (!atomisp_hw_is_isp2401) {
			if (buf->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_ION)
					attributes.type = HRT_USR_ION;
		} else {
			if (buf->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_ION) {
				attributes.type = HRT_USR_ION;
				if (asd->ion_dev_fd->val !=  ION_FD_UNSET) {
					dev_dbg(isp->dev, "ION buffer queued, share_fd=%lddev_fd=%d.\n",
						buf->m.userptr, asd->ion_dev_fd->val);
					/*
					* Make sure the shared fd we just got
					* from user space isn't larger than
					* the space we have for it.
					*/
					if ((buf->m.userptr &
					    (ATOMISP_ION_DEVICE_FD_MASK)) != 0) {
						dev_err(isp->dev,
							"Error: v4l2 buffer fd:0X%0lX > 0XFFFF.\n",
							buf->m.userptr);
						ret = -EINVAL;
						goto error;
					}
					buf->m.userptr |= asd->ion_dev_fd->val <<
							ATOMISP_ION_DEVICE_FD_OFFSET;
				} else {
					dev_err(isp->dev, "v4l2 buffer type is ION, \
							but no dev fd set from userspace.\n");
					ret = -EINVAL;
					goto error;
				}
			}
		}
#endif
		ret = atomisp_css_frame_map(&handle, &frame_info,
					    (void __user *)buf->m.userptr,
					    0, &attributes);
+0 −5
Original line number Diff line number Diff line
@@ -1223,11 +1223,6 @@ static int isp_subdev_init_entities(struct atomisp_sub_device *asd)
		asd->select_isp_version = v4l2_ctrl_new_custom(&asd->ctrl_handler,
							       &ctrl_select_isp_version,
							       NULL);
#if 0 /* #ifdef CONFIG_ION */
		asd->ion_dev_fd = v4l2_ctrl_new_custom(&asd->ctrl_handler,
						       &ctrl_ion_dev_fd,
						       NULL);
#endif
	}

	/* Make controls visible on subdev as well. */
Loading