Bug 268171

Summary: devel/sdl20: doesn't work unless xrandr is called
Product: Ports & Packages Reporter: Olga Smirnova <mistresssilvara>
Component: Individual Port(s)Assignee: Dmitry Marakasov <amdmi3>
Status: Closed Not Enough Information    
Severity: Affects Only Me Flags: bugzilla: maintainer-feedback? (amdmi3)
Priority: ---    
Version: Latest   
Hardware: amd64   
OS: Any   
Attachments:
Description Flags
kdump logs none

Description Olga Smirnova 2022-12-05 12:35:46 UTC
SDL 2.24 fails to initialize due to "No available displays" unless xrandr binary is called at least once in the current X session.
Comment 1 Dmitry Marakasov freebsd_committer freebsd_triage 2022-12-05 15:39:52 UTC
Unless there's an indication the problem is something FreeBSD or port specific, please report upstream instead.
Comment 2 Dmitry Marakasov freebsd_committer freebsd_triage 2022-12-14 20:35:23 UTC
This also lacks any diagnostics or information whatsoever (system version and arch, installed packages w/versions, xorg setup, graphical hardware, xorg log, xrandr output, on which apps the problem reproduces, a minimal SDL application which reproduce the problem and some kind of trace (ktrace, xtrace) for it before and after running xrandr)
Comment 3 Olga Smirnova 2022-12-15 00:32:47 UTC
Created attachment 238806 [details]
kdump logs
Comment 4 Dmitry Marakasov freebsd_committer freebsd_triage 2022-12-15 19:40:40 UTC
You have not provided all the requested info.
Comment 5 Dmitry Marakasov freebsd_committer freebsd_triage 2022-12-16 13:51:52 UTC
Well the relevant SDL code is consolidated here

https://github.com/libsdl-org/SDL/blob/ab554c8392491b9b6320ad7e8800685c37bfa700/src/video/x11/SDL_x11modes.c#L457-L517

and here

https://github.com/libsdl-org/SDL/blob/ab554c8392491b9b6320ad7e8800685c37bfa700/src/video/x11/SDL_x11modes.c#L283-L389

I'd suggest to trace through it in gdb (adding printfs would be fine too) to discover which call fails (so the display is not enumerated) and why. If possible, convert the sequence of X11/XRandR calls into a small repro program (should be about a page of code). Then it would be clear whether it's SDL (such as some initialization call is missing) or Xorg/driver problem.