drm/mgag200: Flush the cache to improve latency
JIRA: https://issues.redhat.com/browse/RHEL-16556
This patch is still under discussion upstream, but we need this temporary workaround until we find a solution with upstream.
We found a regression in v5.10 on real-time server, using the rt-kernel and the mgag200 driver. It's some really specialized workload, with <10us latency expectation on isolated core. After the v5.10, the real time tasks missed their <10us latency when something prints on the screen (fbcon or printk)
The regression has been bisected to 2 commits: 0b34d58b ("drm/mgag200: Enable caching for SHMEM pages") 4862ffae ("drm/mgag200: Move vmap out of commit tail")
The first one changed the system memory framebuffer from Write-Combine to the default caching. Before the second commit, the mgag200 driver used to unmap the framebuffer after each frame, which implicitly does a cache flush. Both regressions are fixed by the following patch, which forces a cache flush after each frame, reverting to almost v5.9 behavior. This is necessary only if you have strong realtime constraints, so I put the cache flush under the CONFIG_PREEMPT_RT config flag. Also clflush is only availabe on x86, (and this issue has only been reproduced on x86_64) so it's also under the CONFIG_X86 config flag.
Signed-off-by: Jocelyn Falempe jfalempe@redhat.com