GRUB's Radeon Yeelong render-target setter invokes a generic implementation with a saved fallback value. It doesn't swap buffers. Its setup method validates config's supported, locates the GPU on the PCI bus (via a callback which retrieves the framebuffer), populates the "mode" properties, registers the memory-mapped I/O, zeroes it out, & calls generic routines to configure the render target.
There's an initializer & finalizer which additionally manages the memory-mapped I/O.
2/?