Hi,
I am using an i.MX8MN board with mainline linux kernel 6.13 and Mesa 22.0.3.
Etnaviv is enabled and kmscube is installed.
When I run kmscube -D /dev/dri/card0, I get repeated MMU faults:
kmscube -D /dev/dri/card0
<5>[ 33.672597] random: crng init done
Using display 0xffffa0979330 with EGL version 1.4
===================================
EGL information:
version: "1.4"
vendor: "Mesa Project"
client extensions: "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_MESA_platform_gbm EGL_KHR_plat
form_gbm EGL_MESA_platform_surfaceless"
display extensions: "EGL_ANDROID_blob_cache EGL_ANDROID_native_fence_sync EGL_EXT_buffer_age EGL_EXT_image_dma_buf_import EGL_EXT_image_dma_buf_import_modifiers EGL_KHR_cl_event2 EGL_KHR_config_attribs EGL_KHR_create_context EGL_KHR_create_contex
t_no_error 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_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 "
===================================
OpenGL ES 2.x information:
version: "OpenGL ES 2.0 Mesa 22.0.3"
shading language version: "OpenGL ES GLSL ES 1.0.16"
vendor: "etnaviv"
renderer: "Vivante GC7000 rev 6203"
extensions: "GL_EXT_blend_minmax GL_EXT_multi_draw_arrays GL_EXT_texture_filter_anisotropic GL_EXT_texture_compression_s3tc GL_EXT_texture_compression_dxt1 GL_EXT_texture_format_BGRA8888 GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth24 GL_OES_e
lement_index_uint GL_OES_fbo_render_mipmap GL_OES_mapbuffer GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_stencil8 GL_OES_texture_3D GL_OES_texture_half_float GL_OES_texture_npot GL_OES_vertex_half_float GL_OES_EGL_image GL_OES_depth_texture
GL_AMD_performance_monitor GL_OES_packed_depth_stencil GL_EXT_texture_type_2_10_10_10_REV GL_OES_get_program_binary GL_APPLE_texture_max_level GL_EXT_discard_framebuffer GL_EXT_read_format_bgra GL_EXT_frag_depth GL_NV_fbo_color_attachments GL_OES_
EGL_image_external GL_OES_EGL_sync GL_OES_vertex_array_object GL_ANGLE_pack_reverse_row_order GL_ANGLE_texture_compression_dxt3 GL_ANGLE_texture_compression_dxt5 GL_EXT_occlusion_query_boolean GL_EXT_texture_rg GL_EXT_unpack_subimage GL_NV_draw_buf
fers GL_NV_read_buffer GL_NV_read_depth GL_NV_read_depth_stencil GL_NV_read_stencil GL_EXT_draw_buffers GL_EXT_map_buffer_range GL_KHR_debug GL_KHR_texture_compression_astc_ldr GL_NV_pixel_buffer_object GL_OES_required_internalformat GL_OES_surface
less_context GL_EXT_separate_shader_objects GL_EXT_compressed_ETC1_RGB8_sub_texture GL_EXT_draw_elements_base_vertex GL_EXT_texture_border_clamp GL_KHR_context_flush_control GL_OES_draw_elements_base_vertex GL_OES_texture_border_clamp GL_KHR_no_err
or GL_KHR_texture_compression_astc_sliced_3d GL_EXT_texture_compression_s3tc_srgb GL_KHR_parallel_shader_compile GL_INTEL_blackhole_render GL_MESA_bgra "
===================================
Rendered 125 frames in 2.015083 sec (62.032200 fps)
Rendered 250 frames in 4.030185 sec (62.031886 fps)
DMESG
<3>[ 33.808034] etnaviv-gpu 38000000.gpu: MMU fault status 0x00000002
<3>[ 33.808072] etnaviv-gpu 38000000.gpu: MMU 0 fault (page not present) addr 0x00000000
<3>[ 33.911138] etnaviv-gpu 38000000.gpu: recover hung GPU!
<3>[ 33.911267] etnaviv-gpu 38000000.gpu: offending task: kmscube (kmscube -D /dev/dri/card0)
<3>[ 34.470517] etnaviv-gpu 38000000.gpu: MMU fault status 0x00000002
<3>[ 34.470556] etnaviv-gpu 38000000.gpu: MMU 0 fault (page not present) addr 0x00000000
<3>[ 34.470637] etnaviv-gpu 38000000.gpu: recover hung GPU!
<3>[ 34.470690] etnaviv-gpu 38000000.gpu: offending task: kmscube (kmscube -D /dev/dri/card0)
<3>[ 34.482908] etnaviv-gpu 38000000.gpu: MMU fault status 0x00000002
<3>[ 34.482926] etnaviv-gpu 38000000.gpu: MMU 0 fault (page not present) addr 0x00000000
<3>[ 34.482977] etnaviv-gpu 38000000.gpu: recover hung GPU!
<3>[ 34.483018] etnaviv-gpu 38000000.gpu: offending task: kmscube (kmscube -D /dev/dri/card0)
<3>[ 34.498776] etnaviv-gpu 38000000.gpu: MMU fault status 0x00000002
<3>[ 34.498795] etnaviv-gpu 38000000.gpu: MMU 0 fault (page not present) addr 0x00000000
<3>[ 34.498838] etnaviv-gpu 38000000.gpu: recover hung GPU!
<3>[ 34.498873] etnaviv-gpu 38000000.gpu: offending task: kmscube (kmscube -D /dev/dri/card0)
<3>[ 34.514863] etnaviv-gpu 38000000.gpu: MMU fault status 0x00000002
<3>[ 34.514879] etnaviv-gpu 38000000.gpu: MMU 0 fault (page not present) addr 0x00000000
<3>[ 34.514924] etnaviv-gpu 38000000.gpu: recover hung GPU!
<3>[ 34.514956] etnaviv-gpu 38000000.gpu: offending task: kmscube (kmscube -D /dev/dri/card0)
<3>[ 34.530980] etnaviv-gpu 38000000.gpu: MMU fault status 0x00000002
<3>[ 34.530997] etnaviv-gpu 38000000.gpu: MMU 0 fault (page not present) addr 0x00000000
<3>[ 34.531042] etnaviv-gpu 38000000.gpu: recover hung GPU!
The display backlight turns on, but nothing is shown.
The display pipeline is working, modetest -s 38:1024x600 displays a test pattern.
ls -l /dev/dri/
crw------- 1 root root 226, 0 Jan 1 00:08 card0
crw------- 1 root root 226, 1 Jan 1 00:08 card1
crw------- 1 root root 226, 128 Jan 1 00:08 renderD128
My RAM is 512MB, mapped at 0x40000000–0x60000000.
I tried reserving memory for GPU as below,
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;
linux,cma {
compatible = "shared-dma-pool";
reusable;
size = <0 0x8000000>;
alloc-ranges = <0 0x40000000 0 0x20000000>;
linux,cma-default;
};
gpu_reserved: gpu@50000000 {
reg = <0 0x50000000 0 0x8000000>;
no-map;
};
};
I have tried both CMA and reserved memory for the GPU, but the error persists.
Is there a known issue with etnaviv on i.MX8MN in mainline, or a required device tree/kernel config for GPU memory? Any advice is appreciated.
Thank you!
First, I would like to clarify that the mainline GPU driver is not within NXP's support scope.
I checked this mainline driver. There is no code to read the memory range in dts. So there should be another way to define or modify it. The NXP driver will define memory range in dtsi and read it in driver.
But in mainline driver, i don't see such code. You can try to debug the code here to confirm the real memory base in mainline driver. Add more printf in drivers/gpu/drm/etnaviv/etnaviv_mmu.c, drivers/gpu/drm/etnaviv/etnaviv_iommu_v2.c and drivers/gpu/drm/etnaviv/etnaviv_iommu.c
cmdbuf_paddr = ALIGN_DOWN(etnaviv_cmdbuf_get_pa(&gpu->buffer), SZ_128M);
if (!(gpu->identity.features & chipFeatures_PIPE_3D) ||
(gpu->identity.minor_features0 & chipMinorFeatures0_MC20) ||
(gpu->identity.minor_features1 & chipMinorFeatures1_MMU_VERSION)) {
if (cmdbuf_paddr >= SZ_2G)
priv->mmu_global->memory_base = SZ_2G;
else
priv->mmu_global->memory_base = cmdbuf_paddr;
} else if (cmdbuf_paddr + SZ_128M >= SZ_2G) {
dev_info(gpu->dev,
"Need to move linear window on MC1.0, disabling TS\n");
gpu->identity.features &= ~chipFeatures_FAST_CLEAR;
priv->mmu_global->memory_base = SZ_2G;
}
Best Regards,
Zhiming
Hi team,
Thankyou for the clarification.
I have verified the memory base verification and it is as per the CMA specified in the device tree.
206: 14 0 GICv3 50 Level 32e10000.dsi
207: 902 0 GICv3 37 Level mxsfb-drm
208: 0 0 GICv3 35 Level 38000000.gpu
i see that the gpu interrupts are not incrementing and still hitting the GPU hang issue.
Hi,
I got this issue resolved by updating Mesa to 23.2.1 version.
Thank you.