# antoinesayah/sunxi-mali architecture

> Architecture diagram of the GitHub repository antoinesayah/sunxi-mali, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/antoinesayah/sunxi-mali
- Repository: https://github.com/antoinesayah/sunxi-mali

## Overview

This repository distributes Mali userspace EGL/OpenGL ES drivers and their Khronos API headers. The documented user workflow is to configure/install matching driver binaries for the target system, then use EGL and GLES APIs; the README describes installation and version selection, but the Makefile implementation is excluded and was not inspected. The version utility queries the loaded kernel driver through /dev/mali. Binary internals are unavailable in the sampled source, so links to those artifacts reflect README documentation, not inspected calls.

Main entry points: [`lib/mali`](https://github.com/antoinesayah/sunxi-mali/tree/master/lib/mali) (Mali GLES/EGL binaries), [`include/EGL/egl.h`](https://github.com/antoinesayah/sunxi-mali/blob/master/include/EGL/egl.h) (EGL API), [`include/EGL/eglplatform.h`](https://github.com/antoinesayah/sunxi-mali/blob/master/include/EGL/eglplatform.h) (EGL platform types), [`include/GLES/gl.h`](https://github.com/antoinesayah/sunxi-mali/blob/master/include/GLES/gl.h) (GLES 1 API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_headers["API headers"]
  node_egl_api["EGL API<br/>[egl.h]"]
  node_egl_extensions["EGL extensions<br/>[eglext.h]"]
  node_egl_platform["EGL platform types<br/>[eglplatform.h]"]
  node_gles1_api["GLES 1 API<br/>[gl.h]"]
  node_gles1_extensions["GLES 1 extensions<br/>[glext.h]"]
  node_gles1_platform["GLES 1 platform<br/>[glplatform.h]"]
  node_gles2_api["GLES 2 API<br/>[gl2.h]"]
  node_gles2_extensions["GLES 2 extensions<br/>[gl2ext.h]"]
  node_gles2_platform["GLES 2 platform<br/>[gl2platform.h]"]
  node_khr_types["KHR base types<br/>[khrplatform.h]"]
end

subgraph group_drivers["Driver artifacts"]
  node_mali_drivers["Mali GLES/EGL binaries"]
end

subgraph group_versioning["Version detection"]
  node_version_query["Kernel version query<br/>[version.c]"]
end

node_user(("System administrator"))
node_app(("GLES application"))
node_kernel_driver["Mali kernel driver"]

node_user -->|"installs binaries"| node_mali_drivers
node_user -->|"checks version"| node_version_query
node_version_query -->|"queries ioctl"| node_kernel_driver
node_app -->|"uses declarations"| node_egl_api
node_app -->|"uses declarations"| node_gles1_api
node_app -->|"uses declarations"| node_gles2_api
node_mali_drivers -.->|"implements API"| node_egl_api
node_mali_drivers -.->|"implements API"| node_gles1_api
node_mali_drivers -.->|"implements API"| node_gles2_api
node_egl_api -->|"uses platform types"| node_egl_platform
node_egl_platform -->|"uses base types"| node_khr_types
node_gles1_api -->|"uses platform definitions"| node_gles1_platform
node_gles2_api -->|"uses platform definitions"| node_gles2_platform
node_gles2_platform -->|"uses base types"| node_khr_types
node_egl_extensions -->|"uses platform types"| node_egl_platform
node_user -.->|"uses extensions"| node_egl_extensions
node_app -.->|"uses extensions"| node_gles1_extensions
node_app -.->|"uses extensions"| node_gles2_extensions

click node_egl_api "https://github.com/antoinesayah/sunxi-mali/blob/master/include/EGL/egl.h"
click node_egl_extensions "https://github.com/antoinesayah/sunxi-mali/blob/master/include/EGL/eglext.h"
click node_egl_platform "https://github.com/antoinesayah/sunxi-mali/blob/master/include/EGL/eglplatform.h"
click node_gles1_api "https://github.com/antoinesayah/sunxi-mali/blob/master/include/GLES/gl.h"
click node_gles1_extensions "https://github.com/antoinesayah/sunxi-mali/blob/master/include/GLES/glext.h"
click node_gles1_platform "https://github.com/antoinesayah/sunxi-mali/blob/master/include/GLES/glplatform.h"
click node_gles2_api "https://github.com/antoinesayah/sunxi-mali/blob/master/include/GLES2/gl2.h"
click node_gles2_extensions "https://github.com/antoinesayah/sunxi-mali/blob/master/include/GLES2/gl2ext.h"
click node_gles2_platform "https://github.com/antoinesayah/sunxi-mali/blob/master/include/GLES2/gl2platform.h"
click node_khr_types "https://github.com/antoinesayah/sunxi-mali/blob/master/include/KHR/khrplatform.h"
click node_mali_drivers "https://github.com/antoinesayah/sunxi-mali/tree/master/lib/mali"
click node_version_query "https://github.com/antoinesayah/sunxi-mali/blob/master/version/version.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_egl_api,node_egl_extensions,node_egl_platform,node_gles1_api,node_gles1_extensions,node_gles1_platform,node_gles2_api,node_gles2_extensions,node_gles2_platform,node_khr_types toneBlue
class node_mali_drivers toneAmber
class node_version_query toneMint
class node_user,node_app,node_kernel_driver toneIndigo
```

## Components

### API headers

- [EGL API](https://github.com/antoinesayah/sunxi-mali/blob/master/include/EGL/egl.h): `include/EGL/egl.h`
- [EGL extensions](https://github.com/antoinesayah/sunxi-mali/blob/master/include/EGL/eglext.h): `include/EGL/eglext.h`
- [EGL platform types](https://github.com/antoinesayah/sunxi-mali/blob/master/include/EGL/eglplatform.h): `include/EGL/eglplatform.h`
- [GLES 1 API](https://github.com/antoinesayah/sunxi-mali/blob/master/include/GLES/gl.h): `include/GLES/gl.h`
- [GLES 1 extensions](https://github.com/antoinesayah/sunxi-mali/blob/master/include/GLES/glext.h): `include/GLES/glext.h`
- [GLES 1 platform](https://github.com/antoinesayah/sunxi-mali/blob/master/include/GLES/glplatform.h): `include/GLES/glplatform.h`
- [GLES 2 API](https://github.com/antoinesayah/sunxi-mali/blob/master/include/GLES2/gl2.h): `include/GLES2/gl2.h`
- [GLES 2 extensions](https://github.com/antoinesayah/sunxi-mali/blob/master/include/GLES2/gl2ext.h): `include/GLES2/gl2ext.h`
- [GLES 2 platform](https://github.com/antoinesayah/sunxi-mali/blob/master/include/GLES2/gl2platform.h): `include/GLES2/gl2platform.h`
- [KHR base types](https://github.com/antoinesayah/sunxi-mali/blob/master/include/KHR/khrplatform.h): `include/KHR/khrplatform.h`

### Driver artifacts

- [Mali GLES/EGL binaries](https://github.com/antoinesayah/sunxi-mali/tree/master/lib/mali): `lib/mali`

### Version detection

- [Kernel version query](https://github.com/antoinesayah/sunxi-mali/blob/master/version/version.c): `version/version.c`

### Other components

- **System administrator**
- **GLES application**
- **Mali kernel driver**

## Connections

- System administrator → Mali GLES/EGL binaries: installs binaries (evidence: `README`)
- System administrator → Kernel version query: checks version (evidence: `README`)
- Kernel version query → Mali kernel driver: queries ioctl (evidence: `version/version.c`)
- GLES application → EGL API: uses declarations (evidence: `include/EGL/egl.h`)
- GLES application → GLES 1 API: uses declarations (evidence: `include/GLES/gl.h`)
- GLES application → GLES 2 API: uses declarations (evidence: `include/GLES2/gl2.h`)
- Mali GLES/EGL binaries → EGL API: implements API (evidence: `README`)
- Mali GLES/EGL binaries → GLES 1 API: implements API (evidence: `README`)
- Mali GLES/EGL binaries → GLES 2 API: implements API (evidence: `README`)
- EGL API → EGL platform types: uses platform types (evidence: `include/EGL/eglplatform.h`)
- EGL platform types → KHR base types: uses base types (evidence: `include/EGL/eglplatform.h`)
- GLES 1 API → GLES 1 platform: uses platform definitions (evidence: `include/GLES/gl.h`)
- GLES 2 API → GLES 2 platform: uses platform definitions (evidence: `include/GLES2/gl2.h`)
- GLES 2 platform → KHR base types: uses base types (evidence: `include/GLES2/gl2platform.h`)
- EGL extensions → EGL platform types: uses platform types (evidence: `include/EGL/eglext.h`)
- System administrator → EGL extensions: uses extensions
- GLES application → GLES 1 extensions: uses extensions
- GLES application → GLES 2 extensions: uses extensions
