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

Commit 9363955b authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ais: resync with camera kernel"

parents 5ea6bd8d dde4d262
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;
+2 −3
Original line number Diff line number Diff line
@@ -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,
+27 −17
Original line number Diff line number Diff line
@@ -42,25 +42,32 @@ static int cam_context_handle_hw_event(void *context, uint32_t evt_id,
int cam_context_shutdown(struct cam_context *ctx)
{
	int rc = 0;
	int32_t ctx_hdl = ctx->dev_hdl;

	mutex_lock(&ctx->ctx_mutex);
	if (ctx->state_machine[ctx->state].ioctl_ops.stop_dev) {
		rc = ctx->state_machine[ctx->state].ioctl_ops.stop_dev(
			ctx, NULL);
		if (rc < 0)
			CAM_ERR(CAM_CORE, "Error while dev stop %d", rc);
	}
	if (ctx->state_machine[ctx->state].ioctl_ops.release_dev) {
		rc = ctx->state_machine[ctx->state].ioctl_ops.release_dev(
			ctx, NULL);
		if (rc < 0)
			CAM_ERR(CAM_CORE, "Error while dev release %d", rc);
	struct cam_release_dev_cmd cmd;

	if (ctx->state > CAM_CTX_AVAILABLE && ctx->state < CAM_CTX_STATE_MAX) {
		cmd.session_handle = ctx->session_hdl;
		cmd.dev_handle = ctx->dev_hdl;
		rc = cam_context_handle_release_dev(ctx, &cmd);
		if (rc)
			CAM_ERR(CAM_CORE,
				"context release failed for dev_name %s",
				ctx->dev_name);
		else
			cam_context_putref(ctx);
	} else {
		CAM_WARN(CAM_CORE,
			"dev %s context id %u state %d invalid to release hdl",
			ctx->dev_name, ctx->ctx_id, ctx->state);
		rc = -EINVAL;
	}
	mutex_unlock(&ctx->ctx_mutex);

	if (!rc)
		rc = cam_destroy_device_hdl(ctx_hdl);
	rc = cam_destroy_device_hdl(ctx->dev_hdl);
	if (rc)
		CAM_ERR(CAM_CORE, "destroy device hdl failed for node %s",
			ctx->dev_name);
	else
		ctx->dev_hdl = -1;

	return rc;
}

@@ -484,6 +491,8 @@ int cam_context_handle_stop_dev(struct cam_context *ctx,
		/* stop device can be optional for some driver */
		CAM_WARN(CAM_CORE, "No stop device in dev %d, name %s state %d",
			ctx->dev_hdl, ctx->dev_name, ctx->state);

	ctx->last_flush_req = 0;
	mutex_unlock(&ctx->ctx_mutex);

	return rc;
@@ -518,6 +527,7 @@ int cam_context_init(struct cam_context *ctx,
	ctx->dev_name = dev_name;
	ctx->dev_id = dev_id;
	ctx->ctx_id = ctx_id;
	ctx->last_flush_req = 0;
	ctx->ctx_crm_intf = NULL;
	ctx->crm_ctx_intf = crm_node_intf;
	ctx->hw_mgr_intf = hw_mgr_intf;
+2 −0
Original line number Diff line number Diff line
@@ -180,6 +180,7 @@ struct cam_ctx_ops {
 * @refcount:              Context object refcount
 * @node:                  The main node to which this context belongs
 * @sync_mutex:            mutex to sync with sync cb thread
 * @last_flush_req:        Last request to flush
 *
 */
struct cam_context {
@@ -215,6 +216,7 @@ struct cam_context {
	struct kref                  refcount;
	void                        *node;
	struct mutex                 sync_mutex;
	uint32_t                     last_flush_req;
};

/**
Loading