Optimizing Mobile Game Performance and Power Consumption from a Device Manufacturer Perspective
The article explains how mobile device manufacturers can balance high frame‑rate gaming performance with reduced power draw by quantifying FPS metrics, applying temperature‑limited frame rates, using PM QoS and uclamp frequency scaling, implementing boost logic, and tailoring thread scheduling, emphasizing close collaboration with developers and silicon vendors.
According to the 2024 China Game Industry Report, the number of game users in China has reached 674 million, with mobile games accounting for 73.12% of total sales revenue. This makes mobile gaming the dominant trend, and developers must provide a smooth experience for users.
This article adopts the viewpoint of a mobile device‑manufacturer developer and focuses on the two most critical aspects of game experience: performance (frame rate) and power consumption.
Quantifying Game Experience
Performance is measured by frame rate (FPS) and three key metrics: average FPS, standard deviation of FPS, and minimum FPS. Power consumption is expressed as average current (mA) or power (W); for example, a game drawing 1200 mA on a 6000 mAh battery would last about 5 hours, while reducing consumption to 1000 mA extends playtime to 6 hours.
These two metrics often exhibit a trade‑off: higher frame rates usually increase power draw, but careful optimization can improve both.
Terminology
Tracking frame rate ("控帧") – calculating a target FPS based on device capability and user settings.
Temperature‑limited frame rate – lowering the target FPS when device temperature becomes excessive.
Frequency scaling (调频) – adjusting CPU frequency per frame using PM QoS and uclamp interfaces.
Boost – a corrective increase in frequency when the predicted frequency is insufficient to meet the target frame time.
Controlling Frame Rate
Simply using the user‑selected FPS is insufficient because users may choose a value beyond the device’s capability, causing large frame‑time fluctuations. The system must compute a realistic target FPS and keep the actual FPS stable around that value.
Temperature‑Limited Frame Rate
When device temperature rises (e.g., during high‑load gaming or charging while playing), a temperature‑control mechanism reduces the target FPS to limit heat generation.
Frequency Scaling via PM QoS
The kernel’s PM QoS interface allows setting a maximum (max_freq) and minimum (min_freq) frequency request. The request is made with freq_qos_add_request , which the CPUfreq governor (e.g., schedutil ) uses to adjust the hardware frequency.
Per‑Task Frequency Scaling with uclamp
PM QoS operates per‑CPU, which is insufficient for per‑task control. The uclamp mechanism (Utilization Clamping) lets developers set sched_util_min and sched_util_max for a specific task via sched_setattr(2) or the internal sched_setattr_nocheck syscall.
Frequency‑Scaling Algorithm
Typical algorithms predict the required frequency from recent load using an Exponential Moving Average (EMA). The core formula is:
freq = C * util / max_util_this_cpu * max_freq_this_cpu
where C is a safety factor (e.g., 1.25 for a 20 % headroom). The final frequency applied is clamped between the min and max requests:
final_freq = clamp(freq, min_freq, max_freq)
Boost Mechanism
When the predicted frequency cannot keep the frame time within the target, a boost is triggered. The boost timing is calculated as:
time_boost = target_time * (1 + a) + quota * b
and the amount of frequency increase can be configured either as an absolute value or a relative offset.
Combined Flow
The overall workflow combines frame‑rate control, frequency scaling, and boost to keep gameplay smooth while minimizing power draw. (Diagram omitted for brevity.)
Scenario‑Specific Optimizations
Detecting frame‑drop patterns (e.g., long‑running render thread in a popular game) and applying targeted boost.
Binding high‑load game threads (such as UnityMain and UnityGfx) to specific big cores to reduce cache migration and scheduling overhead.
Custom scheduler classes for gaming workloads to allow idle cores to enter deep‑sleep (partial halt) states, further saving power.
Conclusion
From the perspective of a mobile device manufacturer, optimizing both performance and power consumption is essential to deliver a fluid and long‑lasting gaming experience. Achieving this requires close collaboration among game developers, device makers, and silicon vendors.
OPPO Kernel Craftsman
Sharing Linux kernel-related cutting-edge technology, technical articles, technical news, and curated tutorials
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.