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

wlroots based Wayland compositor #1209

Open
VitaliiBlagodir opened this issue Mar 23, 2023 · 3 comments
Open

wlroots based Wayland compositor #1209

VitaliiBlagodir opened this issue Mar 23, 2023 · 3 comments

Comments

@VitaliiBlagodir
Copy link

VitaliiBlagodir commented Mar 23, 2023

Describe the bug
The wlroots based Wayland compositor phoc fails to start on the NVIDIA Jetson AGX Xavier.

To Reproduce
Steps to reproduce the behavior:

  1. Build meta-tegra branch kirkstone-l4t-r32.7.x commit e5e5f08e640ea3ed67ef72c49304636fe47e9719 with MACHINE=jetson-agx-xavier-devkit
  2. Add phoc_0.25.2.bb phoc_0.25.2.zip
  3. Add CORE_IMAGE_BASE_INSTALL += phoc to demo-image-weston.bb
  4. Build with bitbake argument bitbake demo-image-weston
  5. Flash
  6. Run WLR_BACKENDS=wayland phoc and get an error: undefined symbol: drmIsKMS
    This error is caused by missing symbol drmIsKMS in NVIDIA version of libdrm.so (libdrm_nvdc.so, installed to rootfs as /usr/lib/tegra/libdrm.so.2)

I removed from phoc source code phoc/subprojects/wlroots/backend/session/session.c (actually from wlroots source code, loaded as git submodule) the following lines

	if (!drmIsKMS(dev->fd)) {
		wlr_log(WLR_DEBUG, "Ignoring '%s': not a KMS device", path);
		wlr_session_close_file(session, dev);
		return NULL;
	}

and rebuilt phoc. After this phoc fails to start with the following error:

(phoc:6399): phoc-wlroots-CRITICAL **: 17:45:59.097: [render/allocator/gbm.c:183] PRIME export not supported

(phoc:6399): phoc-wlroots-CRITICAL **: 17:45:59.101: [render/allocator/allocator.c:134] Failed to create allocator

(phoc:6399): phoc-server-CRITICAL **: 17:45:59.101: Failed to create server: Could not create allocator

Additional context
I've noticed multiple patches in meta-tegra/recipes-graphics/wayland for weston to run properly on Jetson.

Is there any change to get support of wlroots based Wayland compositor in meta-tegra?

@kekiefer
Copy link
Contributor

kekiefer commented Mar 23, 2023

Because with advancements in GBM buffer support it is starting to feel within reach, but we're not there yet. From the GBM side, we have an open alternate provider of tegra-gbm-backend (called tegra-udrm-gbm) which may get you a bit further there, or at least can be modified to make work if needed.

The current impediment is that NVIDIA's libdrm doesn't have a new enough API to support wlroots. It is possible that an older version of wlroots may fare better. Or maybe if you have the patience, you may be able to patch out the things that need the newer API, I don't know how extensive this is.

Edit: I should add that in my investigations here, I was not using phoc but instead sway from meta-wayland, so take this under consideration alongside my comment.

@kekiefer
Copy link
Contributor

Also, it is worth noting that for the best GBM support, you will want to be on one of the current jetpack 5 (35.x) branches.

@VitaliiBlagodir
Copy link
Author

@kekiefer Thank you for your input!
The meta-wayland layer contains recipes for wlroots, sway, phoc and other wlroots based compositors. It will be helpful for us. Thanks!
I don't have time for making wlroots work with NVIDIA's libdrm. Your note for using NVIDIA JetPack 5 sounds reasonable, but we can't switch to it until the OTA update of devices from JetPack 4 to JetPack 5 via Mender is possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants