Skip to content

Files

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Jun 2, 2024
Jun 2, 2024
Jun 2, 2024
Jun 2, 2024
Jun 2, 2024
Jun 2, 2024
Jun 2, 2024
Jun 2, 2024
Jun 2, 2024
Jun 2, 2024
Jun 2, 2024
Jun 2, 2024
Jun 2, 2024
Jun 2, 2024
Jun 2, 2024
Jun 2, 2024
Jun 2, 2024

mtkcam - MediaTek Camera kernel module repository

WHAT IT DOES?

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/

include

The include subdirectory places the public kernel header files that are used by kernel modules in the mtkcam directory.

camsys

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.

imgsensor

TODO: need documentation contribution...

mtk-aie

TODO: need documentation contribution...

mtk-dpe

TODO: need documentation contribution...

mtk-hcp

TODO: need documentation contribution...

mtk-ipesys-me

TODO: need documentation contribution...

ccusys

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.

scpsys

TODO: need documentation contribution...

sched

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.

HOW IT WAS BUILT?

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.

MGK (Mediatek Generic Kernel) build command

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

Example - MGK build

{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

Standalone build command

The fundamental command is

 cd kernel
 ./tools/bazel build <options> <build setting> //{package name}:{target name}

Example - camsys standalone build

  • <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.

HOW TO USE IT?

mtkcam kernel modules provide Linux kernel user-space API in the device/mediatek/common/kernel-headers folder.