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

Commit 259e6f55 authored by Mangalaram ARCHANA's avatar Mangalaram ARCHANA Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: req_mgr: Increase device handles in hdl_tbl



Increasing device handles to 128 in handle table.

CRs-Fixed: 2532741
Change-Id: I58278026d08865cd7935bf4f0dd04f6a594c6dbc
Signed-off-by: default avatarMangalaram ARCHANA <mangar@codeaurora.org>
parent f3af7922
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ int cam_req_mgr_util_init(void)
	hdl_tbl = hdl_tbl_local;
	spin_unlock_bh(&hdl_tbl_lock);

	bitmap_size = BITS_TO_LONGS(CAM_REQ_MGR_MAX_HANDLES) * sizeof(long);
	bitmap_size = BITS_TO_LONGS(CAM_REQ_MGR_MAX_HANDLES_V2) * sizeof(long);
	hdl_tbl->bitmap = kzalloc(bitmap_size, GFP_KERNEL);
	if (!hdl_tbl->bitmap) {
		rc = -ENOMEM;
@@ -92,7 +92,7 @@ int cam_req_mgr_util_free_hdls(void)
		return -EINVAL;
	}

	for (i = 0; i < CAM_REQ_MGR_MAX_HANDLES; i++) {
	for (i = 0; i < CAM_REQ_MGR_MAX_HANDLES_V2; i++) {
		if (hdl_tbl->hdl[i].state == HDL_ACTIVE) {
			CAM_WARN(CAM_CRM, "Dev handle = %x session_handle = %x",
				hdl_tbl->hdl[i].hdl_value,
@@ -101,7 +101,7 @@ int cam_req_mgr_util_free_hdls(void)
			clear_bit(i, hdl_tbl->bitmap);
		}
	}
	bitmap_zero(hdl_tbl->bitmap, CAM_REQ_MGR_MAX_HANDLES);
	bitmap_zero(hdl_tbl->bitmap, CAM_REQ_MGR_MAX_HANDLES_V2);
	spin_unlock_bh(&hdl_tbl_lock);

	return 0;
@@ -113,7 +113,7 @@ static int32_t cam_get_free_handle_index(void)

	idx = find_first_zero_bit(hdl_tbl->bitmap, hdl_tbl->bits);

	if (idx >= CAM_REQ_MGR_MAX_HANDLES || idx < 0)
	if (idx >= CAM_REQ_MGR_MAX_HANDLES_V2 || idx < 0)
		return -ENOSR;

	set_bit(idx, hdl_tbl->bitmap);
@@ -201,7 +201,7 @@ void *cam_get_device_priv(int32_t dev_hdl)
	}

	idx = CAM_REQ_MGR_GET_HDL_IDX(dev_hdl);
	if (idx >= CAM_REQ_MGR_MAX_HANDLES) {
	if (idx >= CAM_REQ_MGR_MAX_HANDLES_V2) {
		CAM_ERR_RATE_LIMIT(CAM_CRM, "Invalid idx");
		goto device_priv_fail;
	}
@@ -245,7 +245,7 @@ void *cam_get_device_ops(int32_t dev_hdl)
	}

	idx = CAM_REQ_MGR_GET_HDL_IDX(dev_hdl);
	if (idx >= CAM_REQ_MGR_MAX_HANDLES) {
	if (idx >= CAM_REQ_MGR_MAX_HANDLES_V2) {
		CAM_ERR(CAM_CRM, "Invalid idx");
		goto device_ops_fail;
	}
@@ -288,7 +288,7 @@ static int cam_destroy_hdl(int32_t dev_hdl, int dev_hdl_type)
	}

	idx = CAM_REQ_MGR_GET_HDL_IDX(dev_hdl);
	if (idx >= CAM_REQ_MGR_MAX_HANDLES) {
	if (idx >= CAM_REQ_MGR_MAX_HANDLES_V2) {
		CAM_ERR(CAM_CRM, "Invalid idx %d", idx);
		goto destroy_hdl_fail;
	}
+2 −2
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
 */

#ifndef _CAM_REQ_MGR_UTIL_API_H_
@@ -54,7 +54,7 @@ struct handle {
 * @bits: size of bit map in bits
 */
struct cam_req_mgr_util_hdl_tbl {
	struct handle hdl[CAM_REQ_MGR_MAX_HANDLES];
	struct handle hdl[CAM_REQ_MGR_MAX_HANDLES_V2];
	void *bitmap;
	size_t bits;
};