WayfireWM / wayfire

A modular and extensible wayland compositor
https://wayfire.org/
MIT License
2.4k stars 178 forks source link

How to destroy wlroots backend #2333

Open dep4 opened 6 months ago

dep4 commented 6 months ago

Hi,

I need to unbind kernel driver from graphics card to pass to VM. First, I tried to remove output but it still keeps DRI device open. Added destroy backend, but it destroys all backends (including other card's) and still keeps device open. What am I missing?

Modified sample from stipc plugin

        auto output = wf::get_core().output_layout->find_output(data["output"]);
        auto backend=output->handle->backend;
        wlr_output_destroy(output->handle);
        wlr_multi_backend_remove(wf::get_core().backend,backend);
        wlr_backend_destroy(backend);

lsof

wayfire 2294 -   14u      CHR            226,128       0t0     347 /dev/dri/renderD128
wayfire 2294 -   15u      CHR            226,128       0t0     347 /dev/dri/renderD128
wayfire 2294 -   16u      CHR            226,128       0t0     347 /dev/dri/renderD128
wayfire 2294 -   17u      CHR            226,128       0t0     347 /dev/dri/renderD128
wayfire 2294 -   21u      CHR              226,0       0t0     348 /dev/dri/card0
wayfire 2294 -   22u      CHR            226,129       0t0     396 /dev/dri/renderD129
wayfire 2294 -   23u      CHR            226,129       0t0     396 /dev/dri/renderD129
wayfire 2294 -   24u      CHR            226,129       0t0     396 /dev/dri/renderD129
wayfire 2294 -   25u      CHR            226,129       0t0     396 /dev/dri/renderD129
wayfire 2294 -   26u      CHR              226,1       0t0     397 /dev/dri/card1
wayfire 2294 -   27u      CHR              226,1       0t0     397 /dev/dri/card1
wayfire 2294 -   28u      CHR              226,1       0t0     397 /dev/dri/card1
wayfire 2294 -   29u      CHR              226,1       0t0     397 /dev/dri/card1
wayfire 2294 -   32u      CHR            226,129       0t0     396 /dev/dri/renderD129
wayfire 2294 -   33u      CHR            226,129       0t0     396 /dev/dri/renderD129

Thanks

ammen99 commented 6 months ago

These things are mostly managed by wlroots, you should ask in the wlroots development channels what needs to happen on their side and then we can see what we can do on the Wayfire side to achieve it.