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

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

UPSTREAM: Merge PC156 commit 'a3e96d3e' into mainline



* commit 'a3e96d3e':
  msm: camera: Upgrade camera module drivers

Change-Id: Ic6bc46e75e4700bd08c28ed4d56d3409660110d7
Signed-off-by: default avatarAbhijit Trivedi <abhijitt@codeaurora.org>
parents f5f0d9dd a3e96d3e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -183,6 +183,7 @@ struct cam_hw_config_args {
	uint32_t                        num_out_map_entries;
	void                           *priv;
	uint64_t                        request_id;
	bool                            init_packet;
};

/**
+39 −0
Original line number Diff line number Diff line
@@ -18,6 +18,34 @@
#include "cam_trace.h"
#include "cam_debug_util.h"

static void cam_node_print_ctx_state(
	struct cam_node *node)
{
	int i;
	struct cam_context *ctx;

	CAM_INFO(CAM_CORE, "[%s] state=%d, ctx_size %d",
		node->name, node->state, node->ctx_size);

	mutex_lock(&node->list_mutex);
	for (i = 0; i < node->ctx_size; i++) {
		ctx = &node->ctx_list[i];

		spin_lock(&ctx->lock);
		CAM_INFO(CAM_CORE,
			"[%s][%d] : state=%d, refcount=%d, active_req_list=%d, pending_req_list=%d, wait_req_list=%d, free_req_list=%d",
			ctx->dev_name ? ctx->dev_name : "null",
			i, ctx->state,
			atomic_read(&(ctx->refcount.refcount.refs)),
			list_empty(&ctx->active_req_list),
			list_empty(&ctx->pending_req_list),
			list_empty(&ctx->wait_req_list),
			list_empty(&ctx->free_req_list));
		spin_unlock(&ctx->lock);
	}
	mutex_unlock(&node->list_mutex);
}

static struct cam_context *cam_node_get_ctxt_from_free_list(
		struct cam_node *node)
{
@@ -75,6 +103,10 @@ static int __cam_node_handle_acquire_dev(struct cam_node *node,

	ctx = cam_node_get_ctxt_from_free_list(node);
	if (!ctx) {
		CAM_ERR(CAM_CORE, "No free ctx in free list node %s",
			node->name);
		cam_node_print_ctx_state(node);

		rc = -ENOMEM;
		goto err;
	}
@@ -86,6 +118,9 @@ static int __cam_node_handle_acquire_dev(struct cam_node *node,
		goto free_ctx;
	}

	CAM_DBG(CAM_CORE, "[%s] Acquire ctx_id %d",
		node->name, ctx->ctx_id);

	return 0;
free_ctx:
	cam_context_putref(ctx);
@@ -260,6 +295,10 @@ static int __cam_node_handle_release_dev(struct cam_node *node,
		CAM_ERR(CAM_CORE, "destroy device handle is failed node %s",
			node->name);

	CAM_DBG(CAM_CORE, "[%s] Release ctx_id=%d, refcount=%d",
		node->name, ctx->ctx_id,
		atomic_read(&(ctx->refcount.refcount.refs)));

	cam_context_putref(ctx);
	return rc;
}
+2 −0
Original line number Diff line number Diff line
@@ -1243,6 +1243,7 @@ static int __cam_isp_ctx_apply_req_in_activated_state(
	cfg.hw_update_entries = req_isp->cfg;
	cfg.num_hw_update_entries = req_isp->num_cfg;
	cfg.priv  = &req_isp->hw_update_data;
	cfg.init_packet = 0;

	rc = ctx->hw_mgr_intf->hw_config(ctx->hw_mgr_intf->hw_mgr_priv, &cfg);
	if (rc) {
@@ -2373,6 +2374,7 @@ static int __cam_isp_ctx_start_dev_in_ready(struct cam_context *ctx,
	arg.hw_update_entries = req_isp->cfg;
	arg.num_hw_update_entries = req_isp->num_cfg;
	arg.priv  = &req_isp->hw_update_data;
	arg.init_packet = 1;

	ctx_isp->frame_id = 0;
	ctx_isp->active_req_cnt = 0;
+2 −2
Original line number Diff line number Diff line
@@ -1617,7 +1617,7 @@ static int cam_ife_mgr_config_hw(void *hw_mgr_priv,
			cdm_cmd->cmd[i].len = cmd->len;
		}

		if (cfg->request_id == 1)
		if (cfg->init_packet)
			init_completion(&ctx->config_done_complete);

		CAM_DBG(CAM_ISP, "Submit to CDM");
@@ -1627,7 +1627,7 @@ static int cam_ife_mgr_config_hw(void *hw_mgr_priv,
			return rc;
		}

		if (cfg->request_id == 1) {
		if (cfg->init_packet) {
			rc = wait_for_completion_timeout(
				&ctx->config_done_complete,
				msecs_to_jiffies(30));
+9 −2
Original line number Diff line number Diff line
@@ -579,8 +579,15 @@ int cam_isp_add_io_buffers(
				io_addr[plane_id] +=
						io_cfg[i].offsets[plane_id];
				CAM_DBG(CAM_ISP,
					"get io_addr for plane %d: 0x%llx",
					plane_id, io_addr[plane_id]);
					"get io_addr for plane %d: 0x%llx, mem_hdl=0x%x",
					plane_id, io_addr[plane_id],
					io_cfg[i].mem_handle[plane_id]);

				CAM_DBG(CAM_ISP,
					"mmu_hdl=0x%x, size=%d, end=0x%x",
					mmu_hdl, (int)size,
					io_addr[plane_id]+size);

			}
			if (!plane_id) {
				CAM_ERR(CAM_ISP, "No valid planes for res%d",
Loading