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

Commit fd378b0c authored by Sridhar Gujje's avatar Sridhar Gujje
Browse files

Merge commit 'ab61fb58' into msm-4.9 - PC232



* commit 'ab61fb58':
  msm: camera: Modify interrupt handler for CCI
  msm: camera: Return error in case of secure scm call failure
  msm: camera: Correct ref count for secure fd
  msm: camera: Add extra skip after applying flash off operation
  msm: camera: icp: Use icp base while disabling A5
  msm: camera: mem: Remove lock from get_cpu_buf unless mapping
  msm: camera: fd: Fix the order of clearing and handling IRQs
  msm: camera: isp: add acquire hw handler
  msm: camera: uapi: Add new acquire/release HW IOCTLs
  msm: camera: csid: Disable CSI Rx upon fatal errors
  msm: camera: isp: Delay the change in BW during stop
  msm: camera: crm: Fix the size to copy from user in IOCTL
  msm: camera: flash: Remove regulator power up/down from early PCR
  msm: camera: flash: Remove race condition in subdev close
  msm: camera: Changes to accommodate 32-bit Arch
  msm: camera: isp: start CSID with clock rate per sensor
  msm: camera: Fix Dev contect issue on 32bit Kernel
  msm: camera: isp: Add check for rdi only usecases
  msm: camera: Block release if device is active on link
  msm: camera: core: Change log type in deinit sync object
  msm: camera: crm: Unlink devices before clearing the link
  msm: camera: fd: Add mutex protection to frame done processing

Change-Id: I74ed793f66b243f74cdbc232a0c188c91fd062cb
Signed-off-by: default avatarSridhar Gujje <sgujje@codeaurora.org>
parents a212cf53 ab61fb58
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -195,11 +195,11 @@ struct cam_cdm_hw_intf_cmd_submit_bl {
	struct cam_cdm_bl_request *data;
};

/* struct cam_cdm_hw_mem - CDM hw memory.struct */
/* struct cam_cdm_hw_mem - CDM hw memory struct */
struct cam_cdm_hw_mem {
	int32_t handle;
	uint32_t vaddr;
	uint64_t kmdvaddr;
	uintptr_t kmdvaddr;
	size_t size;
};

+3 −3
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ struct cam_cdm_bl_cmd {
	union {
		int32_t mem_handle;
		uint32_t *hw_iova;
		void *kernel_iova;
		uintptr_t kernel_iova;
	} bl_addr;
	uint32_t offset;
	uint32_t len;
+3 −4
Original line number Diff line number Diff line
/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -87,7 +87,7 @@ int cam_virtual_cdm_submit_bl(struct cam_hw_info *cdm_hw,

	mutex_lock(&client->lock);
	for (i = 0; i < req->data->cmd_arrary_count ; i++) {
		uint64_t vaddr_ptr = 0;
		uintptr_t vaddr_ptr = 0;
		size_t len = 0;

		if ((!cdm_cmd->cmd[i].len) &&
@@ -106,8 +106,7 @@ int cam_virtual_cdm_submit_bl(struct cam_hw_info *cdm_hw,
		} else if (req->data->type ==
			CAM_CDM_BL_CMD_TYPE_KERNEL_IOVA) {
			rc = 0;
			vaddr_ptr =
				(uint64_t)cdm_cmd->cmd[i].bl_addr.kernel_iova;
			vaddr_ptr = cdm_cmd->cmd[i].bl_addr.kernel_iova;
			len = cdm_cmd->cmd[i].offset + cdm_cmd->cmd[i].len;
		} else {
			CAM_ERR(CAM_CDM,
+59 −0
Original line number Diff line number Diff line
@@ -285,6 +285,36 @@ int cam_context_handle_acquire_dev(struct cam_context *ctx,
	return rc;
}

int cam_context_handle_acquire_hw(struct cam_context *ctx,
	void *args)
{
	int rc;

	if (!ctx->state_machine) {
		CAM_ERR(CAM_CORE, "Context is not ready");
		return -EINVAL;
	}

	if (!args) {
		CAM_ERR(CAM_CORE, "Invalid acquire device hw command payload");
		return -EINVAL;
	}

	mutex_lock(&ctx->ctx_mutex);
	if (ctx->state_machine[ctx->state].ioctl_ops.acquire_hw) {
		rc = ctx->state_machine[ctx->state].ioctl_ops.acquire_hw(
			ctx, args);
	} else {
		CAM_ERR(CAM_CORE, "No acquire hw for dev %s, state %d",
			ctx->dev_name, ctx->state);
		rc = -EPROTO;
	}

	mutex_unlock(&ctx->ctx_mutex);

	return rc;
}

int cam_context_handle_release_dev(struct cam_context *ctx,
	struct cam_release_dev_cmd *cmd)
{
@@ -314,6 +344,35 @@ int cam_context_handle_release_dev(struct cam_context *ctx,
	return rc;
}

int cam_context_handle_release_hw(struct cam_context *ctx,
	void *args)
{
	int rc;

	if (!ctx->state_machine) {
		CAM_ERR(CAM_CORE, "Context is not ready");
		return -EINVAL;
	}

	if (!args) {
		CAM_ERR(CAM_CORE, "Invalid release HW command payload");
		return -EINVAL;
	}

	mutex_lock(&ctx->ctx_mutex);
	if (ctx->state_machine[ctx->state].ioctl_ops.release_hw) {
		rc = ctx->state_machine[ctx->state].ioctl_ops.release_hw(
			ctx, args);
	} else {
		CAM_ERR(CAM_CORE, "No release hw for dev %s, state %d",
			ctx->dev_name, ctx->state);
		rc = -EPROTO;
	}
	mutex_unlock(&ctx->ctx_mutex);

	return rc;
}

int cam_context_handle_flush_dev(struct cam_context *ctx,
	struct cam_flush_dev_cmd *cmd)
{
+28 −0
Original line number Diff line number Diff line
@@ -87,6 +87,8 @@ struct cam_ctx_request {
 * @start_dev:             Function pointer for start device
 * @stop_dev:              Function pointer for stop device
 * @flush_dev:             Function pointer for flush device
 * @acquire_hw:            Function pointer for acquire hw
 * @release_hw:            Function pointer for release hw
 *
 */
struct cam_ctx_ioctl_ops {
@@ -102,6 +104,8 @@ struct cam_ctx_ioctl_ops {
			struct cam_start_stop_dev_cmd *cmd);
	int (*flush_dev)(struct cam_context *ctx,
			struct cam_flush_dev_cmd *cmd);
	int (*acquire_hw)(struct cam_context *ctx, void *args);
	int (*release_hw)(struct cam_context *ctx, void *args);
};

/**
@@ -320,6 +324,18 @@ int cam_context_dump_pf_info(struct cam_context *ctx, unsigned long iova,
int cam_context_handle_acquire_dev(struct cam_context *ctx,
		struct cam_acquire_dev_cmd *cmd);

/**
 * cam_context_handle_acquire_hw()
 *
 * @brief:        Handle acquire HW command
 *
 * @ctx:          Object pointer for cam_context
 * @cmd:          Acquire HW command payload
 *
 */
int cam_context_handle_acquire_hw(struct cam_context *ctx,
		void *cmd);

/**
 * cam_context_handle_release_dev()
 *
@@ -332,6 +348,18 @@ int cam_context_handle_acquire_dev(struct cam_context *ctx,
int cam_context_handle_release_dev(struct cam_context *ctx,
		struct cam_release_dev_cmd *cmd);

/**
 * cam_context_handle_release_hw()
 *
 * @brief:        Handle release HW command
 *
 * @ctx:          Object pointer for cam_context
 * @cmd:          Release HW command payload
 *
 */
int cam_context_handle_release_hw(struct cam_context *ctx,
		void *cmd);

/**
 * cam_context_handle_config_dev()
 *
Loading