Sebastian Fricke
January 24, 2025
Reading time:
Made available earlier this week, Linux 6.13 brought numerous contributions from our engineering team. Collabora's deep involvement with the MediaTek community also continued to shine, with multiple improvements for MediaTek SoCs landing with this release.
AngeloGioacchino Del Regno introduced support to communicate with the Dynamic Voltage and Frequency Scaling Resource Collector (DVFSRC) hardware in MediaTek SoCs. As a result, the previously upstreamed DVFSRC Regulator and External Memory Interface (EMI) Interconnect drivers can now be enabled. This allows the System Companion Processor (SCP) Core Voltage and the EMI Bus Bandwidth to be scaled, improving the power efficiency of MediaTek-powered machines.
Moreover, during a round of testing, Angelo also found that the MMC/SD Controller of MediaTek SoCs doesn't always embed Command Queue Hardware (CQHCI) on all SoCs or even on all instances of the said controller on the same SoCs. For example, on MT8186, MT8192, MT8195 (and others), the eMMC instance of this controller does support CQE by hardware but the (Micro)SD one does not: this brings numerous performance hits, sometimes also shown as micro-stuttering in UX, because of a necessary spinlock at every read, or write, operation.
In order to overcome this, he implemented support in the MediaTek MMC/SD Controller driver (mtk-sd) for a software-based alternative for controller instances that don't support CQHCI, called Host Software Queue (HSQ): by doing so, MediaTek's driver acquires spinlocks less frequently, reducing expensive context switching, since it joins the sending of multiple commands into one single operation.
His tests with this patch, which he ran on a MT8195 Tomato Chromebook with a SanDisk Extreme Pro (A2 rated) MicroSD card, show decreased average access times (with a reduction of up to 150 milliseconds during intensive read/write cycles). This is an improvement of +50.5% IOPS and bandwidth during random 4k reads/writes, +24.28% during random 4k reads, and +3.14% in sequential reads. This has greatly reduced UX micro-stuttering, making them mostly unnoticeable during read/write-intensive workloads, such as opening the Chromium or Firefox browsers on GNOME.
Another notable contribution from Angelo includes the introduction of the support for OF Graphs in the MediaTek Display Controller (mediatek-drm) driver. The display IP cores in MediaTek SoCs allow a good amount of flexibility, supporting being interconnected with various different IP cores (for example, the Read DMA IP can be connected to either the Color Management, DisplayPort, DSI, Merge, or another IP) to form a full Display Data Path (DDP) that ends with an actual display. As the Display Data Path for a machine (Chromebook/Laptop, Smartphone, SBCs, etc) depends on the physically available display output(s), this cannot be hardcoded as a SoC-global parameter and is machine-specific.
His change removes the need to hardcode display paths into the driver for each machine, allowing them to be specified in the Device Tree of the target machine with an OF Graph. This avoids unnecessary growth of the mediatek-drm driver and reflects the configuration flexibility of the MediaTek Display Controller into devicetree files.
More contributions from Angelo include various other cleanups and improvements. He modernized the MediaTek RTC driver to use the RTC-subsystem provided APIs, reducing both binary and code size. He also added support for restricting Link Speed (Gen) and Link Width (Lanes) in the MediaTek PCI-Express Gen3 Controller driver.
Stay tuned for more MediaTek updates, as well as a complete recap of our contributions to Linux 6.13.
28/01/2025
The latest Linux kernel release is here, bringing improvements to the DRM subsystem, further enablement of Rockchip SoCs, a new debugging…
24/01/2025
Collabora's deep involvement with the MediaTek community continued to shine this week with the release of Linux 6.13, which saw multiple…
07/01/2025
A testament to its long standing community interest and devote volunteers, FOSDEM will be celebrating its 25th anniversary this year. Join…
Comments (0)
Add a Comment