Environment Setup

Pull qcom-kernel

1
2
repo init -u https://git.codelinaro.org/clo/la/kernelplatform/manifest -m KERNEL.PLATFORM.5.0.r28-00700-kernel.0.xml
repo sync

create soft link vendor/qcom

1
ln -s vendor/qcom ../qcom

Pull graphics-kernel

simply clone it from codelinaro

1
2
git clone https://git.codelinaro.org/clo/la/platform/vendor/qcom/opensource/graphics-kernel.git
git checkout gfx-kernel.lnx.16.0.r10-rel

Additional dependencies

mm-drivers

1
2
3
4
cd kernel_platform/vendor/qcom/opensource/
git clone https://git.codelinaro.org/clo/la/platform/vendor/opensource/mm-drivers.git
cd mm-drivers
git checkout LA_AU.VENDOR.16.0.2.r6-01100-gen5_gvm.0

sync-kernel

1
2
3
4
cd kernel_platform/vendor/qcom/opensource/
git clone https://git.codelinaro.org/clo/la/platform/vendor/opensource/synx-kernel.git
cd synx-kernel
git checkout LA_AU.VENDOR.16.0.2.r6-01100-gen5_gvm.0

patch

patch kernel_platform/vendor/qcom/opensource/synx-kernel/sun.bzl

1
2
3
4
5
6
7
8
9
10
11
12
13
def define_sun():
define_consolidate_perf_modules(
target = "sun",
registry = synx_modules,
modules = [
"synx-driver",
],
config_options = [
"TARGET_SYNX_ENABLE",
"CONFIG_QTI_HW_FENCE",
# "CONFIG_SYNX_IMPL",
],
)

build

If you want to check if your environment is correct. Run this build command:

1
2
cd kernel_platform
python3 build_with_bazel.py -t sun perf

If you want to build msm_kgsl.ko directly. Run this build Command:

1
2
cd kernel_platform
bazel build //graphics-kernel:sun_perf_msm_kgsl