This repository places out-of-tree MediaTek camera kernel modules. The folder structure is listed below:
mtkcam/
├── include/
├── camsys/
│ ├── isp7_1/
│ ├── isp7s/
│ ├── isp7sp/
│ ├── remoteproc/
│ ├── rpmsg/
│ └── common/
├── imgsensor/
│ ├── src-v4l2/
│ └── inc/
├── mtk-aie/
├── mtk-dpe/
├── mtk-hcp/
├── mtk-ipesys-me/
├── ccusys/
├── scpsys/
└── sched/
The include
subdirectory places the public kernel header files that
are used by kernel modules in the mtkcam
directory.
The camsys
subdirectory contains ISP7.x kernel module implementations
from ISP7.1 to ISP7sp.
We opt to support Linux kernel version within the same ISP kernel module
implementation by using the macro
LINUX_VERSION_CODE
defined in linux/version.h
.
TODO: need documentation contribution...
TODO: need documentation contribution...
TODO: need documentation contribution...
TODO: need documentation contribution...
TODO: need documentation contribution...
For mt6989 & subsequent platforms, mtk_ccuv.ko generated by mtkcam/ccusys/ is used. For mt6897 & previous platforms, mtk_ccu.ko generated by drivers/remoteproc/ is used.
TODO: need documentation contribution...
We opt to support different Linux kernel version APIs within the same C2PS kernel module
implementation by using the macro
LINUX_VERSION_CODE
defined in linux/version.h
.
Kleaf, which is a new build flow, only supports kernel version from 6.1. And it has been launched in the mgk_64_k61 at first.
Same as before:
source build/envsetup.sh
export OUT_DIR=out_krn
lunch {project name}-{build variant}
make -j<number of simultaneous jobs> krn_images
{project name} is krn_mgk_64_k61
, {build variant} is userdebug
and
<number of simultaneous jobs> is 16
:
source build/envsetup.sh
export OUT_DIR=out_krn
lunch krn_mgk_64_k61-userdebug
make -j16 krn_images
The fundamental command is
cd kernel
./tools/bazel build <options> <build setting> //{package name}:{target name}
- <options> are
--verbose_failures --sandbox_debug
- <build setting> is
--//build/bazel_mgk_rules:kernel_version=6.1
- {pacakge name} is
vendor/mediatek/kernel_modules/mtkcam/camsys
- {target name} is
camsys.6.1.userdebug
cd kernel
./tools/bazel build --verbose_failures --sandbox_debug --//build/bazel_mgk_rules:kernel_version=6.1 //vendor/mediatek/kernel_modules/mtkcam/camsys:camsys.6.1.userdebug
The mtkcam kernel modules should be put into the /vendor/lib/modules
folder.
mtkcam kernel modules provide Linux kernel user-space API in the
device/mediatek/common/kernel-headers
folder.