[PATCH 0/3] drm/panic: Speed up QR code encoding
From: Peder Bergan via B4 Relay
Date: Thu Nov 26 2026 - 11:53:33 EST
The DRM panic helper encodes kernel log data into a QR code. Speed up
encoding by searching alignment centers per axis, applying fixed mask 0
during data placement, and simplifying exponent reduction in
Reed-Solomon error correction.
I benchmarked the extracted encoder with Rust 1.100.0 on an x86-64
Ryzen 7 9800X3D. Across 12 paired warm runs per workload, median
version-40 encoding time fell from 1.778 ms to 0.277 ms with a
2,900-byte raw payload and from 1.782 ms to 0.284 ms with a URL and
a 2,800-byte payload encoded in numeric mode. Both workloads produced
identical QR images. The timings cover encoding only. Log collection,
compression and framebuffer drawing were outside the benchmark.
In the differential checks, each patch preserved the returned width
and all output bytes across 6,002 raw and URL test inputs. The mask
traversal check covered all 40 QR versions, including the remainder
modules.
I also ran the drm_panic_helper KUnit suite in x86-64 QEMU/KVM with
the QR URL empty and with a URL configured. Both runs passed all 45
checks, including 15 QR cases.
---
OpenAI Codex assisted with coding and testing.
---
Peder Bergan (3):
drm/panic: Check QR alignment centers one axis at a time
drm/panic: Apply the QR mask while drawing data modules
drm/panic: Simplify QR error correction exponent reduction
drivers/gpu/drm/drm_panic_helper_qr.rs | 59 +++++++++++++---------------------
1 file changed, 23 insertions(+), 36 deletions(-)
---
base-commit: 5ce32a0c94a827ff44ee60898c28060714dcff75
change-id: 20261126-perf-drm-panic-qr-58b69ed0f455
Best regards,
--
Peder Bergan <peder.bergan@xxxxxxxxx>