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

Commit 1cb60f43 authored by Vishalsingh Hajeri's avatar Vishalsingh Hajeri Committed by Pavan Kumar Chilamkurthi
Browse files

msm: camera: isp: Add trace events across ISP



Add trace events for IRQ's on IFE top side and IFE
BUS side in top half. These traces when enabled
will help to gather relative timing information of
the IRQ's with systrace.

CRs-Fixed: 2538876
Change-Id: I856a9df1978f90e260da7c62cadf02fa2fe53202
Signed-off-by: default avatarVishalsingh Hajeri <vhajeri@codeaurora.org>
Signed-off-by: default avatarPavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
parent 79595a08
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -22,6 +22,7 @@
#include "cam_cdm_hw_reg_1_1.h"
#include "cam_cdm_hw_reg_1_1.h"
#include "cam_cdm_hw_reg_1_2.h"
#include "cam_cdm_hw_reg_1_2.h"
#include "cam_cdm_hw_reg_2_0.h"
#include "cam_cdm_hw_reg_2_0.h"
#include "cam_trace.h"


#define CAM_CDM_BL_FIFO_WAIT_TIMEOUT 2000
#define CAM_CDM_BL_FIFO_WAIT_TIMEOUT 2000
#define CAM_CDM_DBG_GEN_IRQ_USR_DATA 0xff
#define CAM_CDM_DBG_GEN_IRQ_USR_DATA 0xff
@@ -691,6 +692,8 @@ int cam_hw_cdm_submit_gen_irq(
		rc = -EIO;
		rc = -EIO;
	}
	}


	trace_cam_log_event("CDM_START", "CDM_START_IRQ", req->data->cookie, 0);

end:
end:
	return rc;
	return rc;
}
}
@@ -1162,6 +1165,10 @@ irqreturn_t cam_hw_cdm_irq(int irq_num, void *data)
		INIT_WORK((struct work_struct *)&payload[i]->work,
		INIT_WORK((struct work_struct *)&payload[i]->work,
			cam_hw_cdm_work);
			cam_hw_cdm_work);


		trace_cam_log_event("CDM_DONE", "CDM_DONE_IRQ",
			payload[i]->irq_status,
			cdm_hw->soc_info.index);

		if (cam_cdm_write_hw_reg(cdm_hw,
		if (cam_cdm_write_hw_reg(cdm_hw,
				cdm_core->offsets->irq_reg[i]->irq_clear,
				cdm_core->offsets->irq_reg[i]->irq_clear,
				payload[i]->irq_status)) {
				payload[i]->irq_status)) {
+18 −2
Original line number Original line Diff line number Diff line
@@ -524,15 +524,26 @@ static void __cam_isp_ctx_handle_buf_done_fail_log(
		"Resource Handles that fail to generate buf_done in prev frame");
		"Resource Handles that fail to generate buf_done in prev frame");
	for (i = 0; i < req_isp->num_fence_map_out; i++) {
	for (i = 0; i < req_isp->num_fence_map_out; i++) {
		if (req_isp->fence_map_out[i].sync_id != -1) {
		if (req_isp->fence_map_out[i].sync_id != -1) {
			if (isp_device_type == CAM_IFE_DEVICE_TYPE)
			if (isp_device_type == CAM_IFE_DEVICE_TYPE) {
				handle_type =
				handle_type =
				__cam_isp_resource_handle_id_to_type(
				__cam_isp_resource_handle_id_to_type(
				req_isp->fence_map_out[i].resource_handle);
				req_isp->fence_map_out[i].resource_handle);
			else

				trace_cam_log_event("Buf_done Congestion",
				__cam_isp_resource_handle_id_to_type(
				req_isp->fence_map_out[i].resource_handle),
				request_id, req_isp->fence_map_out[i].sync_id);
			} else {
				handle_type =
				handle_type =
				__cam_isp_tfe_resource_handle_id_to_type(
				__cam_isp_tfe_resource_handle_id_to_type(
				req_isp->fence_map_out[i].resource_handle);
				req_isp->fence_map_out[i].resource_handle);


				trace_cam_log_event("Buf_done Congestion",
				__cam_isp_tfe_resource_handle_id_to_type(
				req_isp->fence_map_out[i].resource_handle),
				request_id, req_isp->fence_map_out[i].sync_id);
			}

			CAM_WARN(CAM_ISP,
			CAM_WARN(CAM_ISP,
			"Resource_Handle: [%s][0x%x] Sync_ID: [0x%x]",
			"Resource_Handle: [%s][0x%x] Sync_ID: [0x%x]",
			handle_type,
			handle_type,
@@ -597,6 +608,9 @@ static int __cam_isp_ctx_handle_buf_done_for_request(
				"Duplicate BUF_DONE for req %lld : i=%d, j=%d, res=%s",
				"Duplicate BUF_DONE for req %lld : i=%d, j=%d, res=%s",
				req->request_id, i, j, handle_type);
				req->request_id, i, j, handle_type);


			trace_cam_log_event("Duplicate BufDone",
				handle_type, req->request_id, ctx->ctx_id);

			if (done_next_req) {
			if (done_next_req) {
				done_next_req->resource_handle
				done_next_req->resource_handle
					[done_next_req->num_handles++] =
					[done_next_req->num_handles++] =
@@ -1108,6 +1122,8 @@ static int __cam_isp_ctx_epoch_in_applied(struct cam_isp_context *ctx_isp,
		CAM_WARN(CAM_ISP,
		CAM_WARN(CAM_ISP,
			"Notify CRM about Bubble req %lld frame %lld, ctx %u",
			"Notify CRM about Bubble req %lld frame %lld, ctx %u",
			req->request_id, ctx_isp->frame_id, ctx->ctx_id);
			req->request_id, ctx_isp->frame_id, ctx->ctx_id);
		trace_cam_log_event("Bubble", "Rcvd epoch in applied state",
			req->request_id, ctx->ctx_id);
		ctx->ctx_crm_intf->notify_err(&notify);
		ctx->ctx_crm_intf->notify_err(&notify);
		atomic_set(&ctx_isp->process_bubble, 1);
		atomic_set(&ctx_isp->process_bubble, 1);
	} else {
	} else {
+1 −0
Original line number Original line Diff line number Diff line
@@ -3,6 +3,7 @@
ccflags-y += -I$(srctree)/techpack/camera/drivers/cam_utils/
ccflags-y += -I$(srctree)/techpack/camera/drivers/cam_utils/
ccflags-y += -I$(srctree)/techpack/camera/drivers/cam_cdm/
ccflags-y += -I$(srctree)/techpack/camera/drivers/cam_cdm/
ccflags-y += -I$(srctree)/techpack/camera/drivers/cam_core/
ccflags-y += -I$(srctree)/techpack/camera/drivers/cam_core/
ccflags-y += -I$(srctree)/techpack/camera/drivers/cam_req_mgr/
ccflags-y += -I$(srctree)/techpack/camera/drivers/cam_isp/isp_hw_mgr/
ccflags-y += -I$(srctree)/techpack/camera/drivers/cam_isp/isp_hw_mgr/
ccflags-y += -I$(srctree)/techpack/camera/drivers/cam_isp/isp_hw_mgr/include
ccflags-y += -I$(srctree)/techpack/camera/drivers/cam_isp/isp_hw_mgr/include
ccflags-y += -I$(srctree)/techpack/camera/drivers/cam_isp/isp_hw_mgr/hw_utils/irq_controller
ccflags-y += -I$(srctree)/techpack/camera/drivers/cam_isp/isp_hw_mgr/hw_utils/irq_controller
+23 −1
Original line number Original line Diff line number Diff line
@@ -21,8 +21,10 @@
#include "cam_vfe_soc.h"
#include "cam_vfe_soc.h"
#include "cam_debug_util.h"
#include "cam_debug_util.h"
#include "cam_cpas_api.h"
#include "cam_cpas_api.h"
#include "cam_trace.h"


static const char drv_name[] = "vfe_bus";
static const char drv_name[] = "vfe_bus";
static char rup_controller_name[32] = "";


#define CAM_VFE_BUS_VER3_IRQ_REG0                0
#define CAM_VFE_BUS_VER3_IRQ_REG0                0
#define CAM_VFE_BUS_VER3_IRQ_REG1                1
#define CAM_VFE_BUS_VER3_IRQ_REG1                1
@@ -916,6 +918,7 @@ static int cam_vfe_bus_ver3_handle_rup_top_half(uint32_t evt_id,
	struct cam_isp_resource_node               *vfe_out = NULL;
	struct cam_isp_resource_node               *vfe_out = NULL;
	struct cam_vfe_bus_ver3_vfe_out_data       *rsrc_data = NULL;
	struct cam_vfe_bus_ver3_vfe_out_data       *rsrc_data = NULL;
	struct cam_vfe_bus_irq_evt_payload         *evt_payload;
	struct cam_vfe_bus_irq_evt_payload         *evt_payload;
	uint32_t irq_status;


	vfe_out = th_payload->handler_priv;
	vfe_out = th_payload->handler_priv;
	if (!vfe_out) {
	if (!vfe_out) {
@@ -944,6 +947,12 @@ static int cam_vfe_bus_ver3_handle_rup_top_half(uint32_t evt_id,
	evt_payload->evt_id  = evt_id;
	evt_payload->evt_id  = evt_id;
	for (i = 0; i < th_payload->num_registers; i++)
	for (i = 0; i < th_payload->num_registers; i++)
		evt_payload->irq_reg_val[i] = th_payload->evt_status_arr[i];
		evt_payload->irq_reg_val[i] = th_payload->evt_status_arr[i];

	irq_status =
		th_payload->evt_status_arr[CAM_IFE_IRQ_BUS_VER3_REG_STATUS0];

	trace_cam_log_event("RUP", "RUP_IRQ", irq_status, 0);

	th_payload->evt_payload_priv = evt_payload;
	th_payload->evt_payload_priv = evt_payload;


	return rc;
	return rc;
@@ -2238,6 +2247,8 @@ static int cam_vfe_bus_ver3_handle_vfe_out_done_top_half(uint32_t evt_id,
	struct cam_isp_resource_node               *vfe_out = NULL;
	struct cam_isp_resource_node               *vfe_out = NULL;
	struct cam_vfe_bus_ver3_vfe_out_data       *rsrc_data = NULL;
	struct cam_vfe_bus_ver3_vfe_out_data       *rsrc_data = NULL;
	struct cam_vfe_bus_irq_evt_payload         *evt_payload;
	struct cam_vfe_bus_irq_evt_payload         *evt_payload;
	struct cam_vfe_bus_ver3_comp_grp_data      *resource_data;
	uint32_t                                    status_0;


	vfe_out = th_payload->handler_priv;
	vfe_out = th_payload->handler_priv;
	if (!vfe_out) {
	if (!vfe_out) {
@@ -2246,6 +2257,7 @@ static int cam_vfe_bus_ver3_handle_vfe_out_done_top_half(uint32_t evt_id,
	}
	}


	rsrc_data = vfe_out->res_priv;
	rsrc_data = vfe_out->res_priv;
	resource_data = rsrc_data->comp_grp->res_priv;


	CAM_DBG(CAM_ISP, "VFE:%d Bus IRQ status_0: 0x%X status_1: 0x%X",
	CAM_DBG(CAM_ISP, "VFE:%d Bus IRQ status_0: 0x%X status_1: 0x%X",
		rsrc_data->common_data->core_index,
		rsrc_data->common_data->core_index,
@@ -2274,6 +2286,17 @@ static int cam_vfe_bus_ver3_handle_vfe_out_done_top_half(uint32_t evt_id,


	th_payload->evt_payload_priv = evt_payload;
	th_payload->evt_payload_priv = evt_payload;


	status_0 = th_payload->evt_status_arr[CAM_IFE_IRQ_BUS_VER3_REG_STATUS0];

	if (status_0 & BIT(resource_data->comp_grp_type +
		rsrc_data->common_data->comp_done_shift)) {
		trace_cam_log_event("bufdone", "bufdone_IRQ",
			status_0, resource_data->comp_grp_type);
	}

	if (status_0 & 0x1)
		trace_cam_log_event("UnexpectedRUP", "RUP_IRQ", status_0, 40);

	CAM_DBG(CAM_ISP, "Exit");
	CAM_DBG(CAM_ISP, "Exit");
	return rc;
	return rc;
}
}
@@ -3725,7 +3748,6 @@ int cam_vfe_bus_ver3_init(
	struct cam_vfe_bus              *vfe_bus_local;
	struct cam_vfe_bus              *vfe_bus_local;
	struct cam_vfe_bus_ver3_hw_info *ver3_hw_info = bus_hw_info;
	struct cam_vfe_bus_ver3_hw_info *ver3_hw_info = bus_hw_info;
	struct cam_vfe_soc_private      *soc_private = NULL;
	struct cam_vfe_soc_private      *soc_private = NULL;
	char rup_controller_name[12] = "";


	CAM_DBG(CAM_ISP, "Enter");
	CAM_DBG(CAM_ISP, "Enter");


+1 −0
Original line number Original line Diff line number Diff line
@@ -4,6 +4,7 @@ ccflags-y += -I$(srctree)/techpack/camera/drivers/cam_utils/
ccflags-y += -I$(srctree)/techpack/camera/drivers/cam_cdm/
ccflags-y += -I$(srctree)/techpack/camera/drivers/cam_cdm/
ccflags-y += -I$(srctree)/techpack/camera/drivers/cam_core/
ccflags-y += -I$(srctree)/techpack/camera/drivers/cam_core/
ccflags-y += -I$(srctree)/techpack/camera/drivers/cam_cpas/include
ccflags-y += -I$(srctree)/techpack/camera/drivers/cam_cpas/include
ccflags-y += -I$(srctree)/techpack/camera/drivers/cam_req_mgr/
ccflags-y += -I$(srctree)/techpack/camera/drivers/cam_isp/isp_hw_mgr/include
ccflags-y += -I$(srctree)/techpack/camera/drivers/cam_isp/isp_hw_mgr/include
ccflags-y += -I$(srctree)/techpack/camera/drivers/cam_isp/isp_hw_mgr/hw_utils/irq_controller
ccflags-y += -I$(srctree)/techpack/camera/drivers/cam_isp/isp_hw_mgr/hw_utils/irq_controller
ccflags-y += -I$(srctree)/techpack/camera/drivers/cam_isp/isp_hw_mgr/hw_utils/include
ccflags-y += -I$(srctree)/techpack/camera/drivers/cam_isp/isp_hw_mgr/hw_utils/include
Loading