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

Commit 2bbbf232 authored by Junzhe Zou's avatar Junzhe Zou
Browse files

msm: camera: sync: Allow drivers to register cb for the same fence id



In batch mode, to get better result, LRME HW needs to process the first
and the last frame of the first batch as REF and TAR. Since those two
frames share the same fence id, LRME needs to be able to register the
callback with this fence twice. Without this change, the second callback
would be rejected, and hence the first config packet would fail.

Change-Id: Ib13cc284e7c41f5c411bbc5b4e94fe7fbd9b9c12
Signed-off-by: default avatarJunzhe Zou <jnzhezou@codeaurora.org>
parent eec33478
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -65,7 +65,6 @@ int cam_sync_register_callback(sync_callback cb_func,
	void *userdata, int32_t sync_obj)
{
	struct sync_callback_info *sync_cb;
	struct sync_callback_info *cb_info;
	struct sync_table_row *row = NULL;
	int status = 0;

@@ -83,17 +82,6 @@ int cam_sync_register_callback(sync_callback cb_func,
		return -EINVAL;
	}

	/* Don't register if callback was registered earlier */
	list_for_each_entry(cb_info, &row->callback_list, list) {
		if (cb_info->callback_func == cb_func &&
			cb_info->cb_data == userdata) {
			CAM_ERR(CAM_SYNC, "Duplicate register for sync_obj %d",
				sync_obj);
			spin_unlock_bh(&sync_dev->row_spinlocks[sync_obj]);
			return -EALREADY;
		}
	}

	sync_cb = kzalloc(sizeof(*sync_cb), GFP_ATOMIC);
	if (!sync_cb) {
		spin_unlock_bh(&sync_dev->row_spinlocks[sync_obj]);