Skip to content

ISP source compilation: umbrella tracker for all platforms #58

@widgetii

Description

@widgetii

Overview

Tracking ISP subsystem openness across all HiSilicon platforms. The ISP pipeline spans kernel modules (open_isp.ko, open_sensor_i2c.ko, open_mipi_rx.ko) and userspace libraries (libisp.so, libsns_*.so). The goal is to compile as much as possible from source instead of shipping vendor binary blobs.

The key architectural split is between V1–V3A (ISP algorithms in the kernel module) and V4 (algorithms in userspace libisp.so). Source code exists for most platforms but is not always wired into the build.

Platform Comparison

Platform Gen ISP kernel .ko ISP userspace libisp.so Sensors libsns_*.so MIPI RX VI sensor_i2c
hi3516ev200 V4 Source (HAL+shared mkp) Source (41 .c) 30 sensors, source Source Blob Source
gk7205v200 V4 symlink→ev200 symlink→ev200 symlink→ev200 shared Blob shared
hi3516cv500 V3.5 Source (7 .c) Source (41 .c) 20 sensors, source Source Blob Source
hi3516cv200 V2 Source (6 .c) Not built (34 .c exist) 10 sensors, source Source Blob Source
hi3516av100 V2A Blob (33 .c exist) Not built (25 .c exist) 14 sensors, source Source Blob Source
hi3516cv300 V3 Blob (43 .c exist) Not built (38 .c exist) 9 sensors, source Source Blob Source
hi3519v101 V3A Blob (40 .c exist) Not built (35 .c exist) 9 sensors, source Source Blob Source
hi3516cv100 V1 Blob (no source) None (no source) 16 sensors, source None Blob Blob

Where 3A Algorithms Live

The ISP algorithms (AE, AWB, AF, demosaic, sharpening, DRC, noise reduction, etc.) are the core image quality code. They live in different places depending on chip generation:

Generation Platforms Algorithms location Count
V4 ev200, gk7205v200 Userspace libraries/isp/arch/hi3516ev200/algorithms/ 37 .c files
V3.5 cv500 Userspace libraries/isp/arch/hi3516cv500/algorithms/ 37 .c files
V1–V3A cv100, cv200, av100, cv300, v101 Kernel kernel/isp/arch/<platform>/firmware/src/algorithms/ 16–30 .c files

For V1–V3A, the algorithms are compiled into open_isp.ko itself. For V4/V3.5, the kernel module is a thin HAL and the algorithms run in userspace via libisp.so.

Source Available But Not Built

Three platforms have full ISP firmware source checked into the repo but still build from .o blobs:

Platform Blob in build Source available Kernel .c files Userspace .c files
hi3516av100 obj/hi3516av100/hi3516a_isp.o isp/arch/hi3516av100/firmware/ 33 25
hi3516cv300 obj/hi3516cv300/hi_isp.o isp/arch/hi3516cv300/firmware/ 43 38
hi3519v101 obj/hi3519v101/hi3519v101_isp.o isp/arch/hi3519v101/firmware/ 40 35

The kbuild files for CV300 and V101 have comments acknowledging this:

  • hi3516cv300.kbuild:120: # --- ISP module (blob — full ISP source available but uses blob for now) ---
  • hi3519v101.kbuild:134: # --- ISP module (blob) ---

Similarly, libraries/isp/arch/ has userspace ISP algorithm source for these platforms, but libraries/Makefile filters them out — only CV500 and EV200 currently build libisp.so.

hi3516cv200 is the exception: its kernel ISP already builds from source (6 .c files from firmware/drv/ + firmware/vreg/), but it still lacks a userspace libisp.so build.

Current Build Wiring

Kernel ISP (kernel/Kbuild dispatch)

  • V4 (ev200/gk7205v200): Falls through to generic else branch → kernel/isp/Kbuild builds from shared isp/mkp/src/ + isp/arch/hi3516ev200/hal/isp_drv.c
  • V3.5 (cv500): hi3516cv500.kbuild → source from isp/arch/hi3516cv500/{hal,mkp/src,init}/ (7 .c files, own copies of mkp)
  • V2 (cv200): hi3516cv200.kbuild → source from isp/arch/hi3516cv200/firmware/{drv,vreg}/ (6 .c files)
  • V2A, V3, V3A (av100, cv300, v101): Platform .kbuild → blob from obj/<platform>/ + init wrapper
  • V1 (cv100): Platform .kbuild → blob, no source exists

Userspace ISP (libraries/Makefile dispatch)

  • ev200/gk7205v200: No CHIPARCH filter → all subdirs built including ./isp/
  • cv500: Explicit filter includes ./isp/
  • All others: Filtered to ./sensor/<platform>/ only — no libisp.so built

Sensor Callback Path (runtime AE/AGC updates)

Two I2C write paths exist for all platforms:

  1. Init path (userspace direct): IMX335_init()write(/dev/i2c-N) — programs full register table at startup
  2. Runtime path (kernel callback): ISP AE computes new exposure/gain → fills ISP_SNS_REGS_INFO_S → kernel ISP writes on VSync via pfnISPWriteI2CDatasensor_i2c.koi2c_master_send()verified working on hi3516ev300 test camera

Remaining Binary Dependencies

Per-platform blob modules (not ISP-specific)

open_vi.ko (Video Input) is blob on every platform — no source exists anywhere in the repo. This is the single biggest remaining binary dependency across all platforms.

Other blob modules (base, sys, venc, vpss, etc.) are tracked in #51.

Recommended Priority for ISP Source Migration

  1. hi3516cv200 — Kernel ISP already source. Wire up libisp.so build (34 .c files exist in libraries/isp/arch/hi3516cv200/). Lowest risk since kernel side is proven.
  2. hi3516av100 — Switch kbuild from blob to source (33 .c files). Same firmware/ tree layout as cv200 which already works. Also wire up userspace libisp (25 .c).
  3. hi3516cv300 — Switch kbuild from blob to source (43 .c files, most complete). Also wire up userspace libisp (38 .c).
  4. hi3519v101 — Switch kbuild from blob to source (40 .c files). Also wire up userspace libisp (35 .c).
  5. hi3516cv100 — No ISP source exists. Would need reverse engineering or SDK extraction. Not worth pursuing.

Per-Platform Sub-Issues

Platform Issue Status
hi3516ev200 / gk7205v200 No issue needed Fully source — kernel ISP + libisp + sensors
hi3516cv500 No issue needed Fully source — kernel ISP + libisp + sensors
hi3516cv200 TBD Kernel ISP from source; userspace libisp source exists but not wired
hi3516av100 TBD Both kernel + userspace ISP source exist, neither wired
hi3516cv300 TBD Both kernel + userspace ISP source exist, neither wired
hi3519v101 TBD Both kernel + userspace ISP source exist, neither wired
hi3516cv100 N/A No ISP source available

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions