-
-
Save clementpoiret/992d7b4c8cd3707b21461366c817db4d to your computer and use it in GitHub Desktop.
diff --git a/render/egl.c b/render/egl.c | |
index 8a1e6dae..d0e6adb6 100644 | |
--- a/render/egl.c | |
+++ b/render/egl.c | |
@@ -508,8 +508,43 @@ static int open_render_node(int drm_fd) { | |
} | |
wlr_log(WLR_DEBUG, "DRM device '%s' has no render node, " | |
"falling back to primary node", render_name); | |
+ | |
+ drmVersion *render_version = drmGetVersion(drm_fd); | |
+ if (render_version != NULL && render_version->name != NULL) { | |
+ wlr_log(WLR_DEBUG, "DRM device version.name '%s'", render_version->name); | |
+ if (strcmp(render_version->name, "evdi") == 0) { | |
+ free(render_name); | |
+ | |
+ uint32_t flags = 0; | |
+ const int devices_len = drmGetDevices2(flags, NULL, 0); | |
+ if (devices_len < 0) { | |
+ wlr_log(WLR_ERROR, "drmGetDevices2 failed: %s", strerror(-devices_len)); | |
+ return -1; | |
+ } | |
+ | |
+ const char *render_devices[] = { | |
+ "/dev/dri/card0", | |
+ "/dev/dri/card1", | |
+ "/dev/dri/card2", | |
+ "/dev/dri/card3", | |
+ "/dev/dri/card4", | |
+ "/dev/dri/card5", | |
+ "/dev/dri/card6", | |
+ "/dev/dri/card7", | |
+ "/dev/dri/card8", | |
+ "/dev/dri/card9", | |
+ NULL | |
+ }; | |
+ | |
+ render_name = malloc(sizeof(char)*15); | |
+ render_name = strcpy(render_name, render_devices[env_parse_switch("WLR_EVDI_RENDER_DEVICE", render_devices)]); | |
+ } | |
+ drmFreeVersion(render_version); | |
+ } | |
} | |
+ wlr_log(WLR_DEBUG, "open_render_node() DRM device '%s'", render_name); | |
+ | |
int render_fd = open(render_name, O_RDWR | O_CLOEXEC); | |
if (render_fd < 0) { | |
wlr_log_errno(WLR_ERROR, "Failed to open DRM node '%s'", render_name); |
# Maintainer: Clément POIRET <poiret dot clement at outlook dot fr> | |
_pkgname="hyprland" | |
pkgname="${_pkgname}-displaylink-git" | |
pkgver="0.38.1" | |
pkgrel=1 | |
pkgdesc="A dynamic tiling Wayland compositor based on wlroots that doesn't sacrifice on its looks. (DisplayLink patch)" | |
arch=(any) | |
url="https://github.com/hyprwm/Hyprland" | |
license=('BSD') | |
depends=( | |
cairo | |
gcc-libs | |
glib2 | |
glibc | |
glslang | |
hyprlang | |
hyprcursor | |
libdisplay-info | |
libdrm | |
libglvnd | |
libinput | |
libliftoff | |
libx11 | |
libxcb | |
libxcomposite | |
libxfixes | |
libxkbcommon | |
libxrender | |
opengl-driver | |
pango | |
pixman | |
polkit | |
seatd | |
systemd-libs | |
tomlplusplus | |
wayland | |
wayland-protocols | |
xcb-proto | |
xcb-util | |
xcb-util-errors | |
xcb-util-keysyms | |
xcb-util-renderutil | |
xcb-util-wm | |
xorg-xinput | |
xorg-xwayland | |
) | |
depends+=(libdisplay-info.so) | |
makedepends=( | |
cmake | |
gdb | |
git | |
jq | |
meson | |
ninja | |
pkgconf | |
xorgproto | |
) | |
source=( | |
"${pkgname}-${pkgver}.tar.gz::https://github.com/hyprwm/Hyprland/releases/download/v${pkgver}/source-v${pkgver}.tar.gz" | |
"displaylink.patch" | |
) | |
conflicts=("${_pkgname}") | |
provides=(hyprland) | |
sha256sums=('1a86365cc006fca4bc96c6c41347d0bde048b6463c516e09b9c54cff58fb73ab' | |
'70c8f6af41ed252c2cee7b1fc0b29ff29c7f81932a9dd3014716571b0728e5ab') | |
options=(!makeflags !buildflags !strip) | |
prepare() { | |
cd "$srcdir/hyprland-source" | |
patch -d subprojects/wlroots -Np1 < ../displaylink.patch | |
} | |
build() { | |
cd "$srcdir/hyprland-source" | |
meson setup build \ | |
--prefix /usr \ | |
--libexecdir lib \ | |
--sbindir bin \ | |
--buildtype release \ | |
--wrap-mode nodownload \ | |
-D b_lto=true \ | |
-D b_pie=true \ | |
-D default_library=shared \ | |
-D xwayland=enabled \ | |
-D systemd=enabled | |
meson compile -C build | |
} | |
package() { | |
cd "$srcdir/hyprland-source" | |
meson install -C build \ | |
--destdir "$pkgdir" \ | |
--skip-subprojects hyprland-protocols | |
mkdir "$pkgdir/usr/include/hyprland/wlroots" | |
mv "$pkgdir/usr/include/wlr" "$pkgdir/usr/include/hyprland/wlroots" | |
# resolve conflicts with system wlr | |
rm -f "$pkgdir/usr/lib/libwlroots.so" | |
rm -rf "$pkgdir/usr/lib/pkgconfig" | |
# FIXME: remove after xdg-desktop-portal-hyprland disowns hyprland-portals.conf | |
rm -rf "$pkgdir/usr/share/xdg-desktop-portal" | |
# license | |
install -Dm0644 -t "$pkgdir/usr/share/licenses/${pkgname}" LICENSE | |
} |
Disclaimer: the displaylink patch is not mine, it comes from https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/1823 from matt1606.
Updated to v0.38.1
Hey thanks for the gist, for me it is failing while validity checking displayllink.patch
edit: managed to install it by updating pkg checksum but the displaylink display is still not working, I'm on nvidia btw
Hey @dvrkoo thanks for your feedback!
Oops, I made a mistake concerning the hash. I just updated it, it should be okay now.
hey thx, it install without having to update the checksum manually now, still not working doe, hyprctl monitors all lists displaylink monitor but monitor is not working when added to config, I just get blackscreen
`
Monitor DP-3 (ID 0):
2560x1440@165.00301 at 0x0
description: ASUSTek COMPUTER INC VG27AQ1A R6LMQS052577
make: ASUSTek COMPUTER INC
model: VG27AQ1A
serial: R6LMQS052577
active workspace: 1 (1)
special workspace: 0 ()
reserved: 0 0 0 32
scale: 1.00
transform: 0
focused: yes
dpmsStatus: 1
vrr: 0
activelyTearing: false
currentFormat: XBGR2101010
availableModes: 2560x1440@165.00Hz 2560x1440@144.01Hz 2560x1440@120.00Hz 2560x1440@99.95Hz 2560x1440@59.95Hz 1920x1080@119.88Hz 1920x1080@100.00Hz 1920x1080@60.00Hz 1920x1080@59.94Hz 1920x1080@50.00Hz 1280x1024@75.03Hz 1280x1024@60.02Hz 1440x900@59.89Hz 1152x864@75.00Hz 1280x720@59.94Hz 1280x720@50.00Hz 1440x576@50.00Hz 1024x768@75.03Hz 1024x768@70.07Hz 1024x768@60.00Hz 1440x480@59.94Hz 800x600@75.00Hz 800x600@72.19Hz 800x600@60.32Hz 800x600@56.25Hz 720x576@50.00Hz 640x480@75.00Hz 640x480@72.81Hz 640x480@59.94Hz
Monitor DVI-I-1 (ID 1):
1920x1080@60.00000 at 2560x0
description: ASUSTek COMPUTER INC MB16A R2LMQS066582
make: ASUSTek COMPUTER INC
model: MB16A
serial: R2LMQS066582
active workspace: 2 (2)
special workspace: 0 ()
reserved: 0 0 0 31
scale: 1.50
transform: 0
focused: no
dpmsStatus: 1
vrr: 0
activelyTearing: false
currentFormat: XRGB8888
availableModes: 1920x1080@60.00Hz 1600x1200@60.00Hz 1680x1050@59.88Hz 1280x1024@60.02Hz 1440x900@59.90Hz 1280x960@60.00Hz 1280x800@59.91Hz 1280x720@60.00Hz 1024x768@60.00Hz 800x600@60.32Hz 640x480@59.94Hz
`
here's my hyprctl output, I'm on nvidia 550.67 if that matters
Okay, so now your hyprland setup works. I would say you may want to try few things:
- instead of the evdi package, try evdi-git or evdi-compat,
- try the same setup with and lts kernel,
Also, regularly nvidia drivers are breaking things. If you do not use your GPU, I'd suggest trying the nouveau driver. For my personal workflow, nouveau suits my needs on my laptop as I do not use CUDA and cuDNN on it. At least, if you try the nouveau driver and see that your screen is working, it means that's effectively an issue with nvidia, so you can try to temporarily downgrade your nvidia drivers. I got tired of nvidia breaking things randomly so I gave up and went the nouveau path :)
Already tried using evdi-git and using lts kernel , unfortunately my workflow relies heavily on CUDA so I cannot really live without it, I'm just gonna stick with x11 in the meanwhile, thanks for your work
Hopefully one day this patch will be merged into wlroots, let's cross our fingers :)
@GersiD Thanks for your message, it reminded me to update the PKGBUILD to hyprland 0.37.1!
Steps to install hyprland with displaylink patch:
0. Due to recent changes in dependencies, you need to install hyprcusor manually (
yay -S hyprcursor
). Because it relies on newer versions of hyprlang, I also had to replacexdg-desktop-portal
,hyprlang
, andhyprpaper
withxdg-desktop-portal-git
,hyprlang-git
, andhyprpaper-git
.PKGBUILD
anddisplaylink.patch
and place them in the same directory.makepkg -si
.You now have hyprland v0.37.1 installed, simply reboot and check that your screen works!