msm: camera: jpeg: Increase number of jpeg contexts

Fixed out of memory issue in triple camera usecase by increasing
number of logical jpeg contexts.

CRs-Fixed: 2587592
Change-Id: I25c99c0be8d3986bc11fbc2894a0dbf27c645d4e
Signed-off-by: Suraj Dongre <sdongre@codeaurora.org>
Signed-off-by: Mukund Madhusudan Atre <matre@codeaurora.org>
This commit is contained in:
Suraj Dongre
2019-11-20 22:23:37 -08:00
committed by Gerrit - the friendly Code Review server
parent b08e2b4099
commit 2e181b7f9c
4 changed files with 9 additions and 8 deletions

View File

@@ -97,7 +97,7 @@ static int cam_jpeg_dev_remove(struct platform_device *pdev)
int rc; int rc;
int i; int i;
for (i = 0; i < CAM_CTX_MAX; i++) { for (i = 0; i < CAM_JPEG_CTX_MAX; i++) {
rc = cam_jpeg_context_deinit(&g_jpeg_dev.ctx_jpeg[i]); rc = cam_jpeg_context_deinit(&g_jpeg_dev.ctx_jpeg[i]);
if (rc) if (rc)
CAM_ERR(CAM_JPEG, "JPEG context %d deinit failed %d", CAM_ERR(CAM_JPEG, "JPEG context %d deinit failed %d",
@@ -135,7 +135,7 @@ static int cam_jpeg_dev_probe(struct platform_device *pdev)
goto unregister; goto unregister;
} }
for (i = 0; i < CAM_CTX_MAX; i++) { for (i = 0; i < CAM_JPEG_CTX_MAX; i++) {
rc = cam_jpeg_context_init(&g_jpeg_dev.ctx_jpeg[i], rc = cam_jpeg_context_init(&g_jpeg_dev.ctx_jpeg[i],
&g_jpeg_dev.ctx[i], &g_jpeg_dev.ctx[i],
&node->hw_mgr_intf, &node->hw_mgr_intf,
@@ -147,7 +147,7 @@ static int cam_jpeg_dev_probe(struct platform_device *pdev)
} }
} }
rc = cam_node_init(node, &hw_mgr_intf, g_jpeg_dev.ctx, CAM_CTX_MAX, rc = cam_node_init(node, &hw_mgr_intf, g_jpeg_dev.ctx, CAM_JPEG_CTX_MAX,
CAM_JPEG_DEV_NAME); CAM_JPEG_DEV_NAME);
if (rc) { if (rc) {
CAM_ERR(CAM_JPEG, "JPEG node init failed %d", rc); CAM_ERR(CAM_JPEG, "JPEG node init failed %d", rc);

View File

@@ -24,8 +24,8 @@
struct cam_jpeg_dev { struct cam_jpeg_dev {
struct cam_subdev sd; struct cam_subdev sd;
struct cam_node *node; struct cam_node *node;
struct cam_context ctx[CAM_CTX_MAX]; struct cam_context ctx[CAM_JPEG_CTX_MAX];
struct cam_jpeg_context ctx_jpeg[CAM_CTX_MAX]; struct cam_jpeg_context ctx_jpeg[CAM_JPEG_CTX_MAX];
struct mutex jpeg_mutex; struct mutex jpeg_mutex;
int32_t open_cnt; int32_t open_cnt;
}; };

View File

@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */ /* SPDX-License-Identifier: GPL-2.0-only */
/* /*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
*/ */
#ifndef CAM_JPEG_HW_INTF_H #ifndef CAM_JPEG_HW_INTF_H
@@ -8,7 +8,6 @@
#include "cam_cpas_api.h" #include "cam_cpas_api.h"
#define CAM_JPEG_CTX_MAX 8
#define CAM_JPEG_DEV_PER_TYPE_MAX 1 #define CAM_JPEG_DEV_PER_TYPE_MAX 1
#define CAM_JPEG_CMD_BUF_MAX_SIZE 128 #define CAM_JPEG_CMD_BUF_MAX_SIZE 128

View File

@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */ /* SPDX-License-Identifier: GPL-2.0-only */
/* /*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
*/ */
#ifndef CAM_JPEG_HW_MGR_INTF_H #ifndef CAM_JPEG_HW_MGR_INTF_H
@@ -10,6 +10,8 @@
#include <media/cam_jpeg.h> #include <media/cam_jpeg.h>
#include <media/cam_defs.h> #include <media/cam_defs.h>
#define CAM_JPEG_CTX_MAX 16
int cam_jpeg_hw_mgr_init(struct device_node *of_node, int cam_jpeg_hw_mgr_init(struct device_node *of_node,
uint64_t *hw_mgr_hdl, int *iommu_hdl); uint64_t *hw_mgr_hdl, int *iommu_hdl);