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

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

Merge 4bebb220 on remote branch

Change-Id: I10b61faa5a997599516241e9c54f2cbb804f0e54
parents 825e8041 4bebb220
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ static const struct of_device_id msm_cam_hw_cdm_dt_match[] = {
		.compatible = CAM_HW_CDM_OPE_NAME_2_1,
		.data = &cam_cdm_2_1_reg_offset,
	},
	{},
};

static enum cam_cdm_id cam_hw_cdm_get_id_by_name(char *name)
+28 −1
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) 2017-2021, The Linux Foundation. All rights reserved.
 */

#include <linux/slab.h>
@@ -182,6 +182,33 @@ int cam_context_handle_crm_apply_req(struct cam_context *ctx,
	return rc;
}

int cam_context_handle_crm_state_change(struct cam_context *ctx,
	struct cam_req_mgr_request_change_state *state_info)
{
	int rc;

	if (!ctx->state_machine) {
		CAM_ERR(CAM_CORE, "Context is not ready");
		return -EINVAL;
	}

	if (!state_info) {
		CAM_ERR(CAM_CORE, "Invalid change state payload");
		return -EINVAL;
	}

	if (ctx->state_machine[ctx->state].crm_ops.change_state) {
		rc = ctx->state_machine[ctx->state].crm_ops.change_state(ctx,
			state_info);
	} else {
		CAM_ERR(CAM_CORE, "No crm change state req in dev %d, state %d",
			ctx->dev_hdl, ctx->state);
		rc = -EPROTO;
	}

	return rc;
}

int cam_context_handle_crm_notify_frame_skip(
	struct cam_context *ctx,
	struct cam_req_mgr_apply_request *apply)
+16 −1
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) 2017-2021, The Linux Foundation. All rights reserved.
 */

#ifndef _CAM_CONTEXT_H_
@@ -127,6 +127,7 @@ struct cam_ctx_ioctl_ops {
 * @flush_req:             Flush request to remove request ids
 * @process_evt:           Handle event notification from CRM.(optional)
 * @dump_req:              Dump information for the issue request
 * @change_state:          Change sub-state of hw context layer to bubble
 *
 */
struct cam_ctx_crm_ops {
@@ -146,6 +147,8 @@ struct cam_ctx_crm_ops {
			struct cam_req_mgr_link_evt_data *evt_data);
	int (*dump_req)(struct cam_context *ctx,
			struct cam_req_mgr_dump_info *dump);
	int (*change_state)(struct cam_context *ctx,
			struct cam_req_mgr_request_change_state *change_state);
};


@@ -310,6 +313,18 @@ int cam_context_handle_crm_unlink(struct cam_context *ctx,
int cam_context_handle_crm_apply_req(struct cam_context *ctx,
		struct cam_req_mgr_apply_request *apply);

/**
 * cam_context_handle_crm_state_change()
 *
 * @brief:        Handle state change request
 *
 * @ctx:          Object pointer for cam_context
 * @state_info:   State change request command payload
 *
 */
int cam_context_handle_crm_state_change(struct cam_context *ctx,
		struct cam_req_mgr_request_change_state *state_info);

/**
 * cam_context_handle_crm_notify_frame_skip()
 *
+20 −1
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) 2017-2021, The Linux Foundation. All rights reserved.
 */

#include <linux/debugfs.h>
@@ -619,6 +619,24 @@ static int __cam_node_crm_flush_req(struct cam_req_mgr_flush_request *flush)
	return cam_context_handle_crm_flush_req(ctx, flush);
}

static int __cam_node_crm_state_change_req(
	struct cam_req_mgr_request_change_state *state_info)
{
	struct cam_context *ctx = NULL;

	if (!state_info)
		return -EINVAL;

	ctx = (struct cam_context *) cam_get_device_priv(state_info->dev_hdl);
	if (!ctx) {
		CAM_ERR(CAM_CORE, "Can not get context for handle %d",
			state_info->dev_hdl);
		return -EINVAL;
	}

	return cam_context_handle_crm_state_change(ctx, state_info);
}

static int __cam_node_crm_process_evt(
	struct cam_req_mgr_link_evt_data *evt_data)
{
@@ -715,6 +733,7 @@ int cam_node_init(struct cam_node *node, struct cam_hw_mgr_intf *hw_mgr_intf,
	node->crm_node_intf.dump_req = __cam_node_crm_dump_req;
	node->crm_node_intf.notify_frame_skip =
		__cam_node_crm_notify_frame_skip;
	node->crm_node_intf.change_state = __cam_node_crm_state_change_req;

	mutex_init(&node->list_mutex);
	INIT_LIST_HEAD(&node->free_ctx_list);
+3 −3
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
 */

#include <linux/debugfs.h>
@@ -549,6 +549,7 @@ static int __cam_custom_ctx_get_dev_info_in_acquired(struct cam_context *ctx,
	dev_info->dev_id = CAM_REQ_MGR_DEVICE_CUSTOM_HW;
	dev_info->p_delay = 1;
	dev_info->trigger = CAM_TRIGGER_POINT_SOF;
	dev_info->sof_ts_cb = NULL;

	return 0;
}
@@ -1266,10 +1267,10 @@ static int __cam_custom_ctx_config_dev(struct cam_context *ctx,
		if ((ctx->state != CAM_CTX_FLUSHED) &&
			(ctx->state >= CAM_CTX_READY) &&
			(ctx->ctx_crm_intf->add_req)) {
			memset(&add_req, 0, sizeof(add_req));
			add_req.link_hdl = ctx->link_hdl;
			add_req.dev_hdl  = ctx->dev_hdl;
			add_req.req_id   = req->request_id;
			add_req.skip_before_applying = 0;
			rc = ctx->ctx_crm_intf->add_req(&add_req);
			if (rc) {
				CAM_ERR(CAM_CUSTOM,
@@ -1375,7 +1376,6 @@ static int __cam_custom_ctx_link_in_acquired(struct cam_context *ctx,

	ctx->link_hdl = link->link_hdl;
	ctx->ctx_crm_intf = link->crm_cb;
	ctx_custom->subscribe_event = link->subscribe_event;

	/* change state only if we had the init config */
	if (ctx_custom->init_received)
Loading