3 3

H3/H5/A64 DRM display driver

Recommended Posts

OK, I'm getting 3 FPS in es2gears (I remember Icenowy reported similar "performance"), but at least no crashes...


... and 10 FPS with armsoc and Mesa libraries instead of Mali libraries


... and 80 FPS with modesetting X11 driver and Mesa libraries

Share this post

Link to post
Share on other sites
40 minutes ago, zador.blood.stained said:

... and 80 FPS with modesetting X11 driver and Mesa libraries

Mesa means SW rendering?

Share this post

Link to post
Share on other sites
1 minute ago, jernej said:

Mesa means SW rendering?



root@orangepiplus2e:~# DISPLAY=:0 es2_info
libEGL warning: DRI2: failed to authenticate
EGL_VENDOR: Mesa Project
    EGL_KHR_config_attribs, EGL_KHR_create_context,
    EGL_KHR_get_all_proc_addresses, EGL_KHR_gl_colorspace,
    EGL_KHR_no_config_context, EGL_KHR_reusable_sync,
    EGL_KHR_surfaceless_context, EGL_MESA_configless_context
GL_VERSION: OpenGL ES 3.0 Mesa 17.0.7
GL_RENDERER: Gallium 0.4 on llvmpipe (LLVM 4.0, 128 bits)
    GL_EXT_blend_minmax, GL_EXT_multi_draw_arrays,
    GL_EXT_texture_format_BGRA8888, GL_OES_compressed_ETC1_RGB8_texture,
    GL_OES_depth24, GL_OES_element_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_float,
    GL_OES_texture_float_linear, GL_OES_texture_half_float,
    GL_OES_texture_half_float_linear, GL_OES_texture_npot,
    GL_OES_vertex_half_float, GL_EXT_texture_sRGB_decode, GL_OES_EGL_image,
    GL_OES_depth_texture, 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_NV_fbo_color_attachments,
    GL_OES_EGL_image_external, GL_OES_EGL_sync, GL_OES_vertex_array_object,
    GL_EXT_texture_rg, GL_EXT_unpack_subimage, GL_NV_draw_buffers,
    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_OES_depth_texture_cube_map, GL_OES_surfaceless_context,
    GL_EXT_color_buffer_float, GL_EXT_separate_shader_objects,
    GL_EXT_shader_integer_mix, GL_EXT_base_instance, GL_EXT_copy_image,
    GL_EXT_draw_buffers_indexed, GL_EXT_draw_elements_base_vertex,
    GL_EXT_polygon_offset_clamp, GL_EXT_texture_border_clamp,
    GL_KHR_context_flush_control, GL_OES_copy_image,
    GL_OES_draw_buffers_indexed, GL_OES_draw_elements_base_vertex,
    GL_OES_texture_border_clamp, GL_OES_texture_stencil8,
    GL_EXT_blend_func_extended, GL_EXT_clip_cull_distance,



Share this post

Link to post
Share on other sites
18 minutes ago, zador.blood.stained said:

Removing _PMU in similar macro calls in sunxi.c didn't help, at least for me.

Please follow or join debate on linux-sunxi IRC.

Share this post

Link to post
Share on other sites
47 minutes ago, zador.blood.stained said:

No changes

But is needed anyway.


49 minutes ago, zador.blood.stained said:

Also I checked the driver code, and it doesn't even try to allocate/use the PMU IRQ, neither does it have any PMU IRQ handlers.

My findings also.


I hope I can play a bit with Mali in the evening.

Share this post

Link to post
Share on other sites
Just now, zador.blood.stained said:

 - You didn't send your HDMI audio commits for reviews yet, but in any case I believe that the "sound_hdmi" node should not be a parent of the "soc" node, it should be in the root node instead.

Yeah, I'll fix that. Usually I'm lazy when it comes to DT...


2 minutes ago, zador.blood.stained said:

- Should the DW CEC driver that will be added in 4.14 work on H3/H5 in theory or will it need some extra HDMI PHY/clock/reset/etc tweaks?

I tested it already. Just one line fix was required to make it work, which is already included on my github:


Share this post

Link to post
Share on other sites

Maybe a stupid question, but how to test CEC from userspace? I have /dev/cec0 device node present but cec-client can't find any CEC devices.

I managed to dist-upgrade to Ubuntu Zesty and got cec-ctl and cec-compliance utils from "v4l-utils" package, but they are not very noob-friendly.

Share this post

Link to post
Share on other sites

The best way to test CEC alongside cec-compliance is this:

1. Run "cec-ctl --playback"

2. Some TVs, including mine, needs signal that device is CEC capable. This could be done with sending viewscreen image on (not sure if this is exact name) message with cec-ctl.

3. Run cec-follower with -m (I think) to view messages from TV

4. Press buttons on your TV remote


I don't remeber exact commands, but I can check them when I come back from work if you want.

Share this post

Link to post
Share on other sites


Any thoughts? This can be observed on shutdown at least on H5 (Orange Pi Zero+2 H5), nothing is plugged in the HDMI port.


[  154.864065] Unable to handle kernel NULL pointer dereference at virtual address 00000020
[  154.872372] user pgtable: 4k pages, 48-bit VAs, pgd = ffff800014aa5000
[  154.879052] [0000000000000020] *pgd=0000000000000000
[  154.884136] Internal error: Oops: 96000004 [#1] SMP
[  154.889114] Modules linked in: sun8i_dw_hdmi(-) dw_hdmi cec rc_core sun4i_tcon sun8i_mixer sun4i_drm [last unloaded: sy8106a_regulator]
[  154.901550] CPU: 2 PID: 1594 Comm: modprobe Not tainted 4.13.10-sunxi64 #1
[  154.908561] Hardware name: OrangePi Zero Plus2 (DT)
[  154.913538] task: ffff800015871b00 task.stack: ffff800014b08000
[  154.919585] PC is at drm_lastclose+0x28/0xd8
[  154.923943] LR is at drm_lastclose+0x28/0xd8
[  154.928299] pc : [<ffff0000085fd648>] lr : [<ffff0000085fd648>] pstate: 40000145
[  154.935841] sp : ffff800014b0bc70
[  154.939223] x29: ffff800014b0bc70 x28: ffff800015871b00
[  154.944644] x27: ffff000008961000 x26: 000000000000006a
[  154.950065] x25: 0000000000000124 x24: 0000000000000015
[  154.955486] x23: ffff8000169e4070 x22: ffff000008c99000
[  154.960907] x21: ffff0000009ac218 x20: ffff000008ad3000
[  154.966327] x19: 0000000000000000 x18: 0000ffffdec06428
[  154.971748] x17: 0000ffffa753e640 x16: ffff00000811ef70
[  154.977169] x15: 0000ffffa75eb000 x14: 0000000000000000
[  154.982590] x13: 0000000000000040 x12: 0000000000000030
[  154.988010] x11: 0000000000000030 x10: 0101010101010101
[  154.993431] x9 : 0000000000000000 x8 : ffff000008c38d88
[  154.998852] x7 : 0000000000000000 x6 : ffff800014d46630
[  155.004273] x5 : ffff800016abc5b8 x4 : 0000000000000000
[  155.009694] x3 : dead000000000100 x2 : ffff000008ad6490
[  155.015114] x1 : 0000000000040d00 x0 : 0000000000000000
[  155.020536] Process modprobe (pid: 1594, stack limit = 0xffff800014b08000)
[  155.027548] Stack: (0xffff800014b0bc70 to 0xffff800014b0c000)
[  155.033410] bc60:                                   ffff800014b0bca0 ffff000008600d40
[  155.041398] bc80: 0000000000000000 0000000000000000 ffff800014b0bd00 ffff000008267174
[  155.049385] bca0: ffff800014b0bcd0 ffff00000096009c 0000000000000000 ffff80001680bc10
[  155.057372] bcc0: ffff0000009ac218 0000000000000015 ffff800014b0bcf0 ffff000008620e84
[  155.065359] bce0: ffff800014ca7a00 ffff8000169e4810 ffff800014b0bd10 ffff000008620fc8
[  155.073347] bd00: ffff80001488bc00 ffff000008620f60 ffff800014b0bd40 ffff0000009ab05c
[  155.081334] bd20: ffff8000169e4810 ffff8000169e4870 ffff8000169e4010 ffff0000009ad028
[  155.089321] bd40: ffff800014b0bd50 ffff00000862978c ffff800014b0bd70 ffff000008627f30
[  155.097308] bd60: ffff8000169e4810 ffff8000169e4870 ffff800014b0bdb0 ffff000008628020
[  155.105295] bd80: ffff8000169e4810 ffff0000009ad028 ffff0000009ad100 0000ffffa753e648
[  155.113283] bda0: ffff000008ced000 ffff000008627ffc ffff800014b0bdd0 ffff00000862708c
[  155.121270] bdc0: ffff0000009ad028 ffff000008c99000 ffff800014b0be00 ffff00000862874c
[  155.129257] bde0: ffff0000009ad028 ffff000008c55000 ffff0000009ad100 ffff000008c55000
[  155.137245] be00: ffff800014b0be20 ffff000008629880 ffff000008c38000 0000000000000015
[  155.145232] be20: ffff800014b0be30 ffff0000009abe80 ffff800014b0be40 ffff00000811f14c
[  155.157240] be40: 0000000000000000 ffff000008082730 0000000000000000 000080000f388000
[  155.169256] be60: ffffffffffffffff 0000ffffa753e648 0000000060000000 ffff0000080879b8
[  155.181297] be80: 77645f69386e7573 000000696d64685f 0000000000000000 ffff000008082618
[  155.193215] bea0: 0000000000000000 000080000f388000 00ffffffffffffff 0000000000040d00
[  155.205041] bec0: 0000aaaabf2da108 0000000000000800 0000ffffdec06c60 0000000000000000
[  155.216827] bee0: 0000ffffa757b718 0000ffffa75df6f0 0000000000000000 1999999999999999
[  155.228634] bf00: 000000000000006a 0000ffffa757b718 0000ffffa757ae18 000000000000000a
[  155.240349] bf20: 0000000000000005 ffffffffffffffff 0000000000000000 0000ffffa75eb000
[  155.251929] bf40: 0000aaaab3b2a2d0 0000ffffa753e640 0000ffffdec06428 0000aaaabf2da0a0
[  155.263476] bf60: 0000000000000000 0000000000000000 0000000000000001 0000aaaabf2da108
[  155.274988] bf80: 0000ffffdec08f07 0000aaaab3b29000 0000ffffdec080e8 0000000000000000
[  155.286493] bfa0: 0000000000000011 0000ffffdec06c90 0000aaaab3b0ea90 0000ffffdec06c90
[  155.297995] bfc0: 0000ffffa753e648 0000000060000000 0000aaaabf2da108 000000000000006a
[  155.309570] bfe0: 0000000000000000 0000000000000000 befffeffffffffff fffffffffffebf9e
[  155.321113] Call trace:
[  155.327192] Exception stack(0xffff800014b0ba80 to 0xffff800014b0bbb0)
[  155.337397] ba80: 0000000000000000 0001000000000000 ffff800014b0bc70 ffff0000085fd648
[  155.349066] baa0: 0000000040000145 ffff000008950c70 ffff800016276000 ffff800096275fff
[  155.360764] bac0: ffff000008a30938 ffff000008c38000 ffff800014b0bb00 ffff0000081c4d08
[  155.372472] bae0: ffff7e00005222c0 0000000100200020 ffff800014b0bbf0 ffff0000081c4fac
[  155.384202] bb00: ffff800016837680 ffff80001488c780 ffff0000082659d4 ffff000008c38000
[  155.395953] bb20: ffff8000168eb210 0000000080000001 ffff000008cfc000 0000000000040d00
[  155.407715] bb40: 0000000000000000 0000000000040d00 ffff000008ad6490 dead000000000100
[  155.419502] bb60: 0000000000000000 ffff800016abc5b8 ffff800014d46630 0000000000000000
[  155.431316] bb80: ffff000008c38d88 0000000000000000 0101010101010101 0000000000000030
[  155.443185] bba0: 0000000000000030 0000000000000040
[  155.452096] [<ffff0000085fd648>] drm_lastclose+0x28/0xd8
[  155.461499] [<ffff000008600d40>] drm_dev_unregister+0x18/0xd8
[  155.471342] [<ffff00000096009c>] sun4i_drv_unbind+0x1c/0x50 [sun4i_drm]
[  155.482098] [<ffff000008620e84>] take_down_master+0x24/0x48
[  155.491822] [<ffff000008620fc8>] component_del+0x90/0x130
[  155.501313] [<ffff0000009ab05c>] sun8i_dw_hdmi_remove+0x14/0x28 [sun8i_dw_hdmi]
[  155.512739] [<ffff00000862978c>] platform_drv_remove+0x24/0x50
[  155.522631] [<ffff000008627f30>] device_release_driver_internal+0x170/0x1f8
[  155.533673] [<ffff000008628020>] driver_detach+0x48/0x90
[  155.543036] [<ffff00000862708c>] bus_remove_driver+0x54/0xb0
[  155.552733] [<ffff00000862874c>] driver_unregister+0x2c/0x50
[  155.562417] [<ffff000008629880>] platform_driver_unregister+0x10/0x18
[  155.572928] [<ffff0000009abe80>] sun8i_dw_hdmi_pltfm_driver_exit+0x10/0x190 [sun8i_dw_hdmi]
[  155.585445] [<ffff00000811f14c>] SyS_delete_module+0x1dc/0x260
[  155.595452] [<ffff000008082730>] el0_svc_naked+0x24/0x28
[  155.604949] Code: aa0003f3 d00026b4 91356280 94000af7 (f9401260)
[  155.615264] ---[ end trace a6f0f59fddcfb927 ]---



Share this post

Link to post
Share on other sites

No, not really. I never observed that, but then again, I test everything exclusively on H3, drivers built in and in 99% cases with cable plugged in at all times . I will check that case.


Can you try with drivers built in and with disabled cec & dw hdmi i2s driver?

Share this post

Link to post
Share on other sites
Just now, Igor said:

But sometimes it doesn't crash.

That would suggest race condition. But since I develop driver with a kernel with only built in drivers, problem may be masked.


Driver unloading needs some work anyway, since clocks are not disabled.

Share this post

Link to post
Share on other sites

And according to the debug info it crashes exactly here (drivers/gpu/drm/drm_file.c):

void drm_lastclose(struct drm_device * dev)

	if (dev->driver->lastclose) /* <-- Here */
	DRM_DEBUG("driver lastclose completed\n");

	if (drm_core_check_feature(dev, DRIVER_LEGACY))

Most likely it's a generic sunxi DRM problem (not related to DE2) when everything is built as modules.

Share this post

Link to post
Share on other sites
9 hours ago, zador.blood.stained said:

I see the A83t DE2 driver in 4.16-rc1

Yeah, DE2 improvements were merged some time ago, but currently I'm waiting on A83t HDMI driver review which is a bit stuck. I hope it will be merged in time for 4.17.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

3 3