msm: camera: sync: Add SYNC_CANCEL support in sync driver

Add SYNC_CANCEL definition and signal CANCEL instead of
ERROR in flush cases.

CRs-Fixed: 2673810
Change-Id: I1bd83e382f9b38f5f020a5af3b883083e211e3d2
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
This commit is contained in:
Pavan Kumar Chilamkurthi
2020-04-27 20:59:07 -07:00
parent beb3ea37bb
commit 74410fea6b
6 changed files with 70 additions and 25 deletions

View File

@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Copyright (c) 2017-2018, 2020 The Linux Foundation. All rights reserved.
*/
#include "cam_sync_util.h"
@@ -88,8 +88,9 @@ int cam_sync_init_group_object(struct sync_table_row *table,
}
/* check for child's state */
if (child_row->state == CAM_SYNC_STATE_SIGNALED_ERROR) {
row->state = CAM_SYNC_STATE_SIGNALED_ERROR;
if ((child_row->state == CAM_SYNC_STATE_SIGNALED_ERROR) ||
(child_row->state == CAM_SYNC_STATE_SIGNALED_CANCEL)) {
row->state = child_row->state;
spin_unlock_bh(&sync_dev->row_spinlocks[sync_objs[i]]);
continue;
}
@@ -123,7 +124,8 @@ int cam_sync_init_group_object(struct sync_table_row *table,
}
if (!row->remaining) {
if (row->state != CAM_SYNC_STATE_SIGNALED_ERROR)
if ((row->state != CAM_SYNC_STATE_SIGNALED_ERROR) &&
(row->state != CAM_SYNC_STATE_SIGNALED_CANCEL))
row->state = CAM_SYNC_STATE_SIGNALED_SUCCESS;
complete_all(&row->signaled);
}
@@ -392,6 +394,7 @@ int cam_sync_util_update_parent_state(struct sync_table_row *parent_row,
break;
case CAM_SYNC_STATE_SIGNALED_ERROR:
case CAM_SYNC_STATE_SIGNALED_CANCEL:
break;
case CAM_SYNC_STATE_INVALID: