mirror of
https://github.com/commaai/agnos-kernel-sdm845.git
synced 2026-06-08 11:24:51 +08:00
camera: 3 Camera concurrency work
Modified the limit of links in per session [IssueID]:redmineID82126 [Module]: kernel/msm-4.9 Change-Id: I298282b5faf5056167beddebbe9b603887aa6bdb
This commit is contained in:
@@ -1259,9 +1259,9 @@ static struct cam_req_mgr_core_link *__cam_req_mgr_reserve_link(
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (session->num_links >= MAX_LINKS_PER_SESSION) {
|
||||
if (session->num_links >= MAXIMUM_LINKS_PER_SESSION) {
|
||||
CAM_ERR(CAM_CRM, "Reached max links %d per session limit %d",
|
||||
session->num_links, MAX_LINKS_PER_SESSION);
|
||||
session->num_links, MAXIMUM_LINKS_PER_SESSION);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1296,7 +1296,7 @@ static struct cam_req_mgr_core_link *__cam_req_mgr_reserve_link(
|
||||
|
||||
mutex_lock(&session->lock);
|
||||
/* Loop through and find a free index */
|
||||
for (i = 0; i < MAX_LINKS_PER_SESSION; i++) {
|
||||
for (i = 0; i < MAXIMUM_LINKS_PER_SESSION; i++) {
|
||||
if (!session->links[i]) {
|
||||
CAM_DBG(CAM_CRM,
|
||||
"Free link index %d found, num_links=%d",
|
||||
@@ -1306,7 +1306,7 @@ static struct cam_req_mgr_core_link *__cam_req_mgr_reserve_link(
|
||||
}
|
||||
}
|
||||
|
||||
if (i == MAX_LINKS_PER_SESSION) {
|
||||
if (i == MAXIMUM_LINKS_PER_SESSION) {
|
||||
CAM_ERR(CAM_CRM, "Free link index not found");
|
||||
goto error;
|
||||
}
|
||||
@@ -1367,7 +1367,7 @@ static void __cam_req_mgr_unreserve_link(
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < MAX_LINKS_PER_SESSION; i++) {
|
||||
for (i = 0; i < MAXIMUM_LINKS_PER_SESSION; i++) {
|
||||
if (session->links[i] == link)
|
||||
session->links[i] = NULL;
|
||||
}
|
||||
@@ -1379,7 +1379,7 @@ static void __cam_req_mgr_unreserve_link(
|
||||
* of only having 2 links in a given session
|
||||
*/
|
||||
session->sync_mode = CAM_REQ_MGR_SYNC_MODE_NO_SYNC;
|
||||
for (i = 0; i < MAX_LINKS_PER_SESSION; i++) {
|
||||
for (i = 0; i < MAXIMUM_LINKS_PER_SESSION; i++) {
|
||||
if (session->links[i])
|
||||
session->links[i]->sync_link = NULL;
|
||||
}
|
||||
@@ -2295,7 +2295,7 @@ int cam_req_mgr_destroy_session(
|
||||
ses_info->session_hdl,
|
||||
cam_session->num_links);
|
||||
|
||||
for (i = 0; i < MAX_LINKS_PER_SESSION; i++) {
|
||||
for (i = 0; i < MAXIMUM_LINKS_PER_SESSION; i++) {
|
||||
link = cam_session->links[i];
|
||||
|
||||
if (!link)
|
||||
@@ -2535,7 +2535,8 @@ int cam_req_mgr_sync_config(
|
||||
}
|
||||
|
||||
if ((sync_info->num_links < 0) ||
|
||||
(sync_info->num_links > MAX_LINKS_PER_SESSION)) {
|
||||
(sync_info->num_links >
|
||||
MAX_LINKS_PER_SESSION)) {
|
||||
CAM_ERR(CAM_CRM, "Invalid num links %d", sync_info->num_links);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -2681,6 +2682,13 @@ int cam_req_mgr_link_control(struct cam_req_mgr_link_control *control)
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (control->num_links > MAX_LINKS_PER_SESSION) {
|
||||
CAM_ERR(CAM_CRM, "Invalid number of links %d",
|
||||
control->num_links);
|
||||
rc = -EINVAL;
|
||||
goto end;
|
||||
}
|
||||
|
||||
mutex_lock(&g_crm_core_dev->crm_lock);
|
||||
for (i = 0; i < control->num_links; i++) {
|
||||
link = (struct cam_req_mgr_core_link *)
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
|
||||
#define SYNC_LINK_SOF_CNT_MAX_LMT 1
|
||||
|
||||
#define MAXIMUM_LINKS_PER_SESSION 4
|
||||
|
||||
/**
|
||||
* enum crm_workq_task_type
|
||||
* @codes: to identify which type of task is present
|
||||
|
||||
Reference in New Issue
Block a user