Issue #3479 has been reported by tuxillo.

----------------------------------------
Bug #3479: radeon: text console on the EFI framebuffer overwrites the GART table
http://bugs.dragonflybsd.org/issues/3479

* Author: tuxillo
* Status: New
* Priority: Normal
* Target version: 6.6
* Start date: 2026-11-23
----------------------------------------
As of master 64a78aecd3, on a UEFI machine where syscons runs on the EFI 
framebuffer of a Radeon, loading radeon from the text console corrupts radeon's 
GART table. On a Radeon HD 5450 (Cedar), with Evergreen acceleration turned 
back on (the @#ifdef __DragonFly__@ block in evergreen_init() removed), kldload 
radeon gives:

<pre>
[drm] ring test on 0 succeeded in 1 usecs
[drm:r600_dma_ring_test] *ERROR* radeon: ring 3 test failed (0xCAFEDEAD)
drm0: error: disabling GPU acceleration
</pre>

The EFI framebuffer is the first 7.5 MB of the card's VRAM (1600x1200x32 at 
0xe0000000), and radeon puts its GART table at VRAM offset 0x14C000. Linux's 
radeon_pci_probe() removes the firmware framebuffer first 
(radeon_kick_out_firmware_fb()); on DragonFly that code is under DUMBBELL_WIP 
and @#if 0@. So syscons keeps drawing on efi_fb_info until radeon_fbdev_init() 
calls register_framebuffer(), after radeon_device_init() has enabled the GART 
and run the ring tests. Here that never happened, since no monitor was detected 
("Cannot find any crtc or sizes"). radeon's own init messages are enough to 
overwrite the table.

Read back through the VRAM BAR after the failure (attached gpuregs.c), the 
table held nothing radeon had written: 27848 of its 262144 entries were 
0x00aaaaaa00aaaaaa, the console's grey, and the rest 0. 80 more lines on 
/dev/console changed 34613 entries. With @sysctl kern.consmute=1@ before 
kldload, all ring and IB tests pass. They also pass when Xorg starts first and 
loads radeon, as with a display manager, because syscons doesn't draw while the 
VT is in graphics mode.

I've only tried a Cedar. r600, r700, Cayman and CIK keep acceleration on and 
may hit this on master as it is. A redraw on the EFI framebuffer after init, 
such as switching back to a text VT, would also land in radeon's VRAM; that 
might be behind #3198, which led to the Evergreen #ifdef, but I haven't checked.

I don't have a patch yet. Syscons probably needs to let go of efi_fb_info 
before radeon_device_init() uses the VRAM, as Linux does with efifb.

---Files--------------------------------
gpuregs.c (5.39 KB)


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://bugs.dragonflybsd.org/my/account

Reply via email to