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

Commit f754bb1b authored by Jeyaprakash Soundrapandian's avatar Jeyaprakash Soundrapandian Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: isp: Reduce the spinlock window" into dev/msm-4.9-camx

parents 6ca2ced7 f308aecf
Loading
Loading
Loading
Loading
+17 −11
Original line number Diff line number Diff line
@@ -1145,7 +1145,9 @@ static int __cam_isp_ctx_flush_req(struct cam_context *ctx,
	struct cam_ctx_request           *req;
	struct cam_ctx_request           *req_temp;
	struct cam_isp_ctx_req           *req_isp;
	struct list_head                  flush_list;

	INIT_LIST_HEAD(&flush_list);
	spin_lock_bh(&ctx->lock);
	if (list_empty(req_list)) {
		spin_unlock_bh(&ctx->lock);
@@ -1154,11 +1156,22 @@ static int __cam_isp_ctx_flush_req(struct cam_context *ctx,
	}

	list_for_each_entry_safe(req, req_temp, req_list, list) {
		if ((flush_req->type == CAM_REQ_MGR_FLUSH_TYPE_CANCEL_REQ)
				&& (req->request_id != flush_req->req_id))
		if (flush_req->type == CAM_REQ_MGR_FLUSH_TYPE_CANCEL_REQ) {
			if (req->request_id != flush_req->req_id) {
				continue;

			} else {
				list_del_init(&req->list);
				list_add_tail(&req->list, &flush_list);
				cancel_req_id_found = 1;
				break;
			}
		}
		list_del_init(&req->list);
		list_add_tail(&req->list, &flush_list);
	}
	spin_unlock_bh(&ctx->lock);

	list_for_each_entry_safe(req, req_temp, &flush_list, list) {
		req_isp = (struct cam_isp_ctx_req *) req->req_priv;
		for (i = 0; i < req_isp->num_fence_map_out; i++) {
			if (req_isp->fence_map_out[i].sync_id != -1) {
@@ -1175,14 +1188,7 @@ static int __cam_isp_ctx_flush_req(struct cam_context *ctx,
			}
		}
		list_add_tail(&req->list, &ctx->free_req_list);

		/* If flush request id found, exit the loop */
		if (flush_req->type == CAM_REQ_MGR_FLUSH_TYPE_CANCEL_REQ) {
			cancel_req_id_found = 1;
			break;
	}
	}
	spin_unlock_bh(&ctx->lock);

	if (flush_req->type == CAM_REQ_MGR_FLUSH_TYPE_CANCEL_REQ &&
		!cancel_req_id_found)