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

drm: add fallback drmModeAddFB for drivers which do not support drmModeAddFB2 #2569

Merged
merged 1 commit into from
Dec 28, 2020

Conversation

kaniini
Copy link
Contributor

@kaniini kaniini commented Dec 23, 2020

This pull request implements a fallback get_fb_for_bo_legacy function which uses the legacy drmAddModeFB function to set up the framebuffer.

This is based on the logic in xf86-video-modesetting, and allows both Sway and my own compositor to run on older cards which otherwise support the necessary features for Wayland to function. Tested on a machine with ATI Radeon 7500 AGP graphics.

backend/drm/util.c Outdated Show resolved Hide resolved
@kaniini kaniini force-pushed the feature/drm-mode-add-fb-fallback branch 2 times, most recently from 8ce8e13 to 4691870 Compare December 23, 2020 19:24
backend/drm/util.c Outdated Show resolved Hide resolved
@kaniini kaniini force-pushed the feature/drm-mode-add-fb-fallback branch from 4691870 to cc26cc4 Compare December 23, 2020 20:51
Copy link
Member

@emersion emersion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM apart from these minor comments!

backend/drm/util.c Outdated Show resolved Hide resolved
backend/drm/util.c Show resolved Hide resolved
backend/drm/util.c Outdated Show resolved Hide resolved
@kaniini kaniini force-pushed the feature/drm-mode-add-fb-fallback branch from cc26cc4 to 03e0578 Compare December 24, 2020 12:35
@kaniini
Copy link
Contributor Author

kaniini commented Dec 24, 2020

All of these revisions should now be incorporated :)

…deAddFB2

This makes wlroots able to run on some big-endian machines like G4 and
G5 systems with ATI Radeon 7500 AGP graphics.
@emersion emersion force-pushed the feature/drm-mode-add-fb-fallback branch from 03e0578 to 6298742 Compare December 28, 2020 13:10
Copy link
Member

@emersion emersion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@emersion emersion merged commit 23b6f3e into swaywm:master Dec 28, 2020
emersion added a commit to emersion/wlroots that referenced this pull request Apr 23, 2021
The previous code would always print "falling back to legacy method",
even if the format wasn't ARGB8888.

Drop get_fb_for_bo_legacy, since the code can just be inlined without
hurting readability.

Ideally we should only fallback to drmModeAddFB if the error code
indicates the BE failure, but the original PR [1] doesn't say what
error code is returned by the kernel.

[1]: swaywm#2569
kennylevinsen pushed a commit that referenced this pull request Apr 26, 2021
The previous code would always print "falling back to legacy method",
even if the format wasn't ARGB8888.

Drop get_fb_for_bo_legacy, since the code can just be inlined without
hurting readability.

Ideally we should only fallback to drmModeAddFB if the error code
indicates the BE failure, but the original PR [1] doesn't say what
error code is returned by the kernel.

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

Successfully merging this pull request may close these issues.

None yet

2 participants