msm: camera: common: changes to handle err in bazel build

Currently, the 'mm/slab.h' header is used to access a private kernel
structure. With Bazel, private headers are not available.
Refactor the code to avoid the use of the private header.

CRs-Fixed: 3535645
Change-Id: I3b442f0a7b2b70fbf638d3f505c47de88b14c5e6
Signed-off-by: Soumen Ghosh <quic_soumeng@quicinc.com>
This commit is contained in:
Soumen Ghosh
2023-08-03 16:50:00 -07:00
committed by Camera Software Integration
parent 9e0b27fa09
commit 24a496388f
4 changed files with 26 additions and 8 deletions

View File

@@ -130,6 +130,24 @@ ddk_headers(
],
)
genrule(
name = "camera_banner_header",
srcs = [],
outs = ["cam_generated.h"],
cmd = """
{
printf '#define CAMERA_COMPILE_TIME "%s"\n' "$$(date)"
printf '#define CAMERA_COMPILE_BY "%s"\n' "$$(whoami)"
printf '#define CAMERA_COMPILE_HOST "%s"\n' "$$(uname -n)"
} > "$@"
"""
)
ddk_headers(
name = "camera_banner",
hdrs = [":camera_banner_header"],
)
load(":camera_modules.bzl", "define_camera_module")
define_camera_module()

View File

@@ -5,13 +5,14 @@ def _define_module(target, variant):
tv = "{}_{}".format(target, variant)
deps = [
":camera_headers",
":camera_banner",
"//msm-kernel:all_headers",
]
if target == "pineapple":
deps.extend([
"//vendor/qcom/opensource/synx-kernel:synx_headers",
"//vendor/qcom/opensource/synx-kernel:{}_modules".format(tv),
"//vendor/qcom/opensource/securemsm-kernel:securemsm_kernel_headers",
"//vendor/qcom/opensource/securemsm-kernel:qseecom_kernel_headers",
"//vendor/qcom/opensource/securemsm-kernel:smmu_proxy_headers",
"//vendor/qcom/opensource/securemsm-kernel:{}_smcinvoke_dlkm".format(tv),
"//vendor/qcom/opensource/securemsm-kernel:{}_smmu_proxy_dlkm".format(tv),
@@ -215,6 +216,7 @@ def _define_module(target, variant):
],
},
},
copts = ["-include", "$(location :camera_banner)"],
deps = deps,
kconfig = "Kconfig",
defconfig = "{}_defconfig".format(tv),

View File

@@ -11,8 +11,6 @@
#include <linux/types.h>
#include <linux/rwsem.h>
#include <mm/slab.h>
#include <media/v4l2-fh.h>
#include <media/v4l2-device.h>
#include <media/v4l2-event.h>
@@ -1004,14 +1002,12 @@ static int cam_req_mgr_component_master_bind(struct device *dev)
INIT_LIST_HEAD(&cam_req_mgr_ordered_sd_list);
if (g_cam_req_mgr_timer_cachep == NULL) {
g_cam_req_mgr_timer_cachep = kmem_cache_create("crm_timer",
sizeof(struct cam_req_mgr_timer), 64, 0x0, NULL);
g_cam_req_mgr_timer_cachep = KMEM_CACHE(cam_req_mgr_timer, 0x0);
if (!g_cam_req_mgr_timer_cachep)
CAM_ERR(CAM_CRM,
"Failed to create kmem_cache for crm_timer");
else
CAM_DBG(CAM_CRM, "Name : %s",
g_cam_req_mgr_timer_cachep->name);
CAM_DBG(CAM_CRM, "Name : cam_req_mgr_timer");
}
CAM_DBG(CAM_CRM, "All probes done, binding slave components");

View File

@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#include <linux/module.h>
#include <linux/build_bug.h>
@@ -61,7 +61,9 @@
#include "cam_csid_ppi100.h"
#include "camera_main.h"
#ifndef CAMERA_COMPILE_BY
#include "cam_generated_h"
#endif
char camera_banner[] = "Camera-Banner: (" CAMERA_COMPILE_BY "@"
CAMERA_COMPILE_HOST ") (" CAMERA_COMPILE_TIME ")";