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

Cannot create DRM context without X server running. #2946

Open
3 tasks done
Omnomios opened this issue Apr 14, 2024 · 2 comments
Open
3 tasks done

Cannot create DRM context without X server running. #2946

Omnomios opened this issue Apr 14, 2024 · 2 comments
Labels

Comments

@Omnomios
Copy link

Omnomios commented Apr 14, 2024

Prerequisite Checklist

Describe your issue here

When I attempt to run any of the example programs I get the message:

DRM device used: 0
DRM device used: 1
DRM using the current mode
DRM Mode used: 3840x2160@60
Failed to set mode: Invalid argument

I've tried with different modes using SFML_DRM_MODE and selecting different devices with SFML_DRM_DEVICE but the outcome is the same no matter the combination.

If I start the same program with startx then it doesn't give an error but there is no output on the display.

I've confirmed the GPU can output the selected mode with glmark2 and with a vanilla build of SFML. It's only the DRM build that won't start.

Your Environment

  • OS / distro / window manager:
    Linux 6.1.25 Debian Bookworm
  • SFML version:
    2.6.1
  • Compiler / toolchain:
    GCC version 12.2.0 - aarch64-linux-gnu
  • Special compiler / CMake flags:
    SFML_USE_DRM SFML_BUILD_EXAMPLES

Steps to reproduce

  1. Download SFML 2.6.1 source
  2. Build with CMAKE flag SFML_USE_DRM and SFML_BUILD_EXAMPLES
  3. Run ./examples/opengl/opengl without an X server running

Expected behavior

Connected display should show a spinning cube on a jungle background

Actual behavior

Program wont start with the error message "Failed to set mode: Invalid argument"

@Omnomios Omnomios added the bug label Apr 14, 2024
@Omnomios
Copy link
Author

Further investigation I found this in the DRM logs when I switched it to debug logging

Apr 14 12:47:22 localhost kernel: [drm:drm_helper_probe_single_connector_modes] [CONNECTOR:450:DP-1] probed modes :
Apr 14 12:47:22 localhost kernel: [drm:drm_mode_debug_printmodeline] Modeline "3840x2160": 60 533250 3840 3888 3920 4000 2160 2214 2219 2222 0x48 0x9
Apr 14 12:47:22 localhost kernel: [drm:drm_mode_debug_printmodeline] Modeline "3840x2160": 30 266640 3840 3848 3992 4000 2160 2214 2219 2222 0x40 0x9
Apr 14 12:47:22 localhost kernel: [drm:drm_mode_debug_printmodeline] Modeline "2560x1440": 60 241500 2560 2608 2640 2720 1440 1443 1448 1481 0x40 0x9
Apr 14 12:47:22 localhost kernel: [drm:drm_mode_debug_printmodeline] Modeline "1920x1080": 60 148500 1920 2008 2052 2200 1080 1084 1089 1125 0x40 0x5
Apr 14 12:47:22 localhost kernel: [drm:drm_mode_debug_printmodeline] Modeline "1920x1080": 60 148500 1920 2008 2052 2200 1080 1084 1089 1125 0x40 0x5
Apr 14 12:47:22 localhost kernel: [drm:drm_mode_debug_printmodeline] Modeline "1920x1080": 60 148352 1920 2008 2052 2200 1080 1084 1089 1125 0x40 0x5
Apr 14 12:47:22 localhost kernel: [drm:drm_mode_debug_printmodeline] Modeline "1600x900": 60 108000 1600 1624 1704 1800 900 901 904 1000 0x40 0x5
Apr 14 12:47:22 localhost kernel: [drm:drm_mode_debug_printmodeline] Modeline "1280x1024": 60 108000 1280 1328 1440 1688 1024 1025 1028 1066 0x40 0x5
Apr 14 12:47:22 localhost kernel: [drm:drm_mode_debug_printmodeline] Modeline "1280x800": 60 83500 1280 1352 1480 1680 800 803 809 831 0x40 0x6
Apr 14 12:47:22 localhost kernel: [drm:drm_mode_debug_printmodeline] Modeline "1280x720": 60 74250 1280 1390 1430 1650 720 725 730 750 0x40 0x5
Apr 14 12:47:22 localhost kernel: [drm:drm_mode_debug_printmodeline] Modeline "1280x720": 60 74250 1280 1390 1430 1650 720 725 730 750 0x40 0x5
Apr 14 12:47:22 localhost kernel: [drm:drm_mode_debug_printmodeline] Modeline "1280x720": 60 74176 1280 1390 1430 1650 720 725 730 750 0x40 0x5
Apr 14 12:47:22 localhost kernel: [drm:drm_mode_debug_printmodeline] Modeline "1024x768": 60 65000 1024 1048 1184 1344 768 771 777 806 0x40 0xa
Apr 14 12:47:22 localhost kernel: [drm:drm_mode_debug_printmodeline] Modeline "800x600": 60 40000 800 840 968 1056 600 601 605 628 0x40 0x5
Apr 14 12:47:22 localhost kernel: [drm:drm_mode_debug_printmodeline] Modeline "720x480": 60 27027 720 736 798 858 480 489 495 525 0x40 0xa
Apr 14 12:47:22 localhost kernel: [drm:drm_mode_debug_printmodeline] Modeline "720x480": 60 27000 720 736 798 858 480 489 495 525 0x40 0xa
Apr 14 12:47:22 localhost kernel: [drm:drm_mode_debug_printmodeline] Modeline "640x480": 60 25200 640 656 752 800 480 490 492 525 0x40 0xa
Apr 14 12:47:22 localhost kernel: [drm:drm_mode_debug_printmodeline] Modeline "640x480": 60 25175 640 656 752 800 480 490 492 525 0x40 0xa
Apr 14 12:47:22 localhost kernel: [drm:drm_mode_debug_printmodeline] Modeline "640x480": 60 25175 640 656 752 800 480 490 492 525 0x40 0xa
Apr 14 12:47:23 localhost kernel: [drm:rockchip_gem_get_pages.constprop.0] bank_bit_first = 0xd, bank_bit_mask = 0x7
Apr 14 12:47:23 localhost kernel: [drm:rockchip_gem_get_pages.constprop.0] rockchip_gem_get_pages, 222, end = 4, n_pages = 4
Apr 14 12:47:23 localhost kernel: [drm:rockchip_gem_get_pages.constprop.0] bank_bit_first = 0xd, bank_bit_mask = 0x7
Apr 14 12:47:23 localhost kernel: [drm:rockchip_gem_get_pages.constprop.0] rockchip_gem_get_pages, 222, end = 520, n_pages = 520
Apr 14 12:47:23 localhost kernel: rockchip-drm display-subsystem: [drm:drm_mode_addfb2] [FB:464]
Apr 14 12:47:23 localhost kernel: [drm:drm_mode_setcrtc] [CRTC:157:video_port2]
Apr 14 12:47:23 localhost kernel: [drm:drm_mode_setcrtc] Invalid pixel format AR24 little-endian (0x34325241), modifier 0xffffffffffffff

@binary1248
Copy link
Member

The DRM implementation was written/ported by @mickelson, @oomek and @substring. Maybe they can look into this.

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

No branches or pull requests

2 participants