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

Commit 6bda2323 authored by Tony Lijo Jose's avatar Tony Lijo Jose
Browse files

msm: camera: flash: Apply flash packets at epoch instead of eof



Partial lighted frame can be observed if flash packet is getting applied
at  eof instead of epoch. This change make the flash packet to be
applied at epoch instead of eof.

CRs-Fixed: 2853936
Change-Id: I77dac7c0b8cb8149f26c5f89cced590bc3b957ee
Signed-off-by: default avatarTony Lijo Jose <tjose@codeaurora.org>
parent 51f76262
Loading
Loading
Loading
Loading
+9 −4
Original line number Original line Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
// SPDX-License-Identifier: GPL-2.0-only
/*
/*
 * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
 */
 */


#include <linux/module.h>
#include <linux/module.h>
@@ -568,8 +568,6 @@ static void __cam_req_mgr_flush_req_slot(
	in_q->rd_idx = 0;
	in_q->rd_idx = 0;
	link->trigger_cnt[0] = 0;
	link->trigger_cnt[0] = 0;
	link->trigger_cnt[1] = 0;
	link->trigger_cnt[1] = 0;
	link->trigger_mask = 0;
	link->subscribe_event &= ~CAM_TRIGGER_POINT_EOF;
}
}


/**
/**
@@ -823,6 +821,12 @@ static int __cam_req_mgr_send_req(struct cam_req_mgr_core_link *link,
			continue;
			continue;
		}
		}


		if (slot->ops.apply_at_eof && slot->ops.skip_next_frame) {
			CAM_ERR(CAM_CRM,
				"Both EOF and SOF trigger is not supported");
			return -EINVAL;
		}

		if (dev->dev_hdl != slot->ops.dev_hdl) {
		if (dev->dev_hdl != slot->ops.dev_hdl) {
			CAM_DBG(CAM_CRM,
			CAM_DBG(CAM_CRM,
				"Dev_hdl : %d Not matched:: Expected dev_hdl: %d",
				"Dev_hdl : %d Not matched:: Expected dev_hdl: %d",
@@ -2652,7 +2656,8 @@ int cam_req_mgr_process_add_req(void *priv, void *data)
			(add_req->skip_before_applying & 0xFF));
			(add_req->skip_before_applying & 0xFF));
	}
	}


	if (add_req->trigger_eof) {
	/* Used when Precise Flash is enabled */
	if ((add_req->trigger_eof) && (!add_req->skip_before_applying)) {
		slot->ops.apply_at_eof = true;
		slot->ops.apply_at_eof = true;
		slot->ops.dev_hdl = add_req->dev_hdl;
		slot->ops.dev_hdl = add_req->dev_hdl;
		CAM_DBG(CAM_REQ,
		CAM_DBG(CAM_REQ,
+10 −6
Original line number Original line Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
// SPDX-License-Identifier: GPL-2.0-only
/*
/*
 * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
 */
 */


#include <linux/module.h>
#include <linux/module.h>
@@ -1546,9 +1546,12 @@ int cam_flash_pmic_pkt_parser(struct cam_flash_ctrl *fctrl, void *arg)


			CAM_DBG(CAM_FLASH,
			CAM_DBG(CAM_FLASH,
				"FLASH_CMD_TYPE op:%d", flash_data->opcode);
				"FLASH_CMD_TYPE op:%d", flash_data->opcode);
			if (flash_data->opcode == CAMERA_SENSOR_FLASH_OP_OFF)
				add_req.skip_before_applying |= SKIP_NEXT_FRAME;


			if (flash_data->opcode ==
			if (flash_data->opcode ==
				CAMERA_SENSOR_FLASH_OP_FIREDURATION) {
				CAMERA_SENSOR_FLASH_OP_FIREDURATION) {
				add_req.trigger_eof = true;
				/* Active time for the preflash */
				/* Active time for the preflash */
				flash_data->flash_active_time_ms =
				flash_data->flash_active_time_ms =
				(flash_operation_info->time_on_duration_ns)
				(flash_operation_info->time_on_duration_ns)
@@ -1745,13 +1748,14 @@ int cam_flash_pmic_pkt_parser(struct cam_flash_ctrl *fctrl, void *arg)


		if ((csl_packet->header.op_code & 0xFFFFF) ==
		if ((csl_packet->header.op_code & 0xFFFFF) ==
			CAM_FLASH_PACKET_OPCODE_SET_OPS) {
			CAM_FLASH_PACKET_OPCODE_SET_OPS) {
			add_req.skip_before_applying |= SKIP_NEXT_FRAME;
			if ((flash_data->opcode !=
			add_req.trigger_eof = true;

			if (flash_data && (flash_data->opcode !=
				CAMERA_SENSOR_FLASH_OP_FIREDURATION))
				CAMERA_SENSOR_FLASH_OP_FIREDURATION))
				add_req.skip_before_applying |= 1;
				add_req.skip_before_applying |= 1;
			else
			else if (flash_data->opcode ==
				CAMERA_SENSOR_FLASH_OP_FIREDURATION) {
				CAM_DBG(CAM_FLASH, "Trigger eof is set for request ");
				add_req.trigger_eof = true;
			} else
				add_req.skip_before_applying = 0;
				add_req.skip_before_applying = 0;
		} else {
		} else {
			add_req.skip_before_applying = 0;
			add_req.skip_before_applying = 0;