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

Commit 582cd444 authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Merge 68373c03 on remote branch

Change-Id: Ic277f85da028b6fa214877f3ecc61bace4178cc2
parents 2ebae66b 68373c03
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
 * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
 */

#ifndef _CAM_CDM_H_
@@ -24,7 +24,7 @@

#define CAM_MAX_SW_CDM_VERSION_SUPPORTED  1
#define CAM_SW_CDM_INDEX                  0
#define CAM_CDM_INFLIGHT_WORKS            5
#define CAM_CDM_INFLIGHT_WORKS            1
#define CAM_CDM_HW_RESET_TIMEOUT          300

/*
@@ -69,8 +69,6 @@
#define CAM_CDM_BL_FIFO_LENGTH_MAX_DEFAULT 0x40
#define CAM_CDM_BL_FIFO_LENGTH_CFG_SHIFT 0x10
#define CAM_CDM_BL_FIFO_FLUSH_SHIFT 0x3
#define CAM_CDM_BL_FIFO_BOUNDARY_CHECK \
	(CAM_CDM_BL_FIFO_LENGTH_MAX_DEFAULT / 2)

#define CAM_CDM_BL_FIFO_REQ_SIZE_MAX 0x00
#define CAM_CDM_BL_FIFO_REQ_SIZE_MAX_DIV2 0x01
+19 −23
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
 * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
 * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
 */

#include <linux/delay.h>
@@ -1264,9 +1264,6 @@ static void cam_hw_cdm_work(struct work_struct *work)
			list_for_each_entry_safe(node, tnode,
				&core->bl_fifo[fifo_idx].bl_request_list,
				entry) {
				if ((node->bl_tag <= payload->irq_data) ||
					((node->bl_tag - payload->irq_data) >
					CAM_CDM_BL_FIFO_BOUNDARY_CHECK)) {
				if (node->request_type ==
					CAM_HW_CDM_BL_CB_CLIENT) {
					cam_cdm_notify_clients(cdm_hw,
@@ -1288,7 +1285,6 @@ static void cam_hw_cdm_work(struct work_struct *work)
				kfree(node);
				node = NULL;
			}
			}
		} else {
			CAM_INFO(CAM_CDM,
				"Skip GenIRQ, tag 0x%x fifo %d",
@@ -2232,7 +2228,7 @@ static int cam_hw_cdm_component_bind(struct device *dev,
				sizeof(cdm_core->name));
		snprintf(work_q_name + len, sizeof(work_q_name) - len, "%d", i);
		cdm_core->bl_fifo[i].work_queue = alloc_workqueue(work_q_name,
				WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_SYSFS,
				WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_SYSFS | WQ_HIGHPRI,
				CAM_CDM_INFLIGHT_WORKS);
		if (!cdm_core->bl_fifo[i].work_queue) {
			CAM_ERR(CAM_CDM,
+19 −21
Original line number Diff line number Diff line
@@ -2648,6 +2648,7 @@ static int cam_tfe_mgr_config_hw(void *hw_mgr_priv,
	struct cam_tfe_hw_mgr_ctx *ctx;
	struct cam_isp_prepare_hw_update_data *hw_update_data;
	bool cdm_hang_detect = false;
	unsigned long rem_jiffies = 0;

	if (!hw_mgr_priv || !config_hw_args) {
		CAM_ERR(CAM_ISP, "Invalid arguments");
@@ -2814,12 +2815,13 @@ static int cam_tfe_mgr_config_hw(void *hw_mgr_priv,
		goto end;

	for (i = 0; i < CAM_TFE_HW_CONFIG_WAIT_MAX_TRY; i++) {
		rc = wait_for_completion_timeout(
		rem_jiffies = wait_for_completion_timeout(
			&ctx->config_done_complete,
			msecs_to_jiffies(
			CAM_TFE_HW_CONFIG_TIMEOUT));
		if (rc <= 0) {
			if (!cam_cdm_detect_hang_error(ctx->cdm_handle)) {
		if (rem_jiffies <= 0) {
			rc = cam_cdm_detect_hang_error(ctx->cdm_handle);
			if (rc == 0) {
				CAM_ERR(CAM_ISP,
					"CDM workqueue delay detected, wait for some more time req_id=%llu rc=%d ctx_index %d",
					cfg->request_id, rc,
@@ -2831,24 +2833,19 @@ static int cam_tfe_mgr_config_hw(void *hw_mgr_priv,
					CAM_DEFAULT_VALUE,
					CAM_DEFAULT_VALUE, rc);
				continue;
			}

			} else {
				CAM_ERR(CAM_ISP,
				"config done completion timeout for req_id=%llu rc=%d ctx_index %d",
				cfg->request_id, rc,
				ctx->ctx_index);

					"config done completion timeout, cdm_hang=%d on req_id=%llu ctx_index %d",
					true, cfg->request_id, ctx->ctx_index);
				cam_req_mgr_debug_delay_detect();
				trace_cam_delay_detect("ISP",
					"config done completion timeout",
					cfg->request_id, ctx->ctx_index,
					CAM_DEFAULT_VALUE, CAM_DEFAULT_VALUE,
					rc);

			if (rc == 0)
				rc = -ETIMEDOUT;

			goto end;
				break;
			}
		} else {
			rc = 0;
			CAM_DBG(CAM_ISP,
@@ -2859,7 +2856,8 @@ static int cam_tfe_mgr_config_hw(void *hw_mgr_priv,
	}

	if ((i == CAM_TFE_HW_CONFIG_WAIT_MAX_TRY) && (rc == 0))
		rc = -ETIMEDOUT;
		CAM_DBG(CAM_ISP,
			"Wq delayed but IRQ CDM done");

end:
	CAM_DBG(CAM_ISP, "Exit: Config Done: %llu",  cfg->request_id);
+1 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
 * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
 */

#include <linux/debugfs.h>
@@ -39,7 +40,6 @@ static int cam_ope_context_dump_active_request(void *data,
		return -EINVAL;
	}

	mutex_lock(&ctx->ctx_mutex);
	if (ctx->state < CAM_CTX_ACQUIRED || ctx->state > CAM_CTX_ACTIVATED) {
		CAM_ERR(CAM_OPE, "Invalid state ope ctx %d state %d",
			ctx->ctx_id, ctx->state);
@@ -65,7 +65,6 @@ static int cam_ope_context_dump_active_request(void *data,
	}

end:
	mutex_unlock(&ctx->ctx_mutex);
	return rc;
}