Make it compile on Linux 6.16 and improve performance#32
Make it compile on Linux 6.16 and improve performance#32tiirwaa wants to merge 39 commits intorhgndf:mainfrom
Conversation
- Added DRIVER_RENDER to driver_features in drm_driver struct. - Fixed compilation errors and warnings. Verified driver loads correctly and detects HDMI display resolution.
…aximum 1920x1080 resolution - Allocate temp_buffer once per request with size 1920 * 4 bytes (max line width * bytes per pixel) - Avoid repeated dynamic allocations in ms912x_fb_xrgb8888_to_yuv422() - Improve performance and reduce memory fragmentation
…in ms912x_fb_send_rect - Removed wait_for_completion_timeout to avoid stalling workqueue and improve frame throughput. - Resulted in smoother video playback, especially noticeable with multi-monitor setups. - Ensured driver stability while reducing latency in USB requests.
tiirwaa
left a comment
There was a problem hiding this comment.
Review of Andrey’s last 3 commits:
Optimize temp_buffer allocation (7077109):
Improved temp_buffer allocation by pre-allocating a fixed buffer size to avoid repeated dynamic allocations, enhancing performance and reducing memory fragmentation.
Fix on ms912x_free_request (6c2a59c):
Fixed resource freeing function to properly clean up buffers, preventing potential memory leaks and misuse.
Improve performance by removing blocking wait_for_completion_timeout (37f09d6):
Removed blocking wait_for_completion_timeout in ms912x_fb_send_rect, significantly improving performance and video smoothness, especially on setups with multiple monitors. The driver remains stable after this change.
tiirwaa
left a comment
There was a problem hiding this comment.
Using wait_for_completion_timeout together with the 60 FPS frame limiting logic results in good performance and effective vertical synchronization (vsync). This helps reduce tearing and ensures smoother display output.
tiirwaa
left a comment
There was a problem hiding this comment.
get more fps on the usb screen, lowering timeout is allowing thank to the fps limit
tiirwaa
left a comment
There was a problem hiding this comment.
[Fixed timeout in fps limiter to 16ms = 60fps]
get more mps on usb hdmi screen
reduce mouse flickering
tiirwaa
left a comment
There was a problem hiding this comment.
restored modes deleted by error
|
Can you format with clang-format? The diffs are very difficult to read at the moment |
|
Also please clean up the comments, there are a lot of random comments left in the code |
|
Thanks for the contribution @tiirwaa! I need you to answer to some of the comments on this PR. |
Missing space in comment. Should be '/* Same data reused here */'. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Enable runtime configuration of ms912x_mode_list[0].mode via module parameter
Enable runtime override of ms912x_mode_list[0].mode via module parameter This change removes the const qualifier from ms912x_mode_list and adds a write-only module parameter (mode_set) that allows setting the mode field of the first entry in the mode list at runtime. The feature is intended for debugging and testing purposes, enabling developers to quickly force a specific HDMI output mode without recompiling the driver. Notes: Only ms912x_mode_list[0].mode is affected. No validation or hardware reconfiguration is performed after changing the value; the updated mode will take effect only if/when the driver reads it again (e.g., during re-initialization). Parameter is restricted to root or members of the root group (S_IWUSR | S_IWGRP).
I am using Arch Linux with Kernel 6.16.4-arch1-1. This patch allows the driver to be compiled. "from_timer" was renamed to "timer_container_of" in the Linux Kernel. There seems to be some graphical problems. Idk how to fix that, so good luck.
"from_timer" was renamed to "timer_container_of"
|
$ LANG=C make -j4 KERNELRELEASE=6.15.8-100.fc41.x86_64 all |
Hi, The errors you’re seeing happen because the main branch now targets kernel 6.16, so it’s not compatible with 6.15. To compile for kernel 6.15, please use the branch kernel-6.15 This branch includes all necessary fixes for kernel 6.15, including timer_container_of. Compiling main for 6.15 will fail with errors like the ones you posted. |
uname -r
6.15.6-1-liquorix-amd64
lsmod | grep ms912x
ms912x 24576 1
drm_shmem_helper 40960 1 ms912x
drm_ttm_helper 16384 3 ms912x,nvidia_drm,xe
drm_client_lib 20480 4 ms912x,nvidia_drm,xe,i915
drm_kms_helper 241664 8 ms912x,drm_shmem_helper,drm_display_helper,drm_ttm_helper,nvidia_drm,drm_client_lib,xe,i915
drm 815104 33 gpu_sched,i2c_hid,ms912x,drm_kms_helper,drm_exec,drm_gpuvm,drm_suballoc_helper,drm_shmem_helper,drm_display_helper,nvidia,drm_buddy,drm_ttm_helper,nvidia_drm,drm_client_lib,xe,i915,ttm
dmesg | grep ms912x
[ 1357.389889] usbcore: registered new interface driver ms912x
[ 1362.995188] [drm] Initialized ms912x 0.0.1 for 3-4.3:1.3 on minor 2
[ 3077.155772] Modules linked in: ms912x(O) snd_usb_audio snd_usbmidi_lib snd_ump drm_shmem_helper xt_set ip_set xfrm_user xfrm_algo af_packet rfcomm cmac algif_hash algif_skcipher af_alg snd_hrtimer nvidia_uvm(O) xt_CHECKSUM xt_MASQUERADE nft_chain_nat nf_nat bridge stp llc vboxnetadp(O) vboxnetflt(O) snd_ctl_led snd_soc_skl_hda_dsp snd_soc_intel_sof_board_helpers snd_soc_intel_hda_dsp_common snd_sof_probes overlay vboxdrv(O) ip6t_REJECT nf_reject_ipv6 xt_hl ip6t_rt ipt_REJECT nf_reject_ipv4 xt_LOG nf_log_syslog nft_limit snd_hda_codec_realtek snd_hda_codec_generic snd_hda_scodec_component snd_soc_dmic snd_sof_pci_intel_tgl snd_sof_pci_intel_cnl snd_sof_intel_hda_generic soundwire_intel snd_sof_intel_hda_sdw_bpt snd_sof_intel_hda_common snd_soc_hdac_hda snd_sof_intel_hda_mlink snd_sof_intel_hda soundwire_cadence snd_sof_pci snd_sof_xtensa_dsp snd_sof snd_sof_utils snd_soc_acpi_intel_match snd_soc_acpi_intel_sdca_quirks soundwire_generic_allocation snd_soc_acpi soundwire_bus snd_soc_sdca crc8 xt_limit snd_soc_avs bnep
[ 3077.155864] ghash_clmulni_intel sha512_ssse3 cec sha256_ssse3 rc_core sha1_ssse3 aesni_intel crypto_simd ucsi_acpi cryptd intel_lpss_pci drm_kms_helper i2c_i801 r8169 i2c_hid_acpi spi_intel_pci i2c_hid typec_ucsi i2c_smbus intel_lpss intel_gtt spi_intel i2c_mux realtek usbhid rtsx_pci idma64 agpgart typec drm video wmi pinctrl_tigerlake [last unloaded: ms912x(O)]
[ 3104.005031] usbcore: deregistering interface driver ms912x
[ 3115.118857] usbcore: registered new interface driver ms912x
[ 3121.459230] [drm] Initialized ms912x 0.0.1 for 3-4.3:1.3 on minor 2
[ 3121.878262] ms912x 3-4.3:1.3: [drm] fb2: ms912xdrmfb frame buffer device