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

Commit 77d3aac0 authored by Raja Mallik's avatar Raja Mallik
Browse files

msm: camera: New spectra camera driver feature, fixes update



Changes added for camera ISP, ICP, JPEG, fd, cpas, cdm, core from msm-4.14
'commit <a50bf345b0cb38> ("msm: camera: flash: Moving flash off operation
in stop dev ioctl")' till 'commit <efd1feba4e3813> ("msm: camera: ife:
clean up HW manager sequence")'

Retain existing ION, CMA alloc, SMMU, for camera modules for msm-4.9.

Change-Id: Ia93df8a17445918d1cf5374fc1f3dfa4666f4c43
Signed-off-by: default avatarRaja Mallik <rmallik@codeaurora.org>
parent b3063fa5
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2019, 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
@@ -118,6 +118,14 @@ int cam_virtual_cdm_submit_bl(struct cam_hw_info *cdm_hw,

		if ((!rc) && (vaddr_ptr) && (len) &&
			(len >= cdm_cmd->cmd[i].offset)) {


			if ((len - cdm_cmd->cmd[i].offset) <=
				cdm_cmd->cmd[i].len) {
				CAM_ERR(CAM_CDM, "Not enough buffer");
				rc = -EINVAL;
				break;
			}
			CAM_DBG(CAM_CDM,
				"hdl=%x vaddr=%pK offset=%d cmdlen=%d:%zu",
				cdm_cmd->cmd[i].bl_addr.mem_handle,
+4 −1
Original line number Diff line number Diff line
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2019, 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
@@ -173,6 +173,7 @@ int cam_context_handle_crm_apply_req(struct cam_context *ctx,
		return -EINVAL;
	}

	mutex_lock(&ctx->ctx_mutex);
	if (ctx->state_machine[ctx->state].crm_ops.apply_req) {
		rc = ctx->state_machine[ctx->state].crm_ops.apply_req(ctx,
			apply);
@@ -181,6 +182,7 @@ int cam_context_handle_crm_apply_req(struct cam_context *ctx,
			ctx->dev_hdl, ctx->state);
		rc = -EPROTO;
	}
	mutex_unlock(&ctx->ctx_mutex);

	return rc;
}
@@ -456,6 +458,7 @@ int cam_context_handle_start_dev(struct cam_context *ctx,
	}

	mutex_lock(&ctx->ctx_mutex);
	ctx->last_flush_req = 0;
	if (ctx->state_machine[ctx->state].ioctl_ops.start_dev)
		rc = ctx->state_machine[ctx->state].ioctl_ops.start_dev(
			ctx, cmd);
+17 −1
Original line number Diff line number Diff line
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2019, 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
@@ -303,6 +303,12 @@ int32_t cam_context_config_dev_to_hw(
		return rc;
	}

	if ((len < sizeof(struct cam_packet)) ||
		(cmd->offset >= (len - sizeof(struct cam_packet)))) {
		CAM_ERR(CAM_CTXT, "Not enough buf");
		return -EINVAL;

	}
	packet = (struct cam_packet *) ((uint8_t *)packet_addr +
		(uint32_t)cmd->offset);

@@ -333,6 +339,7 @@ int32_t cam_context_prepare_dev_to_hw(struct cam_context *ctx,
	uintptr_t packet_addr;
	struct cam_packet *packet;
	size_t len = 0;
	size_t remain_len = 0;
	int32_t i = 0, j = 0;

	if (!ctx || !cmd) {
@@ -381,6 +388,14 @@ int32_t cam_context_prepare_dev_to_hw(struct cam_context *ctx,
		goto free_req;
	}

	remain_len = len;
	if ((len < sizeof(struct cam_packet)) ||
		((size_t)cmd->offset >= len - sizeof(struct cam_packet))) {
		CAM_ERR(CAM_CTXT, "invalid buff length: %zu or offset", len);
		return -EINVAL;
	}

	remain_len -= (size_t)cmd->offset;
	packet = (struct cam_packet *) ((uint8_t *)packet_addr +
		(uint32_t)cmd->offset);

@@ -398,6 +413,7 @@ int32_t cam_context_prepare_dev_to_hw(struct cam_context *ctx,
	/* preprocess the configuration */
	memset(&cfg, 0, sizeof(cfg));
	cfg.packet = packet;
	cfg.remain_len = remain_len;
	cfg.ctxt_to_hw_map = ctx->ctxt_to_hw_map;
	cfg.max_hw_update_entries = CAM_CTX_CFG_MAX;
	cfg.num_hw_update_entries = req->num_hw_update_entries;
+3 −1
Original line number Diff line number Diff line
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2019, 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
@@ -153,6 +153,7 @@ struct cam_hw_mgr_dump_pf_data {
 * struct cam_hw_prepare_update_args - Payload for prepare command
 *
 * @packet:                CSL packet from user mode driver
 * @remain_len             Remaining length of CPU buffer after config offset
 * @ctxt_to_hw_map:        HW context from the acquire
 * @max_hw_update_entries: Maximum hardware update entries supported
 * @hw_update_entries:     Actual hardware update configuration (returned)
@@ -169,6 +170,7 @@ struct cam_hw_mgr_dump_pf_data {
 */
struct cam_hw_prepare_update_args {
	struct cam_packet              *packet;
	size_t                          remain_len;
	void                           *ctxt_to_hw_map;
	uint32_t                        max_hw_update_entries;
	struct cam_hw_update_entry     *hw_update_entries;
+14 −4
Original line number Diff line number Diff line
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2019, 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
@@ -313,6 +313,9 @@ static int cam_cpas_util_axi_setup(struct cam_cpas *cpas_core,
			goto mnoc_node_get_fail;
		}
		axi_port->axi_port_mnoc_node = axi_port_mnoc_node;
		axi_port->ib_bw_voting_needed =
			of_property_read_bool(axi_port_node,
				"ib-bw-voting-needed");

		rc = cam_cpas_util_register_bus_client(soc_info,
			axi_port_mnoc_node, &axi_port->mnoc_bus);
@@ -662,12 +665,19 @@ static int cam_cpas_util_apply_client_axi_vote(
		axi_port->camnoc_bus.src, axi_port->camnoc_bus.dst,
		camnoc_bw, mnoc_bw);

	if (axi_port->ib_bw_voting_needed)
		rc = cam_cpas_util_vote_bus_client_bw(&axi_port->mnoc_bus,
			mnoc_bw, mnoc_bw, false);
	else
		rc = cam_cpas_util_vote_bus_client_bw(&axi_port->mnoc_bus,
			mnoc_bw, 0, false);

	if (rc) {
		CAM_ERR(CAM_CPAS,
			"Failed in mnoc vote ab[%llu] ib[%llu] rc=%d",
			mnoc_bw, mnoc_bw, rc);
			mnoc_bw,
			(axi_port->ib_bw_voting_needed ? mnoc_bw : 0),
			rc);
		goto unlock_axi_port;
	}

Loading