# indrasenzz/lunarknight architecture

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

- Interactive diagram: https://gitdiagram.com/indrasenzz/lunarknight
- Repository: https://github.com/indrasenzz/lunarknight

## Overview

Linux is a general-purpose kernel, not a single request-to-result application. The supplied tree and excerpts show a cross-section of kernel runtime subsystems, so this map presents their distinct responsibilities rather than implying one shared workflow. It includes the prominent i915 execution subsystem and the sampled crypto, device-I/O, storage, and kernel-service areas. Many listed modules were not excerpted; relationships are shown only where the SOURCE INDEX or an excerpt supports them.

Main entry points: [`drivers/gpu/drm/i915/intel_engine_cs.c`](https://github.com/indrasenzz/lunarknight/blob/back/drivers/gpu/drm/i915/intel_engine_cs.c) (Engine setup), [`drivers/crypto/qat/qat_common/adf_accel_engine.c`](https://github.com/indrasenzz/lunarknight/blob/back/drivers/crypto/qat/qat_common/adf_accel_engine.c) (QAT accelerator engine), [`drivers/crypto/ccp/ccp-dmaengine.c`](https://github.com/indrasenzz/lunarknight/blob/back/drivers/crypto/ccp/ccp-dmaengine.c) (CCP DMA driver), [`drivers/usb/pd/policy_engine.c`](https://github.com/indrasenzz/lunarknight/blob/back/drivers/usb/pd/policy_engine.c) (USB PD policy)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gpu["GPU driver"]
  node_i915["i915 GPU execution"]
  node_i915_engine["Engine setup<br/>[intel_engine_cs.c]"]
  node_i915_lrc["Logical ring contexts<br/>[intel_lrc.h]"]
  node_i915_ring["Ring submission interface<br/>[intel_ringbuffer.h]"]
end

subgraph group_crypto["Crypto acceleration"]
  node_crypto_engine["Crypto request engine<br/>[crypto_engine.c]"]
  node_ccp_dma["CCP DMA driver<br/>[ccp-dmaengine.c]"]
  node_qat_engine["QAT accelerator engine<br/>[adf_accel_engine.c]"]
  node_qat_device["QAT device definitions"]
end

subgraph group_device["Device I/O"]
  node_dma["DMA engine framework<br/>[dmaengine.c]"]
  node_usb_pd["USB PD policy<br/>[policy_engine.c]"]
  node_mass_storage["USB mass storage<br/>[f_mass_storage.c]"]
  node_iio_dma["IIO DMA buffering"]
  node_spi_engine["SPI controller"]
end

subgraph group_storage["Storage"]
  node_romfs["RomFS storage access<br/>[storage.c]"]
end

subgraph group_services["Kernel services"]
  node_dsp_pipeline["ISDN audio pipeline<br/>[dsp_pipeline.c]"]
  node_bpf_local["BPF local storage"]
  node_bpf_socket["Socket BPF storage<br/>[bpf_sk_storage.c]"]
  node_pcm_dma["PCM DMA support<br/>[pcm_dmaengine.c]"]
end

node_userspace(("Userspace"))
node_hardware{{"Device hardware"}}

node_i915_engine -->|"initializes engines"| node_i915
node_i915_engine -->|"uses interface"| node_i915_ring
node_i915_engine -->|"uses interface"| node_i915_lrc
node_ccp_dma -->|"uses DMA API"| node_dma
node_qat_engine -->|"uses definitions"| node_qat_device
node_qat_engine -.-> node_userspace
node_usb_pd -.-> node_hardware
node_mass_storage -.-> node_hardware
node_romfs -.-> node_hardware

click node_i915 "https://github.com/indrasenzz/lunarknight/tree/back/drivers/gpu/drm/i915"
click node_i915_engine "https://github.com/indrasenzz/lunarknight/blob/back/drivers/gpu/drm/i915/intel_engine_cs.c"
click node_i915_lrc "https://github.com/indrasenzz/lunarknight/blob/back/drivers/gpu/drm/i915/intel_lrc.h"
click node_i915_ring "https://github.com/indrasenzz/lunarknight/blob/back/drivers/gpu/drm/i915/intel_ringbuffer.h"
click node_crypto_engine "https://github.com/indrasenzz/lunarknight/blob/back/crypto/crypto_engine.c"
click node_ccp_dma "https://github.com/indrasenzz/lunarknight/blob/back/drivers/crypto/ccp/ccp-dmaengine.c"
click node_qat_engine "https://github.com/indrasenzz/lunarknight/blob/back/drivers/crypto/qat/qat_common/adf_accel_engine.c"
click node_qat_device "https://github.com/indrasenzz/lunarknight/blob/back/drivers/crypto/qat/qat_common/adf_accel_devices.h"
click node_dma "https://github.com/indrasenzz/lunarknight/blob/back/drivers/dma/dmaengine.c"
click node_usb_pd "https://github.com/indrasenzz/lunarknight/blob/back/drivers/usb/pd/policy_engine.c"
click node_mass_storage "https://github.com/indrasenzz/lunarknight/blob/back/drivers/usb/gadget/function/f_mass_storage.c"
click node_iio_dma "https://github.com/indrasenzz/lunarknight/blob/back/drivers/iio/buffer/industrialio-buffer-dmaengine.c"
click node_spi_engine "https://github.com/indrasenzz/lunarknight/blob/back/drivers/spi/spi-axi-spi-engine.c"
click node_romfs "https://github.com/indrasenzz/lunarknight/blob/back/fs/romfs/storage.c"
click node_dsp_pipeline "https://github.com/indrasenzz/lunarknight/blob/back/drivers/isdn/mISDN/dsp_pipeline.c"
click node_bpf_local "https://github.com/indrasenzz/lunarknight/blob/back/kernel/bpf/bpf_local_storage.c"
click node_bpf_socket "https://github.com/indrasenzz/lunarknight/blob/back/net/core/bpf_sk_storage.c"
click node_pcm_dma "https://github.com/indrasenzz/lunarknight/blob/back/sound/core/pcm_dmaengine.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_i915,node_i915_engine,node_i915_lrc,node_i915_ring,node_userspace toneBlue
class node_crypto_engine,node_ccp_dma,node_qat_engine,node_qat_device toneAmber
class node_dma,node_usb_pd,node_mass_storage,node_iio_dma,node_spi_engine toneMint
class node_romfs toneRose
class node_dsp_pipeline,node_bpf_local,node_bpf_socket,node_pcm_dma,node_hardware toneIndigo
```

## Components

### GPU driver

- [i915 GPU execution](https://github.com/indrasenzz/lunarknight/tree/back/drivers/gpu/drm/i915): `drivers/gpu/drm/i915`
- [Engine setup](https://github.com/indrasenzz/lunarknight/blob/back/drivers/gpu/drm/i915/intel_engine_cs.c): `drivers/gpu/drm/i915/intel_engine_cs.c`
- [Logical ring contexts](https://github.com/indrasenzz/lunarknight/blob/back/drivers/gpu/drm/i915/intel_lrc.h): `drivers/gpu/drm/i915/intel_lrc.h`
- [Ring submission interface](https://github.com/indrasenzz/lunarknight/blob/back/drivers/gpu/drm/i915/intel_ringbuffer.h): `drivers/gpu/drm/i915/intel_ringbuffer.h`

### Crypto acceleration

- [Crypto request engine](https://github.com/indrasenzz/lunarknight/blob/back/crypto/crypto_engine.c): `crypto/crypto_engine.c`
- [CCP DMA driver](https://github.com/indrasenzz/lunarknight/blob/back/drivers/crypto/ccp/ccp-dmaengine.c): `drivers/crypto/ccp/ccp-dmaengine.c`
- [QAT accelerator engine](https://github.com/indrasenzz/lunarknight/blob/back/drivers/crypto/qat/qat_common/adf_accel_engine.c): `drivers/crypto/qat/qat_common/adf_accel_engine.c`
- [QAT device definitions](https://github.com/indrasenzz/lunarknight/blob/back/drivers/crypto/qat/qat_common/adf_accel_devices.h): `drivers/crypto/qat/qat_common/adf_accel_devices.h`

### Device I/O

- [DMA engine framework](https://github.com/indrasenzz/lunarknight/blob/back/drivers/dma/dmaengine.c): `drivers/dma/dmaengine.c`
- [USB PD policy](https://github.com/indrasenzz/lunarknight/blob/back/drivers/usb/pd/policy_engine.c): `drivers/usb/pd/policy_engine.c`
- [USB mass storage](https://github.com/indrasenzz/lunarknight/blob/back/drivers/usb/gadget/function/f_mass_storage.c): `drivers/usb/gadget/function/f_mass_storage.c`
- [IIO DMA buffering](https://github.com/indrasenzz/lunarknight/blob/back/drivers/iio/buffer/industrialio-buffer-dmaengine.c): `drivers/iio/buffer/industrialio-buffer-dmaengine.c`
- [SPI controller](https://github.com/indrasenzz/lunarknight/blob/back/drivers/spi/spi-axi-spi-engine.c): `drivers/spi/spi-axi-spi-engine.c`

### Storage

- [RomFS storage access](https://github.com/indrasenzz/lunarknight/blob/back/fs/romfs/storage.c): `fs/romfs/storage.c`

### Kernel services

- [ISDN audio pipeline](https://github.com/indrasenzz/lunarknight/blob/back/drivers/isdn/mISDN/dsp_pipeline.c): `drivers/isdn/mISDN/dsp_pipeline.c`
- [BPF local storage](https://github.com/indrasenzz/lunarknight/blob/back/kernel/bpf/bpf_local_storage.c): `kernel/bpf/bpf_local_storage.c`
- [Socket BPF storage](https://github.com/indrasenzz/lunarknight/blob/back/net/core/bpf_sk_storage.c): `net/core/bpf_sk_storage.c`
- [PCM DMA support](https://github.com/indrasenzz/lunarknight/blob/back/sound/core/pcm_dmaengine.c): `sound/core/pcm_dmaengine.c`

### Other components

- **Userspace**
- **Device hardware**

## Connections

- Engine setup → i915 GPU execution: initializes engines (evidence: `drivers/gpu/drm/i915/intel_engine_cs.c`)
- Engine setup → Ring submission interface: uses interface (evidence: `drivers/gpu/drm/i915/intel_engine_cs.c`)
- Engine setup → Logical ring contexts: uses interface (evidence: `drivers/gpu/drm/i915/intel_engine_cs.c`)
- CCP DMA driver → DMA engine framework: uses DMA API (evidence: `drivers/crypto/ccp/ccp-dmaengine.c`)
- QAT accelerator engine → QAT device definitions: uses definitions (evidence: `drivers/crypto/qat/qat_common/adf_accel_engine.c`)
- QAT accelerator engine → Userspace
- USB PD policy → Device hardware
- USB mass storage → Device hardware
- RomFS storage access → Device hardware
