Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: Add legacy wayland drm option #2485

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/api/wayfire/nonstd/wlroots-full.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ extern "C"
#define static
#include <wlr/backend.h>
#include <wlr/backend/drm.h>
#include <wlr/types/wlr_drm.h>
#if WLR_HAS_X11_BACKEND
#include <wlr/backend/x11.h>
#endif
Expand Down
7 changes: 7 additions & 0 deletions src/core/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ void wf::compositor_core_impl_t::init()
/* Needed for subsurfaces */
wlr_subcompositor_create(display);

/* Legacy DRM */
if (runtime_config.legacy_wl_drm &&
wlr_renderer_get_dmabuf_texture_formats(renderer))
{
wlr_drm_create(display, renderer);
}

protocols.data_device = wlr_data_device_manager_create(display);
protocols.primary_selection_v1 =
wlr_primary_selection_v1_device_manager_create(display);
Expand Down
7 changes: 6 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ int main(int argc, char *argv[])
{"debug", optional_argument, NULL, 'd'},
{"damage-debug", no_argument, NULL, 'D'},
{"damage-rerender", no_argument, NULL, 'R'},
{"legacy-wl-drm", no_argument, NULL, 'l'},
{"help", no_argument, NULL, 'h'},
{"version", no_argument, NULL, 'v'},
{0, 0, NULL, 0}
Expand All @@ -282,7 +283,7 @@ int main(int argc, char *argv[])
std::vector<std::string> extended_debug_categories;

int c, i;
while ((c = getopt_long(argc, argv, "c:B:d::DhRv", opts, &i)) != -1)
while ((c = getopt_long(argc, argv, "c:B:d::DhRlv", opts, &i)) != -1)
{
switch (c)
{
Expand All @@ -302,6 +303,10 @@ int main(int argc, char *argv[])
runtime_config.no_damage_track = true;
break;

case 'l':
runtime_config.legacy_wl_drm = true;
break;

case 'h':
print_help();
break;
Expand Down
1 change: 1 addition & 0 deletions src/main.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
extern struct wf_runtime_config
{
bool no_damage_track = false;
bool legacy_wl_drm = false;
bool damage_debug = false;
} runtime_config;

Expand Down
Loading