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

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

Merge 5a2e6a78 on remote branch

Change-Id: Iba5e06a8b4dc53647e985dd18d27296d72d1c914
parents 4dd5eea5 5a2e6a78
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -434,6 +434,7 @@ struct cam_cdm_work_payload {
	uint32_t irq_status;
	uint32_t irq_data;
	int fifo_idx;
	ktime_t workq_scheduled_ts;
	struct work_struct work;
};

+6 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
#include "cam_cdm_hw_reg_1_2.h"
#include "cam_cdm_hw_reg_2_0.h"
#include "cam_trace.h"
#include "cam_req_mgr_workq.h"

#define CAM_CDM_BL_FIFO_WAIT_TIMEOUT 2000
#define CAM_CDM_DBG_GEN_IRQ_USR_DATA 0xff
@@ -1105,6 +1106,9 @@ static void cam_hw_cdm_work(struct work_struct *work)
			payload = NULL;
			return;
		}
		cam_req_mgr_thread_switch_delay_detect(
			payload->workq_scheduled_ts);

		CAM_DBG(CAM_CDM, "IRQ status=0x%x", payload->irq_status);
		if (payload->irq_status &
			CAM_CDM_IRQ_STATUS_INLINE_IRQ_MASK) {
@@ -1342,6 +1346,8 @@ irqreturn_t cam_hw_cdm_irq(int irq_num, void *data)
			cdm_hw->soc_info.index);

		cdm_core->bl_fifo[i].work_record++;
		payload[i]->workq_scheduled_ts = ktime_get();

		work_status = queue_work(
				cdm_core->bl_fifo[i].work_queue,
				&payload[i]->work);
+9 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 */

#include <linux/delay.h>
@@ -19,6 +19,7 @@
#include "cam_cdm_core_common.h"
#include "cam_cdm_soc.h"
#include "cam_io_util.h"
#include "cam_req_mgr_workq.h"

#define CAM_CDM_VIRTUAL_NAME "qcom,cam_virtual_cdm"

@@ -32,6 +33,10 @@ static void cam_virtual_cdm_work(struct work_struct *work)
	if (payload) {
		cdm_hw = payload->hw;
		core = (struct cam_cdm *)cdm_hw->core_info;

		cam_req_mgr_thread_switch_delay_detect(
			payload->workq_scheduled_ts);

		if (payload->irq_status & 0x2) {
			struct cam_cdm_bl_cb_request_entry *node;

@@ -183,6 +188,8 @@ int cam_virtual_cdm_submit_bl(struct cam_hw_info *cdm_hw,
					INIT_WORK((struct work_struct *)
						&payload->work,
						cam_virtual_cdm_work);
					payload->workq_scheduled_ts =
						ktime_get();
					queue_work(core->work_queue,
						&payload->work);
				}
+15 −11
Original line number Diff line number Diff line
@@ -1224,7 +1224,7 @@ static int cam_cpas_hw_start(void *hw_priv, void *start_args,
	struct cam_ahb_vote remove_ahb;
	struct cam_axi_vote axi_vote = {0};
	enum cam_vote_level applied_level = CAM_SVS_VOTE;
	int rc, i = 0;
	int rc, rc_eh, i = 0;
	struct cam_cpas_private_soc *soc_private = NULL;
	bool invalid_start = true;

@@ -1339,13 +1339,16 @@ static int cam_cpas_hw_start(void *hw_priv, void *start_args,
		soc_private->gpu_pwr_limit =
			kgsl_pwr_limits_add(KGSL_DEVICE_3D0);
		if (soc_private->gpu_pwr_limit) {
			rc = kgsl_pwr_limits_set_freq(
			rc = kgsl_pwr_limits_set_gpu_fmax(
				soc_private->gpu_pwr_limit,
				soc_private->cx_ipeak_gpu_limit);
			if (rc) {
				kgsl_pwr_limits_del(
					soc_private->gpu_pwr_limit);
				soc_private->gpu_pwr_limit = NULL;
				CAM_ERR(CAM_CPAS,
					"set cx_ipeak_gpu_limit failed, rc %d",
					rc);
				goto remove_axi_vote;
			}
		}
@@ -1395,25 +1398,26 @@ static int cam_cpas_hw_start(void *hw_priv, void *start_args,

remove_axi_vote:
	memset(&axi_vote, 0x0, sizeof(struct cam_axi_vote));
	rc = cam_cpas_util_create_vote_all_paths(cpas_client, &axi_vote);
	if (rc)
		CAM_ERR(CAM_CPAS, "Unable to create per path votes rc: %d", rc);
	rc_eh = cam_cpas_util_create_vote_all_paths(cpas_client, &axi_vote);
	if (rc_eh)
		CAM_ERR(CAM_CPAS,
			"Unable to create per path votes rc_eh: %d", rc_eh);

	cam_cpas_dump_axi_vote_info(cpas_client, "CPAS Start fail Vote",
		&axi_vote);

	rc = cam_cpas_util_apply_client_axi_vote(cpas_hw,
	rc_eh = cam_cpas_util_apply_client_axi_vote(cpas_hw,
		cpas_client, &axi_vote);
	if (rc)
		CAM_ERR(CAM_CPAS, "Unable remove votes rc: %d", rc);
	if (rc_eh)
		CAM_ERR(CAM_CPAS, "Unable remove votes rc_eh: %d", rc_eh);

remove_ahb_vote:
	remove_ahb.type = CAM_VOTE_ABSOLUTE;
	remove_ahb.vote.level = CAM_SUSPEND_VOTE;
	rc = cam_cpas_util_apply_client_ahb_vote(cpas_hw, cpas_client,
	rc_eh = cam_cpas_util_apply_client_ahb_vote(cpas_hw, cpas_client,
		&remove_ahb, NULL);
	if (rc)
		CAM_ERR(CAM_CPAS, "Removing AHB vote failed, rc=%d", rc);
	if (rc_eh)
		CAM_ERR(CAM_CPAS, "Removing AHB vote failed, rc_eh=%d", rc_eh);

error:
	mutex_unlock(&cpas_core->client_mutex[client_indx]);
+16 −7
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 */

#include <linux/of.h>
@@ -118,28 +118,37 @@ const char *cam_cpas_axi_util_trans_type_to_string(
}
EXPORT_SYMBOL(cam_cpas_axi_util_trans_type_to_string);

int cam_cpas_is_feature_supported(uint32_t flag)
bool cam_cpas_is_feature_supported(uint32_t flag,
	uint32_t hw_id)
{
	struct cam_hw_info *cpas_hw = NULL;
	struct cam_cpas_private_soc *soc_private = NULL;
	uint32_t feature_mask;
	uint32_t i;
	bool  supported = true;

	if (!CAM_CPAS_INTF_INITIALIZED()) {
		CAM_ERR(CAM_CPAS, "cpas intf not initialized");
		return -ENODEV;
		return false;
	}

	cpas_hw = (struct cam_hw_info *) g_cpas_intf->hw_intf->hw_priv;
	soc_private =
		(struct cam_cpas_private_soc *)cpas_hw->soc_info.soc_private;
	feature_mask = soc_private->feature_mask;

	if (flag >= CAM_CPAS_FUSE_FEATURE_MAX) {
		CAM_ERR(CAM_CPAS, "Unknown feature flag %x", flag);
		return -EINVAL;
		return false;
	}

	for (i = 0; i < soc_private->num_feature_entries; i++) {
		if ((soc_private->feature_info[i].feature == flag) &&
			(soc_private->feature_info[i].hw_id == hw_id)) {
			supported = soc_private->feature_info[i].enable;
			break;
		}
	}

	return feature_mask & flag ? 1 : 0;
	return supported;
}
EXPORT_SYMBOL(cam_cpas_is_feature_supported);

Loading