msm: camera: common: Added support for multiple project configuration

multiple targets can have same kernel config which can break
existing camera bezel compilation. Added support for multiple
project compilation for camera.

CRs-Fixed: 3740838
Change-Id: I6d0a6ccdbf0bdd4b090e45a0464d96c06b7bc4af
Signed-off-by: Alok Chauhan <quic_alokc@quicinc.com>
This commit is contained in:
Alok Chauhan 2024-02-20 19:56:33 +05:30
parent 583fbf8d3a
commit 168e1b1d62
2 changed files with 41 additions and 13 deletions

View File

@ -15,6 +15,11 @@ DLKM_DIR := $(TOP)/device/qcom/common/dlkm
LOCAL_MODULE_DDK_BUILD := true
LOCAL_MODULE_DDK_SUBTARGET_REGEX := "camera.*"
ifeq ($(TARGET_BOARD_PLATFORM), volcano)
LOCAL_MODULE_DDK_SUBTARGET_REGEX := "$(TARGET_BOARD_PLATFORM)_camera.*"
endif
# List of board platforms for which MMRM driver API should be enabled
MMRM_BOARDS := taro parrot kalama pineapple crow volcono

View File

@ -1,26 +1,38 @@
load("//build/kernel/kleaf:kernel.bzl", "ddk_module")
load("//build/bazel_common_rules/dist:dist.bzl", "copy_to_dist_dir")
load("//msm-kernel:target_variants.bzl", "get_all_variants")
load("//msm-kernel:target_variants.bzl", "get_all_lunch_target_base_target_variants")
def _define_module(target, variant, lunch_target=None):
if lunch_target:
tv = "{}_{}".format(target, variant)
tvl = "{}_{}_{}".format(target, variant, lunch_target)
ddk_mod_name = "{}_camera".format(tvl)
defconfig = "{}_defconfig".format(lunch_target)
else:
tv = "{}_{}".format(target, variant)
ddk_mod_name = "{}_camera".format(tv)
defconfig = "{}_defconfig".format(target)
def _define_module(target, variant):
tv = "{}_{}".format(target, variant)
deps = [
":camera_headers",
":camera_banner",
"//msm-kernel:all_headers",
"//vendor/qcom/opensource/securemsm-kernel:smcinvoke_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),
"//vendor/qcom/opensource/mmrm-driver:{}_mmrm_driver".format(tv),
]
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:smcinvoke_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),
"//vendor/qcom/opensource/mmrm-driver:{}_mmrm_driver".format(tv),
])
ddk_module(
name = "{}_camera".format(tv),
name = ddk_mod_name,
out = "camera.ko",
srcs = [
"drivers/cam_req_mgr/cam_req_mgr_core.c",
@ -247,16 +259,25 @@ def _define_module(target, variant):
],
},
},
copts = ["-include", "$(location :camera_banner)"],
copts = ["-Wno-implicit-fallthrough", "-include", "$(location :camera_banner)"],
deps = deps,
kconfig = "Kconfig",
defconfig = "{}_defconfig".format(target),
defconfig = defconfig,
kernel_build = "//msm-kernel:{}".format(tv),
)
if lunch_target:
dist_target_name = "{}_camera_dist".format(tvl)
data = [":{}_camera".format(tvl)]
else:
dist_target_name = "{}_camera_dist".format(tv)
data = [":{}_camera".format(tv)]
copy_to_dist_dir(
name = "{}_camera_dist".format(tv),
data = [":{}_camera".format(tv)],
name = dist_target_name,
data = data,
dist_dir = "out/target/product/{}/dlkm/lib/modules/".format(target),
flat = True,
wipe_dist_dir = False,
@ -266,4 +287,6 @@ def _define_module(target, variant):
def define_camera_module():
for (t, v) in get_all_variants():
_define_module(t, v)
_define_module(t, v)
for (lt, bt, v) in get_all_lunch_target_base_target_variants():
_define_module(bt, v, lt)