> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs-staging.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 图形概述

Qualcomm<sup>®</sup> Adreno<sup>™</sup> GPU 驱动图形子系统，并提供以下功能：

* 作为具有 64 位寻址的三维 (3D) 图形加速器。
* 集成图形内存 (GMEM) 作为图形子系统的专用内存，支持快速 Z、颜色和模板渲染。
* 支持 Qualcomm<sup>®</sup> Universal Bandwidth Compression，从而提升整体性能。

Adreno GPU 支持以下图形和计算 API：

* **OpenGL ES**: [3.0](https://registry.khronos.org/OpenGL/specs/es/3.0/es_spec_3.0.pdf), [3.1](https://registry.khronos.org/OpenGL/specs/es/3.1/es_spec_3.1.pdf), [3.2](https://registry.khronos.org/OpenGL/specs/es/3.2/es_spec_3.2.pdf)
* **OpenCL**: [1.2 FP](https://registry.khronos.org/OpenCL/specs/opencl-1.2.pdf), [2.0 FP](https://registry.khronos.org/SPIR-V/specs/1.0/OpenCL.std.20.pdf), [3.0 FP](https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html)
* **EGL**: [1.5](https://registry.khronos.org/EGL/specs/eglspec.1.5.pdf)
* **Vulkan**: [1.1](https://registry.khronos.org/vulkan/#vulkan1.1)

**注意**

请参阅 Qualcomm<sup>®</sup> Linux<sup>®</sup> 支持的 [硬件 SoC](https://dragonwingdocs.qualcomm.com/hardware-design-overview)。

## **图形子系统架构**

图形架构由 Qualcomm 和开源组件组成，如下图所示。

<div className="flex flex-col items-center gap-2">
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/qualcomm-staging/zh/Technologies/Graphics/media/qli-graphics/Graphics-driver.svg" alt="Figure: Graphics subsystem architecture" />

  <p className="text-sm text-gray-700">
    图：图形子系统架构
  </p>
</div>

在上图中，Adreno GPU 驱动使用以下过程和开源组件来渲染图形：

1. Wayland 客户端应用通过 EGL/OpenGL ES 启动渲染。
2. Wayland 协议设置渲染的注册表和回调。
3. 图形缓冲区管理获取 Wayland 后缓冲区以进行渲染。
4. Adreno GPU 驱动使用带有 OpenGL 的 swapbuffer、glflush 或 glfinish 将渲染命令提交给 Kernel Graphics Support Layer (KGSL)。
5. Weston 合成器将渲染的表面发送给 Adreno GPU 驱动进行合成。
6. 获取 GBM 表面以合成渲染的帧。
7. Adreno GPU 驱动提交渲染的帧。
8. Weston 合成器通过 DRM 将最终合成的缓冲区发送到显示器。
9. DRM 将后端的缓冲区提交给显示内核驱动以在屏幕上显示。

**Adreno GPU 驱动**

Qualcomm Adreno GPU 驱动是一组用户模式预编译库。Adreno GPU 驱动不能修改，必须原样使用。

**Adreno GPU 固件**

下表列出了 Adreno GPU 硬件的固件文件。

> |                   |                                                |                        |                                                 | **表：GPU 固件文件**                                  |                                                  |                                                  |                                                       |                                              |
> | ----------------- | ---------------------------------------------- | ---------------------- | ----------------------------------------------- | ----------------------------------------------- | ------------------------------------------------ | ------------------------------------------------ | ----------------------------------------------------- | -------------------------------------------- |
> | **描述**            | **Qualcomm Dragonwing <sup>™</sup> IQ-615 固件** | **QCS5430/QCS6490 固件** | **Qualcomm Dragonwing <sup>™</sup> IQ-8275 固件** | **Qualcomm Dragonwing <sup>™</sup> IQ-9075 固件** | **Qualcomm Dragonwing <sup>™</sup> IQ-X7181 固件** | **Qualcomm Dragonwing <sup>™</sup> IQ-X5121 固件** | **Qualcomm Dragonwing <sup>™</sup> CQ2390/IQ2390 固件** | **Qualcomm Dragonwing <sup>™</sup> IQ10 固件** |
> | 命令处理器的微代码         | a630\_sqe.fw                                   | a660\_sqe.fw           | a650\_sqe.fw                                    | a660\_sqe.fw                                    | gen70500\_sqe.fw                                 | gen71500\_sqe.fw                                 | a702\_sqe.fw                                          | gen71300\_sqe.fw                             |
> | 安全内容支持的微代码        | a612\_zap                                      | a660\_zap              | a623\_zap                                       | a663\_zap                                       | gen70500\_zap.mbn                                | gen71500\_zap.mbn                                | a704\_zap.mbn                                         | gen71300\_zap.mbn                            |
> | 图形管理单元 (GMU) 的微代码 | a612\_rgmu.bin                                 | a660\_gmu.bin          | a623\_gmu.bin                                   | a663\_gmu.bin                                   | gen70500\_gmu.bin                                | gen71500\_gmu.bin                                | NA                                                    | gen71300\_gmu.bin                            |

**Kernel Graphics Support Layer (KGSL)**

KGSL 用作 Adreno GPU 的内核模式驱动。KGSL 驱动的主要功能是将 Adreno 用户模式驱动生成的命令提交给 Adreno GPU 进行处理。此外，KGSL 驱动与 GMU 通信以确保正确的状态管理。

下表列出了支持的 GPU 库和 KGSL 驱动信息。

**注意**

GPU 库表仅适用于 overlay 或 `qcom‑multimedia‑proprietary‑image`。

**表：GPU 库**

|            **库**            |             **描述**            |
| :-------------------------: | :---------------------------: |
|          libCB.so.1         |           GPU 计算的驱动           |
|     libEGL\_adreno.so.1     |           EGL 1.x 驱动          |
| libeglSubDriverWayland.so.1 |      Wayland 子系统的 EGL 驱动      |
|   libeglSubDriverX11.so.1   |        X11 子系统的 EGL 驱动        |
|    libadreno\_utils.so.1    |       Adreno GPU 驱动的实用库       |
|         libgsl.so.1         |             GSL 库             |
|   libq3dtools\_adreno.so.1  |         Adreno 分析器支持层         |
|  libGLESv1\_CM\_adreno.so.1 |        OpenGL ES 1.x 驱动       |
|    libGLESv2\_adreno.so.2   |      OpenGL ES 2.x/3.x 驱动     |
|    libq3dtools\_esx.so.1    |        OpenGL ES 分析器支持层       |
|        libOpenCL.so.1       |            OpenCL 库           |
|    libOpenCL\_adreno.so.1   |     Adreno GPU 的 OpenCL 库     |
|      libllvm-qcom.so.1      |          OpenCL 编译器库          |
|    libvulkan\_adreno.so.1   |         Vulkan 1.x 驱动         |
|     libllvm-glnext.so.1     | OpenGL ES 和 Vulkan 程序二进制文件加载器 |
|       libllvm-qgl.so.1      |   OpenGL ES 和 Vulkan 核心编译器库   |

**表：KGSL 驱动**

| **Linux 内核** | 6.6                                                                                                    |
| :----------- | :----------------------------------------------------------------------------------------------------- |
| **源代码路径**    | [https://github.com/qualcomm-linux/kgsl/](https://github.com/qualcomm-linux/kgsl/) 注意 KGSL 与上游设备树一起工作。 |

## **后续步骤**

* [编译和运行基于 OpenGL ES 的应用](https://dragonwingdocs.qualcomm.com/Technologies/Graphics/run-sample-applications#compile-and-run-opengl-es-based-applications)
* [编译和运行基于 OpenCL 的应用](https://dragonwingdocs.qualcomm.com/Technologies/Graphics/run-sample-applications#compile-and-run-opencl-based-applications)
* [编译和运行基于 Vulkan 的应用](https://dragonwingdocs.qualcomm.com/Technologies/Graphics/run-sample-applications#compile-and-run-vulkan-based-applications)
* [编译和运行基于 X11 的应用](https://dragonwingdocs.qualcomm.com/Technologies/Graphics/run-sample-applications#compile-and-run-x11-based-applications)
