Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cecf1a19 authored by Shilpa Mamidi's avatar Shilpa Mamidi Committed by Gerrit - the friendly Code Review server
Browse files

msm: cpp: Handling GET_INST_INFO ioctl for 64 bit kernel



Added support to handle VIDIOC_MSM_CPP_GET_INST_INFO for
64 bit kernel

Change-Id: If1468e4bf4dc3f6a981bd3bf799c72fd02718608
Signed-off-by: default avatarShilpa Mamidi <shilpam@codeaurora.org>
parent 5d471678
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
@@ -2506,6 +2506,28 @@ static long msm_cpp_subdev_fops_compat_ioctl(struct file *file,
	case VIDIOC_MSM_CPP_LOAD_FIRMWARE32:
		cmd = VIDIOC_MSM_CPP_LOAD_FIRMWARE;
		break;
	case VIDIOC_MSM_CPP_GET_INST_INFO32:
	{
		struct cpp_device *cpp_dev = v4l2_get_subdevdata(sd);
		struct msm_cpp_frame_info32_t inst_info;
		struct v4l2_fh *vfh = NULL;
		uint32_t i;
		vfh = file->private_data;
		memset(&inst_info, 0, sizeof(struct msm_cpp_frame_info32_t));
		for (i = 0; i < MAX_ACTIVE_CPP_INSTANCE; i++) {
			if (cpp_dev->cpp_subscribe_list[i].vfh == vfh) {
				inst_info.inst_id = i;
				break;
			}
		}
		if (copy_to_user(
				(void __user *)kp_ioctl.ioctl_ptr, &inst_info,
				sizeof(struct msm_cpp_frame_info32_t))) {
			return -EINVAL;
		}
		cmd = VIDIOC_MSM_CPP_GET_INST_INFO;
		break;
	}
	case VIDIOC_MSM_CPP_FLUSH_QUEUE32:
		cmd = VIDIOC_MSM_CPP_FLUSH_QUEUE;
		break;
@@ -2647,6 +2669,7 @@ static long msm_cpp_subdev_fops_compat_ioctl(struct file *file,
	case VIDIOC_MSM_CPP_GET_HW_INFO:
	case VIDIOC_MSM_CPP_CFG:
	case VIDIOC_MSM_CPP_GET_EVENTPAYLOAD:
	case VIDIOC_MSM_CPP_GET_INST_INFO:
		break;
	default:
		pr_err_ratelimited("%s: unsupported compat type :%d\n",