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

# 显示

IQ-9075 平台配备 Qualcomm Adreno 显示处理单元（DPU），提供硬件加速的图像处理。IQ9-EVK 通过双 DisplayPort 输出支持两路同时显示。

## 显示能力

| 接口      | 能力                                          |
| ------- | ------------------------------------------- |
| **DP0** | 3840 × 2160 @ 60 fps，30 bpp                 |
| **DP1** | 3840 × 2160 @ 60 fps，30 bpp                 |
| **并发**  | DP0 作为主屏 + DP1 作为副屏，均为 3840 × 2160 @ 60 fps |

**支持的特性：**

* 支持上游协议的 Wayland 和 Weston
* 使用 DRM 后端的 Weston 合成器
* 2× DisplayPort，支持 SST 和 MST

## 架构

### DPU 硬件

<img src="https://mintcdn.com/qualcomm-prod/tRWO8v_Df_ujnDuD/Ubuntu/images/peripheral-interfaces/Display_DPU_architecture.png?fit=max&auto=format&n=tRWO8v_Df_ujnDuD&q=85&s=748d4d7ed8acd5c328284febcd74fa69" width="616" height="210" data-path="Ubuntu/images/peripheral-interfaces/Display_DPU_architecture.png" />

<img src="https://mintcdn.com/qualcomm-prod/tRWO8v_Df_ujnDuD/Ubuntu/images/peripheral-interfaces/DPU_dataflow_diagram.png?fit=max&auto=format&n=tRWO8v_Df_ujnDuD&q=85&s=33a7853f3637dc2d5d81083df7f7569b" width="977" height="368" data-path="Ubuntu/images/peripheral-interfaces/DPU_dataflow_diagram.png" />

<img src="https://mintcdn.com/qualcomm-prod/tRWO8v_Df_ujnDuD/Ubuntu/images/peripheral-interfaces/DPU_HW_architecture_block_diagram.png?fit=max&auto=format&n=tRWO8v_Df_ujnDuD&q=85&s=458de469d7427525799074da83baa209" width="290" height="401" data-path="Ubuntu/images/peripheral-interfaces/DPU_HW_architecture_block_diagram.png" />

<img src="https://mintcdn.com/qualcomm-prod/tRWO8v_Df_ujnDuD/Ubuntu/images/peripheral-interfaces/DPU_HW_processing_pipeline.png?fit=max&auto=format&n=tRWO8v_Df_ujnDuD&q=85&s=dbfd050df2c90d1b74586c18b29f482a" width="1518" height="110" data-path="Ubuntu/images/peripheral-interfaces/DPU_HW_processing_pipeline.png" />

| 组件         | 功能                   |
| ---------- | -------------------- |
| **总线接口**   | 从内存获取数据              |
| **源表面处理**  | 读取 RGB/YUV 表面；执行格式转换 |
| **混合**     | 对源表面进行混合与叠加          |
| **目标表面处理** | 针对面板特性转换和调整数据        |
| **压缩**     | 通过发送压缩的显示缓冲区来降低带宽    |
| **显示接口**   | 为连接的显示外设生成时序         |

### 软件栈

<img src="https://mintcdn.com/qualcomm-prod/tRWO8v_Df_ujnDuD/Ubuntu/images/peripheral-interfaces/DPU_SW_architecture_block_diagram.png?fit=max&auto=format&n=tRWO8v_Df_ujnDuD&q=85&s=fa9b30bf23c9674d90676b61cef9b300" width="859" height="719" data-path="Ubuntu/images/peripheral-interfaces/DPU_SW_architecture_block_diagram.png" />

<img src="https://mintcdn.com/qualcomm-prod/tRWO8v_Df_ujnDuD/Ubuntu/images/peripheral-interfaces/Display_sw_stacklayer.png?fit=max&auto=format&n=tRWO8v_Df_ujnDuD&q=85&s=a0b86a95822461a3b69247c0f112b897" width="281" height="741" data-path="Ubuntu/images/peripheral-interfaces/Display_sw_stacklayer.png" />

| 组件                | 描述                      |
| ----------------- | ----------------------- |
| **Wayland Sink**  | 与 Weston 通信以渲染显示内容的插件   |
| **Weston**        | Wayland 合成器；负责合成与渲染     |
| **DRM 后端**        | 管理 Adreno DPU 硬件资源和合成策略 |
| **libdrm**        | 提供 DRM IOCTL API 的库     |
| **DRM/KMS 框架**    | 面向硬件特性的内核与用户态接口         |
| **Adreno DPU 驱动** | 管理到面板接口的所有像素数据路径        |

## DisplayPort 与 DSI 接口

### eDP 接口

该处理器有四个 eDP 接口。eDP0 和 eDP1 路由至连接器 JEDP0 和 JEDP1。

<img src="https://mintcdn.com/qualcomm-prod/P0rmO3AZfXx7cgqQ/Ubuntu/images/peripheral-interfaces/IQ9075_eDP_interface_configuration.png?fit=max&auto=format&n=P0rmO3AZfXx7cgqQ&q=85&s=6c2880b800251ebf1ffa5c401825cc35" width="932" height="552" data-path="Ubuntu/images/peripheral-interfaces/IQ9075_eDP_interface_configuration.png" />

### DSI 接口

IQ-9075 支持两路 4 通道 MIPI-DSI，并支持 VESA DSC v1.2。DSI0 接口使用模拟开关，可通过 JDISP LCD 连接器和 JEXP1 板对板扩展连接器两种方式访问。

<img src="https://mintcdn.com/qualcomm-prod/P0rmO3AZfXx7cgqQ/Ubuntu/images/peripheral-interfaces/IQ9075_DSI_interface_configuration.png?fit=max&auto=format&n=P0rmO3AZfXx7cgqQ&q=85&s=87652524f0b1e03a24ac4d26cac40a75" width="931" height="551" data-path="Ubuntu/images/peripheral-interfaces/IQ9075_DSI_interface_configuration.png" />

## 设置

### 连接 DisplayPort

<img src="https://mintcdn.com/qualcomm-prod/tRWO8v_Df_ujnDuD/Ubuntu/images/peripheral-interfaces/IQ-9075_displayport_setup.png?fit=max&auto=format&n=tRWO8v_Df_ujnDuD&q=85&s=c08c94f5133efb653bac3600134140ca" width="550" height="619" data-path="Ubuntu/images/peripheral-interfaces/IQ-9075_displayport_setup.png" />

<img src="https://mintcdn.com/qualcomm-prod/tRWO8v_Df_ujnDuD/Ubuntu/images/peripheral-interfaces/Dual_display_port_configuration.png?fit=max&auto=format&n=tRWO8v_Df_ujnDuD&q=85&s=9e4f72ce3b4cda2b06dce3adf8191f48" width="1001" height="305" data-path="Ubuntu/images/peripheral-interfaces/Dual_display_port_configuration.png" />

<img src="https://mintcdn.com/qualcomm-prod/tRWO8v_Df_ujnDuD/Ubuntu/images/peripheral-interfaces/Displayport_setup_workflow.png?fit=max&auto=format&n=tRWO8v_Df_ujnDuD&q=85&s=3e8ee2ac6945835394788a8947f197dc" width="1133" height="228" data-path="Ubuntu/images/peripheral-interfaces/Displayport_setup_workflow.png" />

<img src="https://mintcdn.com/qualcomm-prod/tRWO8v_Df_ujnDuD/Ubuntu/images/peripheral-interfaces/Display_setup_verification_flow.png?fit=max&auto=format&n=tRWO8v_Df_ujnDuD&q=85&s=ca533d3786d2ab12f2c4022d9b8ef01c" width="526" height="815" data-path="Ubuntu/images/peripheral-interfaces/Display_setup_verification_flow.png" />

<Steps>
  <Step title="连接主显示器">
    将 DisplayPort 线缆连接到 **eDP0** 连接器。
  </Step>

  <Step title="连接副显示器（可选）">
    如需双屏显示，将第二根 DisplayPort 线缆连接到 **eDP1**。
  </Step>

  <Step title="上电">
    为设备上电。Weston 会在启动过程中自动运行并显示花朵图案。

    <img src="https://mintcdn.com/qualcomm-prod/P0rmO3AZfXx7cgqQ/Ubuntu/images/peripheral-interfaces/hdmi_monitor_Server.png?fit=max&auto=format&n=P0rmO3AZfXx7cgqQ&q=85&s=f708db6aad4b7a89eccf2befd44abd99" width="700" height="393" data-path="Ubuntu/images/peripheral-interfaces/hdmi_monitor_Server.png" />
  </Step>
</Steps>

### SSH 访问

默认凭据：**用户名：** `ubuntu` / **密码：** `ubuntu`

## 测试与验证

### 运行 Weston EGL 客户端

```bash theme={null}
weston-simple-egl
```

**预期输出：** 显示器上以 60 fps 显示一个旋转的三角形。

```
300 frames in 5 seconds: 60.000000 fps
```

按 `Ctrl+C` 终止。

### GStreamer 视频播放

<img src="https://mintcdn.com/qualcomm-prod/tRWO8v_Df_ujnDuD/Ubuntu/images/peripheral-interfaces/Gstreamer_videoplay_pipeline.png?fit=max&auto=format&n=tRWO8v_Df_ujnDuD&q=85&s=030027dda7353b89b17aa47d5df43782" width="1768" height="70" data-path="Ubuntu/images/peripheral-interfaces/Gstreamer_videoplay_pipeline.png" />

确保视频文件位于设备的 `/etc/media` 目录下。

```bash theme={null}
# H.264 playback
gst-launch-1.0 -v filesrc location=/etc/media/video.mp4 ! qtdemux ! queue ! \
  h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! \
  video/x-raw,format=NV12 ! waylandsink

# H.265/HEVC playback
gst-launch-1.0 -v filesrc location=/etc/media/video_hevc.mp4 ! qtdemux ! queue ! \
  h265parse ! v4l2h265dec capture-io-mode=4 output-io-mode=4 ! \
  video/x-raw,format=NV12 ! waylandsink

# With scaling
gst-launch-1.0 -v filesrc location=/etc/media/video.mp4 ! qtdemux ! queue ! \
  h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! \
  video/x-raw,width=1920,height=1080 ! waylandsink
```

**关键管道组件：**

| 组件                  | 用途                    |
| ------------------- | --------------------- |
| `capture-io-mode=4` | 将解码帧分配为 DMABUF（零拷贝送显） |
| `output-io-mode=4`  | 通过 DMABUF 处理编码码流缓冲区   |
| `format=NV12`       | 用于硬件加速路径的 NV12 像素格式   |
| `waylandsink`       | 将视频渲染到 Wayland 显示     |

## 调试

### 检查 DisplayPort 状态

```bash theme={null}
# Cable status
sudo cat /sys/class/drm/card0-DP-1/status   # eDP0
sudo cat /sys/class/drm/card0-DP-2/status   # eDP1

# Available modes (EDID)
sudo cat /sys/class/drm/card0-DP-1/modes

# Detailed DP info
sudo cat /sys/kernel/debug/dri/0/DP-1/dp_debug
```

### 调试文件系统

<img src="https://mintcdn.com/qualcomm-prod/tRWO8v_Df_ujnDuD/Ubuntu/images/peripheral-interfaces/DPU_debug_filesystem_structure.png?fit=max&auto=format&n=tRWO8v_Df_ujnDuD&q=85&s=4f897ba03ef4f3b5a9be7427a7c2927f" width="1768" height="388" data-path="Ubuntu/images/peripheral-interfaces/DPU_debug_filesystem_structure.png" />

| 命令                                  | 用途         |
| ----------------------------------- | ---------- |
| `dmesg \| grep -i display`          | 与显示相关的内核消息 |
| `dmesg \| grep -i drm`              | DRM 子系统消息  |
| `cat /sys/kernel/debug/dri/0/state` | 当前 DRM 状态  |
| `cat /proc/interrupts \| grep mdss` | 显示中断       |

## 故障排查

<AccordionGroup>
  <Accordion title="无显示输出（黑屏）">
    ```bash theme={null}
    cat /sys/class/drm/card0-DP-1/status
    sudo dmesg | grep -i "dp\|display\|drm"
    ```

    * 确认线缆已连接到 eDP0 或 eDP1
    * 检查显示器电源和输入源选择
  </Accordion>

  <Accordion title="分辨率不正确">
    ```bash theme={null}
    cat /sys/class/drm/card0-DP-1/modes
    ```

    确认显示器支持所需的分辨率。
  </Accordion>

  <Accordion title="Weston 无法启动">
    ```bash theme={null}
    journalctl -u weston
    ls -l /dev/dri/card0
    ls -l /dev/dri/
    ```

    手动启动 Weston 并输出调试日志：

    ```bash theme={null}
    weston --idle-time=0 --continue-without-input --log=/home/ubuntu/weston.log
    ```
  </Accordion>

  <Accordion title="双屏显示不工作">
    ```bash theme={null}
    cat /sys/class/drm/card0-DP-1/status
    cat /sys/class/drm/card0-DP-2/status
    cat /sys/kernel/debug/dri/0/state
    ```

    * 确认两根线缆分别连接到 eDP0 和 eDP1
    * 检查 Weston 的多显示器支持配置
  </Accordion>

  <Accordion title="XWayland / Weston 需要重启">
    ```bash theme={null}
    ps -A | grep weston
    killall weston
    sudo systemctl start weston-autostart
    export XDG_RUNTIME_DIR=/run/user/$(id -u ubuntu)
    export WAYLAND_DISPLAY=wayland-1
    ```
  </Accordion>
</AccordionGroup>

## 资源

| 资源           | URL                                                                                                                        |
| ------------ | -------------------------------------------------------------------------------------------------------------------------- |
| DRM 内部机制     | [https://www.kernel.org/doc/html/v5.4/gpu/drm-internals.html](https://www.kernel.org/doc/html/v5.4/gpu/drm-internals.html) |
| 内核模式设置（KMS）  | [https://www.kernel.org/doc/html/v5.4/gpu/drm-kms.html](https://www.kernel.org/doc/html/v5.4/gpu/drm-kms.html)             |
| Wayland 协议   | [https://wayland.freedesktop.org/](https://wayland.freedesktop.org/)                                                       |
| Weston 合成器   | [https://gitlab.freedesktop.org/wayland/weston](https://gitlab.freedesktop.org/wayland/weston)                             |
| GStreamer 文档 | [https://gstreamer.freedesktop.org/documentation/](https://gstreamer.freedesktop.org/documentation/)                       |
