工具/软件:
您好 TI
我们要使用 AM6254 GPU、并在 TI 的 SDK 目录中找到 GPU 驱动程序源代码:install_path/ti-processor-sdk-linux-am62xx-evm-09.02.01.10/board-support/extra-drivers/ti-img-rogue-driver-23.3.6512818。 我编译了驱动程序源代码并获得了 pvrsrvkm.ko。 pvrsrvkm.ko 模块也已成功加载。 相关的打印日志如下所示:
[ 2.837653] pvrsrvkm: loading out-of-tree module taints kernel. [ 2.850545] PVR_K: 325: Device: fd00000.gpu [ 2.850744] PVR_K: 325: Read BVNC 33.15.11.3 from HW device registers [ 2.850839] PVR_K: 325: RGX Device registered with BVNC 33.15.11.3 [ 2.852054] [drm] Initialized pvr 23.3.6512818 20170530 for fd00000.gpu on minor 1
lsmod 命令的输出如下:
root@am62xx-evm:~# lsmod
Tainted: G
pvrsrvkm 1163264 0 - Live 0xffff800000a40000 (O)
root@am62xx-evm:~#
rgx_triangle_test 命令的输出如下所示:
root@am62xx-evm:~# rgx_triangle_test Connecting to first (0) default pvr device Selected display mode: 1024x600@59 ----------------------- Start ----------------------- Using display type: DRM/KMS Window created with 2 buffers Frame number 0 Frame number 100 Frame number 200 Frame number 300 Frame number 400 Frame number 500 Frame number 600 Frame number 700 Frame number 800 Frame number 900 Total time: 16882ms Mean time per frame: 16899us FPS: 59.2 root@am62xx-evm:~#
rgx_triangle_test 命令的演示效果如下所示:
e2e.ti.com/.../mmexport1757558722033.mp4
我们的项目没有使用 Wayland/Houston 框架或 X11 框架。 eglinfo 指令的输出如下:
root@am62xx-evm:~# eglinfo
EGL client extensions string:
EGL_EXT_client_extensions EGL_EXT_device_base
EGL_EXT_device_enumeration EGL_EXT_device_query EGL_EXT_platform_base
EGL_KHR_client_get_all_proc_addresses EGL_KHR_debug
EGL_EXT_platform_device EGL_EXT_platform_wayland
EGL_KHR_platform_wayland EGL_MESA_platform_gbm EGL_KHR_platform_gbm
EGL_MESA_platform_surfaceless
GBM platform:
EGL API version: 1.5
EGL vendor string: Mesa Project
EGL version string: 1.5
EGL client APIs: OpenGL_ES
EGL extensions string:
EGL_ANDROID_native_fence_sync EGL_EXT_buffer_age
EGL_EXT_create_context_robustness EGL_EXT_image_dma_buf_import
EGL_EXT_image_dma_buf_import_modifiers EGL_EXT_image_gl_colorspace
EGL_EXT_yuv_surface EGL_IMG_context_priority EGL_KHR_cl_event2
EGL_KHR_config_attribs EGL_KHR_create_context EGL_KHR_fence_sync
EGL_KHR_get_all_proc_addresses EGL_KHR_gl_colorspace
EGL_KHR_gl_renderbuffer_image EGL_KHR_gl_texture_2D_image
EGL_KHR_gl_texture_3D_image EGL_KHR_gl_texture_cubemap_image
EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap
EGL_KHR_no_config_context EGL_KHR_partial_update
EGL_KHR_reusable_sync EGL_KHR_surfaceless_context
EGL_EXT_pixel_format_float EGL_KHR_wait_sync
EGL_MESA_configless_context EGL_MESA_drm_image
EGL_MESA_image_dma_buf_export EGL_MESA_query_driver
EGL_WL_bind_wayland_display EGL_IMG_cl_image
Configurations:
bf lv colorbuffer dp st ms vis cav bi renderable supported
id sz l r g b a th cl ns b id eat nd gl es es2 vg surfaces
---------------------------------------------------------------------
0x01 32 0 8 8 8 8 0 0 0 0 0x34325241-- a y win,pb
0x02 32 0 8 8 8 8 0 0 2 1 0x34325241-- a y win,pb
0x03 32 0 8 8 8 8 0 0 4 1 0x34325241-- a y win,pb
0x04 32 0 8 8 8 8 24 8 0 0 0x34325241-- a y win,pb
0x05 32 0 8 8 8 8 24 8 2 1 0x34325241-- a y win,pb
0x06 32 0 8 8 8 8 24 8 4 1 0x34325241-- a y win,pb
0x07 24 0 8 8 8 0 0 0 0 0 0x34325258-- y y win,pb
0x08 24 0 8 8 8 0 0 0 2 1 0x34325258-- y y win,pb
0x09 24 0 8 8 8 0 0 0 4 1 0x34325258-- y y win,pb
0x0a 24 0 8 8 8 0 24 8 0 0 0x34325258-- y y win,pb
0x0b 24 0 8 8 8 0 24 8 2 1 0x34325258-- y y win,pb
0x0c 24 0 8 8 8 0 24 8 4 1 0x34325258-- y y win,pb
0x0d 16 0 5 6 5 0 0 0 0 0 0x36314752-- y y win,pb
0x0e 16 0 5 6 5 0 0 0 2 1 0x36314752-- y y win,pb
0x0f 16 0 5 6 5 0 0 0 4 1 0x36314752-- y y win,pb
0x10 16 0 5 6 5 0 24 8 0 0 0x36314752-- y y win,pb
0x11 16 0 5 6 5 0 24 8 2 1 0x36314752-- y y win,pb
0x12 16 0 5 6 5 0 24 8 4 1 0x36314752-- y y win,pb
Wayland platform:
error: XDG_RUNTIME_DIR not set in the environment.
error: XDG_RUNTIME_DIR not set in the environment.
eglinfo: eglInitialize failed
Device platform:
eglinfo: eglInitialize failed
root@am62xx-evm:~#
但是当我们使用 kmscube 命令时、发生以下错误、错误消息是找不到 EGL 配置、但我们已经移植了依赖库、如 EGL 和 OpenGL。 在执行 kmscube 命令之前和之后、cat/sys/kernel/debug/pvr/status 中显示的内容也不同。
root@am62xx-evm:~# cat /sys/kernel/debug/pvr/status
Driver Status: OK
Device ID: 0:128
Firmware Status: OK
Server Errors: 0
WGP Error Count: 0
TRP Error Count: 0
APM Event Count: 0
root@am62xx-evm:~# kmscube -D /dev/dri/card0
[ 41.577338] PVR_K: 357: RGX Firmware image 'rgx.fw.33.15.11.3' loaded
[ 41.583422] PVR_K: 357: Shader binary image 'rgx.sh.33.15.11.3' loaded
Using display 0x102fbc80 with EGL version 1.5
===================================
EGL information:
version: "1.5"
vendor: "Mesa Project"
client extensions: "EGL_EXT_client_extensions EGL_EXT_device_base EGL_EXT_device_enumeration EGL_EXT_device_query EGL_EXT_pl atform_base EGL_KHR_client_get_all_proc_addresses EGL_KHR_debug EGL_EXT_platform_device EGL_EXT_platform_wayland EGL_KHR_platf orm_wayland EGL_MESA_platform_gbm EGL_KHR_platform_gbm EGL_MESA_platform_surfaceless"
display extensions: "EGL_ANDROID_native_fence_sync EGL_EXT_buffer_age EGL_EXT_create_context_robustness EGL_EXT_image_dma_bu f_import EGL_EXT_image_dma_buf_import_modifiers EGL_EXT_image_gl_colorspace EGL_EXT_yuv_surface EGL_IMG_context_priority EGL_K HR_cl_event2 EGL_KHR_config_attribs EGL_KHR_create_context EGL_KHR_fence_sync EGL_KHR_get_all_proc_addresses EGL_KHR_gl_colors pace EGL_KHR_gl_renderbuffer_image EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_3D_image EGL_KHR_gl_texture_cubemap_image EG L_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_no_config_context EGL_KHR_partial_update EGL_KHR_reusable_sync EGL _KHR_surfaceless_context EGL_EXT_pixel_format_float EGL_KHR_wait_sync EGL_MESA_configless_context EGL_MESA_drm_image EGL_MESA_ image_dma_buf_export EGL_MESA_query_driver EGL_WL_bind_wayland_display EGL_IMG_cl_image "
===================================
No EGL configs with appropriate attributes.
failed to choose config
failed to initialize EGL
root@am62xx-evm:~# cat /sys/kernel/debug/pvr/status
Driver Status: OK
Device ID: 0:128
Firmware Status: OK
Server Errors: 0
HWR Event Count: 0
CRR Event Count: 0
SLR Event Count: 0
WGP Error Count: 0
TRP Error Count: 0
FWF Event Count: 0
APM Event Count: 1
GPU Utilisation: 0%
VM0
2D Utilisation: 0%
GEOM Utilisation: 0%
3D Utilisation: 0%
CDM Utilisation: 0%
root@am62xx-evm:~#
配置 Qt 环境变量后、我们的应用程序还将报告一个错误、指出“无法找到 EGL 配置“:
After I configure the Qt environment variables, our application will also report an error saying 'cannot find egl configs':
我想问 TI、错误无法找到 EGL 配置的原因是什么、它是否与我不使用显示框架 (Wayland/West) 有关? cat/sys/kernel/debug/pvr/status 查看的内容中是否与 GPU 驱动程序加载失败有关? 请让 TI 专家帮我了解一下、谢谢!
