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

Commit a013d2a9 authored by Abhijit Trivedi's avatar Abhijit Trivedi
Browse files

UPSTREAM: Merge remote-tracking branch 'quic/dev/msm-4.9-camx' into msm-4.9 - 092117



* quic/dev/msm-4.9-camx:
If0f9fc4a0da3d4184571d9d1db5f03ef26eb3191  Revert "msm: camera: Add support for combo mode"
Ia36a8b1d27d3c4ab42376c94dd6e2117bb414f87  msm: camera: sensor: Correct check condition
I96781d0a59404edcb0bf44609682f0344efa788d  msm: camera: sanitize the camera sensor driver
I2517a00dd00dbe0a22225699adde63949d53bb28  msm: camera: fd: Update HALT-RESET sequence
I162feb46c7aa570b68115dacd3cf040afa5b11d0  msm: camera: isp: Add support to raw dump
If500ab04c0174b36f2bb7576b7fa86efa33bbb3d  msm: camera: Add v4l2 file ops for cci subdevice
I3e61f171592dfd130717c5f338fc1e1503bb2f2e  msm: camera: fd: Map buffers to device, cpu only if required
I79cbefefe5fd9a9d1c895a7a68fe18895ff8c23b  msm: camera: jpeg: stability fixes
I46de41c262811309240db8f47f719026fb6c2043  msm: camera: Add support for combo mode
Ief431093357e925c1ae2dd65d096a82f206340b9  msm: camera: flash: add support to nop packets for flash module
I5562bd6a2de201198dd0877751e7439f80cf3f0d  msm: camera: icp: Increase supported contexts
I8e99b0c5ac1a7e2cdd713914f2c7dd0797e45b0d  msm: camera: fd: move start cmd to post config
I3d7b2e13c9720d5c01bd9da74ac150e0ab375f11  msm: camera: fd: add FD trace point
I3312a0248afe77a63ef483f8a0f6afc34a88cd7a  ARM: dts: msm: Enable OIS device on SDM845
I1fd598b9d363d6f8d9c3f0f46193c3b041eec2cd  msm: camera: isp: update CSID AXI bandwidth vote to default value

Change-Id: I84fc45caebd1da0aa64f7ebee7bad176d7150108
Signed-off-by: default avatarAbhijit Trivedi <abhijitt@codeaurora.org>
parents f5d98565 a1c84337
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -111,7 +111,7 @@
		rgltr-min-voltage = <2800000>;
		rgltr-max-voltage = <2800000>;
		rgltr-load-current = <0>;
		status = "disabled";
		status = "ok";
	};

	eeprom_rear: qcom,eeprom@0 {
+1 −1
Original line number Diff line number Diff line
@@ -111,7 +111,7 @@
		rgltr-min-voltage = <2800000>;
		rgltr-max-voltage = <2800000>;
		rgltr-load-current = <0>;
		status = "disabled";
		status = "ok";
	};

	eeprom_rear: qcom,eeprom@0 {
+1 −1
Original line number Diff line number Diff line
@@ -256,7 +256,7 @@ static int __cam_node_crm_apply_req(struct cam_req_mgr_apply_request *apply)
		return -EINVAL;
	}

	trace_cam_apply_req("Node", apply);
	trace_cam_apply_req("Node", apply->request_id);

	return cam_context_handle_crm_apply_req(ctx, apply);
}
+5 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@

#include "cam_debug_util.h"
#include "cam_fd_context.h"
#include "cam_trace.h"

/* Functions in Available state */
static int __cam_fd_ctx_acquire_dev_in_available(struct cam_context *ctx,
@@ -29,6 +30,7 @@ static int __cam_fd_ctx_acquire_dev_in_available(struct cam_context *ctx,
	}

	ctx->state = CAM_CTX_ACQUIRED;
	trace_cam_context_state("FD", ctx);

	return rc;
}
@@ -46,6 +48,7 @@ static int __cam_fd_ctx_release_dev_in_acquired(struct cam_context *ctx,
	}

	ctx->state = CAM_CTX_AVAILABLE;
	trace_cam_context_state("FD", ctx);

	return rc;
}
@@ -76,6 +79,7 @@ static int __cam_fd_ctx_start_dev_in_acquired(struct cam_context *ctx,
	}

	ctx->state = CAM_CTX_ACTIVATED;
	trace_cam_context_state("FD", ctx);

	return rc;
}
@@ -93,6 +97,7 @@ static int __cam_fd_ctx_stop_dev_in_activated(struct cam_context *ctx,
	}

	ctx->state = CAM_CTX_ACQUIRED;
	trace_cam_context_state("FD", ctx);

	return rc;
}
+98 −20
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@
#include "cam_fd_hw_soc.h"
#include "cam_fd_hw_mgr_intf.h"
#include "cam_fd_hw_mgr.h"
#include "cam_trace.h"

static struct cam_fd_hw_mgr g_fd_hw_mgr;

@@ -334,7 +335,7 @@ static int cam_fd_mgr_util_select_device(struct cam_fd_hw_mgr *hw_mgr,
	/* Update required info in hw context */
	hw_ctx->device_index = i;

	CAM_DBG(CAM_FD, "ctx index=%d, hw_ctx=%d", hw_ctx->ctx_index,
	CAM_DBG(CAM_FD, "ctx index=%d, device_index=%d", hw_ctx->ctx_index,
		hw_ctx->device_index);

	return 0;
@@ -480,6 +481,53 @@ static int cam_fd_mgr_util_parse_generic_cmd_buffer(
	return rc;
}

static int cam_fd_mgr_util_get_buf_map_requirement(uint32_t direction,
	uint32_t resource_type, bool *need_io_map, bool *need_cpu_map)
{
	if (!need_io_map || !need_cpu_map) {
		CAM_ERR(CAM_FD, "Invalid input pointers %pK %pK", need_io_map,
			need_cpu_map);
		return -EINVAL;
	}

	if (direction == CAM_BUF_INPUT) {
		switch (resource_type) {
		case CAM_FD_INPUT_PORT_ID_IMAGE:
			*need_io_map = true;
			*need_cpu_map = false;
			break;
		default:
			CAM_WARN(CAM_FD, "Invalid port: dir %d, id %d",
				direction, resource_type);
			return -EINVAL;
		}
	} else if (direction == CAM_BUF_OUTPUT) {
		switch (resource_type) {
		case CAM_FD_OUTPUT_PORT_ID_RESULTS:
			*need_io_map = true;
			*need_cpu_map = true;
			break;
		case CAM_FD_OUTPUT_PORT_ID_RAW_RESULTS:
			*need_io_map = true;
			*need_cpu_map = true;
			break;
		case CAM_FD_OUTPUT_PORT_ID_WORK_BUFFER:
			*need_io_map = true;
			*need_cpu_map = false;
			break;
		default:
			CAM_WARN(CAM_FD, "Invalid port: dir %d, id %d",
				direction, resource_type);
			return -EINVAL;
		}
	} else {
		CAM_WARN(CAM_FD, "Invalid direction %d", direction);
		return -EINVAL;
	}

	return 0;
}

static int cam_fd_mgr_util_prepare_io_buf_info(int32_t iommu_hdl,
	struct cam_hw_prepare_update_args *prepare,
	struct cam_fd_hw_io_buffer *input_buf,
@@ -491,6 +539,7 @@ static int cam_fd_mgr_util_prepare_io_buf_info(int32_t iommu_hdl,
	uint64_t io_addr[CAM_PACKET_MAX_PLANES];
	uint64_t cpu_addr[CAM_PACKET_MAX_PLANES];
	size_t size;
	bool need_io_map, need_cpu_map;

	/* Get IO Buf information */
	num_out_buf = 0;
@@ -512,32 +561,55 @@ static int cam_fd_mgr_util_prepare_io_buf_info(int32_t iommu_hdl,
			return -EINVAL;
		}

		rc = cam_fd_mgr_util_get_buf_map_requirement(
			io_cfg[i].direction, io_cfg[i].resource_type,
			&need_io_map, &need_cpu_map);
		if (rc) {
			CAM_WARN(CAM_FD, "Invalid io buff [%d] : %d %d %d",
				i, io_cfg[i].direction,
				io_cfg[i].resource_type, rc);
			continue;
		}

		memset(io_addr, 0x0, sizeof(io_addr));
		for (plane = 0; plane < CAM_PACKET_MAX_PLANES; plane++) {
			if (!io_cfg[i].mem_handle[plane])
				break;

			rc = cam_mem_get_io_buf(io_cfg[i].mem_handle[plane],
			io_addr[plane] = 0x0;
			cpu_addr[plane] = 0x0;

			if (need_io_map) {
				rc = cam_mem_get_io_buf(
					io_cfg[i].mem_handle[plane],
					iommu_hdl, &io_addr[plane], &size);
				if ((rc) || (io_addr[plane] >> 32)) {
				CAM_ERR(CAM_FD, "Invalid io addr for %d %d",
					plane, rc);
					CAM_ERR(CAM_FD,
						"Invalid io buf %d %d %d %d",
						io_cfg[i].direction,
						io_cfg[i].resource_type, plane,
						rc);
					return -ENOMEM;
				}

			/*
			 * Buffers may be accessed by CPU as well, we do not
			 * know at this point, so get both and send to HW layer
			 */
			rc = cam_mem_get_cpu_buf(io_cfg[i].mem_handle[plane],
				io_addr[plane] += io_cfg[i].offsets[plane];
			}

			if (need_cpu_map) {
				rc = cam_mem_get_cpu_buf(
					io_cfg[i].mem_handle[plane],
					&cpu_addr[plane], &size);
				if (rc) {
				CAM_ERR(CAM_FD, "unable to get buf address");
					CAM_ERR(CAM_FD,
						"Invalid cpu buf %d %d %d %d",
						io_cfg[i].direction,
						io_cfg[i].resource_type, plane,
						rc);
					return rc;
				}

			io_addr[plane] += io_cfg[i].offsets[plane];
				cpu_addr[plane] += io_cfg[i].offsets[plane];
			}

			CAM_DBG(CAM_FD, "IO Address[%d][%d] : %pK, %pK",
				io_cfg[i].direction, plane, io_addr[plane],
@@ -764,6 +836,8 @@ static int cam_fd_mgr_util_submit_frame(void *priv, void *data)
		return -EBUSY;
	}

	trace_cam_submit_to_hw("FD", frame_req->request_id);

	list_del_init(&frame_req->list);
	mutex_unlock(&hw_mgr->frame_req_mutex);

@@ -924,6 +998,8 @@ static int32_t cam_fd_mgr_workq_irq_cb(void *priv, void *data)
		frame_abort = false;
	}

	trace_cam_irq_handled("FD", irq_type);

notify_context:
	/* Do a callback to inform frame done or stop done */
	if (frame_req->hw_ctx->event_cb) {
@@ -1158,7 +1234,7 @@ static int cam_fd_mgr_hw_start(void *hw_mgr_priv, void *mgr_start_args)
		return -EPERM;
	}

	CAM_DBG(CAM_FD, "ctx index=%d, hw_ctx=%d", hw_ctx->ctx_index,
	CAM_DBG(CAM_FD, "ctx index=%d, device_index=%d", hw_ctx->ctx_index,
		hw_ctx->device_index);

	rc = cam_fd_mgr_util_get_device(hw_mgr, hw_ctx, &hw_device);
@@ -1389,6 +1465,8 @@ static int cam_fd_mgr_hw_config(void *hw_mgr_priv, void *hw_config_args)
	}

	frame_req = config->priv;

	trace_cam_apply_req("FD", frame_req->request_id);
	CAM_DBG(CAM_FD, "FrameHWConfig : Frame[%lld]", frame_req->request_id);

	frame_req->num_hw_update_entries = config->num_hw_update_entries;
Loading