> ## 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.

# 运行 DRM modetest

DRM modetest 可确保 DSI 和 DPU 路径正常工作。要验证显示驱动拓扑，请运行 DRM modetest。

<Note>
  您必须启用 SSH 才能连接到目标设备。有关说明，请参阅[使用 SSH 登录](https://dragonwingdocs.qualcomm.com/Key-Documents/Flash-Guide/how-to-sign-in-with-ssh)。
</Note>

1. 要终止 Weston 客户端应用程序，请在设备 shell 中运行以下命令：

   > ```text theme={null}
   > mount -o remount,rw /
   > ```

2. 要终止所有 Weston 进程，请运行以下命令：

   > ```text theme={null}
   > systemctl stop weston.socket weston.service
   > ```

   <Note>
     仅运行 <code>systemctl stop weston.service</code> 命令会生成以下警告：

     <br />

     **Stopping weston.service, but its triggering units are still active: weston.socket**

     <br />

     这一行为是符合预期的，因为 Weston 被配置为套接字激活服务。要完全停止显示子系统，请使用步骤 2 中的命令同时停止套接字和服务。
   </Note>

3. 要更改 modetest 应用程序的权限，请运行以下命令：

   > ```text theme={null}
   > chmod 0777 /usr/bin/modetest
   > ```

4. 要查看连接器 ID 和模式，请运行以下命令：

   > ```text theme={null}
   > /usr/bin/modetest -M msm > /opt/drm_mode.txt
   > ```

5. 要验证 DRM 模式和连接器信息，请将 `/opt/drm_mode.txt` 文件拉取到您的主机上。使用安全复制协议（SCP）将 `drm_mode.txt` 文件从设备拉取到您的主机。例如：

   > ```text theme={null}
   > scp -r root@<IP of the device>:/opt/drm_mode.txt <directory path of the host machine>
   > ```

   <Note>出现密码提示时，请输入 `oelinux123`。</Note>

下图显示了 `/opt/drm_mode.txt` 文件的输出。

<div className="flex flex-col items-center gap-2">
  <img src="https://mintcdn.com/qualcomm-staging/uWQLnBcS9sxlZhgB/Technologies/Display/media/qli-display/Command_prompt_output.png?fit=max&auto=format&n=uWQLnBcS9sxlZhgB&q=85&s=7b7e84447d5d81d4cbf7b1ae133332e9" alt="图：命令提示符输出" width="571" height="90" data-path="Technologies/Display/media/qli-display/Command_prompt_output.png" />
</div>

6. 要设置连接器 ID 和模式名称，请使用以下语法并填入 `/opt/drm_mode.txt` 文件中的相应值：

   > ```text theme={null}
   > modetest -M msm -s <Connector id>:<mode name>
   > ```

   其中 `<Connector id>` 和 `<mode name>` 是从 `/opt/drm_mode.txt` 文件中获取的值。

7. 要启动 modetest 应用程序，请使用从 `/opt/drm_mode.txt` 文件中获取的连接器 ID 和模式名称运行以下示例命令。例如：

   > ```text theme={null}
   > /usr/bin/modetest -M msm -s 32:1920x1080-60
   > ```

   <Note>启动 DRM 测试应用程序，并忽略警告日志：`Failed to set gamma: Function not implemented`。</Note>

   <div className="flex flex-col items-center gap-2">
     <img src="https://mintcdn.com/qualcomm-staging/uWQLnBcS9sxlZhgB/Technologies/Display/media/qli-display/DRM_mode_test_sample_application_output_screen.PNG?fit=max&auto=format&n=uWQLnBcS9sxlZhgB&q=85&s=1c8bd95faa61d422616b819c937e38c5" alt="图：DRM modetest 输出" width="680" height="376" data-path="Technologies/Display/media/qli-display/DRM_mode_test_sample_application_output_screen.PNG" />
   </div>

8. 要终止 modetest 应用程序，请按 **CTRL + C**。

   <Note>请确保[重新启动 Weston](troubleshoot-relaunch-weston)。</Note>
