Skip to content

Mainline a5xx_hw_init programs the A540 at parity with kgsl's a5xx_start; the one extra mainline write is VPC ALLFLATOPTDIS

scope: soc:msm8998 · severity: finding · confidence: proven · subsystem: gpu

The question – does the vendor kernel program the A540 differently at start-up (ECO/chicken bits, clock gating, CP queue thresholds) in a way that could explain lockups mainline sees and Android does not?

The answer – no. Register by register, mainline’s a5xx_hw_init() plus a5xx_set_hwcg() write what kgsl’s a5xx_start() plus a5xx_hwcg_set() write for this part, with the same values. The quirk sets agree because kgsl takes them from the device tree and wahoo’s msm8998-gpu.dtsi sets exactly one, qcom,gpu-quirk-lmloadkill-disable, which is the one quirk in mainline’s a540 catalog entry. The single mainline-only write is VPC_DBG_ECO_CNTL bit 10, “disable all flat shading optimisation”, which disables an optimisation rather than enabling one.

What this rules out – the whole family of “kgsl sets a bit mainline does not” theories for the a540 hangs, and “the clock-gating tables drift”. Together with the register-level comparison kept out of this repository this leaves, for a software cause: register values and packet order in the userspace command stream; and for a hardware cause: the rail, now at the vendor’s CPR ceilings since r31, with the next hang’s .ctx file as the arbiter.

How it was established – a python extraction of every gpu_write/gpu_rmw and kgsl_regwrite/kgsl_regrmw in the two init paths and the two hwcg tables, keyed by register name (the names differ only by the REG_ prefix), listing one-sided registers and value differences. Not compared: GPMU firmware programming (a5xx_power.c vs kgsl’s a5xx_gpmu_start) and the preemption setup, which mainline does not use on this device.