Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

[render/allocator/gbm.c:63] gbm_bo_get_fd failed #3156

Closed
jbeich opened this issue Sep 2, 2021 · 7 comments · Fixed by #3163
Closed

[render/allocator/gbm.c:63] gbm_bo_get_fd failed #3156

jbeich opened this issue Sep 2, 2021 · 7 comments · Fixed by #3163

Comments

@jbeich
Copy link
Contributor

jbeich commented Sep 2, 2021

Regressed by #3153. Starting Sway on DRM console hangs without leaving console (Ctrl+Alt+Fn works fine). Tested on FreeBSD with i915 ported from Linux 5.4.92.

From debug log:

 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset
 [DEBUG] [wlr] [types/wlr_output.c:524] Choosing primary buffer format 0x34325241 for output 'DP-1'
 [DEBUG] [wlr] [render/swapchain.c:105] Allocating new swapchain buffer
-[DEBUG] [wlr] [render/allocator/gbm.c:129] Allocated 3840x2160 GBM buffer (format 0x34325241, modifier 0x100000000000004)
-[DEBUG] [wlr] [render/gles2/renderer.c:143] Created GL FBO for buffer 3840x2160
-[DEBUG] [sway/config/output.c:346] Output DPI: 162.560000x161.364706
+[ERROR] [wlr] [render/allocator/gbm.c:63] gbm_bo_get_fd failed
+[ERROR] [wlr] [render/swapchain.c:109] Failed to allocate buffer
+[DEBUG] [sway/config/output.c:388] Preferred mode rejected, falling back to another mode
+[DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer
@emersion
Copy link
Member

emersion commented Sep 2, 2021

Hm, weird. Seems like the buffer was successfully created but something prevents it from being exported as a DMA-BUF… Is there anything in dmesg?

@emersion
Copy link
Member

emersion commented Sep 2, 2021

Please also try enabling the bit 0x08 in the DRM logs (https://github.com/swaywm/wlroots/wiki/DRM-Debugging).

emersion added a commit to emersion/wlroots that referenced this issue Sep 2, 2021
Makes it easier to find out which branch is taken when debugging
issues like [1].

[1]: swaywm#3156
@jbeich
Copy link
Contributor Author

jbeich commented Sep 2, 2021

dmesg shows nothing from kernel, even after sysctl hw.dri.debug=0x08.

DRM debug log with every bit enabled.

@emersion
Copy link
Member

emersion commented Sep 2, 2021

Hm, DRM_IOCTL_PRIME_HANDLE_TO_FD fails with EACCES it seems. May be due to the use of a primary node without authentication.

@jbeich
Copy link
Contributor Author

jbeich commented Sep 2, 2021

On FreeBSD major numbers maybe different, confusing DRM authentication.

$ ls -lL /dev/dri
total 0
crw-rw----  1 root  video   0x95  2 Sep 05:47 card0
crw-rw----  1 root  video  0x174  2 Sep 05:47 renderD128

$ major() { echo $(( (($1 >> 32) & 0xffffff00) | (($1 >> 8) & 0xff) )); }
$ major 0x95
0
$ major 0x174
1

@emersion
Copy link
Member

emersion commented Sep 3, 2021

Can you try this?

#3163

@jbeich
Copy link
Contributor Author

jbeich commented Sep 3, 2021

I confirm, works fine after applying #3163. sway -dc /dev/null doesn't show errors anymore.

kennylevinsen pushed a commit that referenced this issue Sep 3, 2021
Makes it easier to find out which branch is taken when debugging
issues like [1].

[1]: #3156
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging a pull request may close this issue.

2 participants