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

fix: kmsdrm: Use drmModeAddFB2WithModifiers instead of drmModeAddFB #10117

Merged
merged 1 commit into from
Jun 25, 2024

Conversation

ijsf
Copy link
Contributor

@ijsf ijsf commented Jun 25, 2024

This fixes corrupt framebuffers on platforms that require the use of modifiers such as NVIDIA Tegra, as noted in #10107.

Description

There are three different variants of the drmModeAddFB call: drmModeAddFB, drmModeAddFB2 and drmModeAddFB2WithModifiers. SDL currently uses the first variant but this results in framebuffer corruption as can be seen in #10107. This changes that call to use the modifiers supplied by libgbm, which seem to be required on platforms such as NVIDIA Tegra.

Existing Issue(s)

#10107

…using GBM modifiers.

This fixes corrupt framebuffers on platforms that require the use of modifiers.
@slouken
Copy link
Collaborator

slouken commented Jun 25, 2024

This generally seems good. We may need a dual path with the new symbol being optional, but if not, this patch looks good as-is.

@slouken slouken merged commit 620e875 into libsdl-org:release-2.30.x Jun 25, 2024
37 checks passed
@slouken
Copy link
Collaborator

slouken commented Jun 25, 2024

Merged, thanks!

@sezero
Copy link
Contributor

sezero commented Jun 25, 2024

This seems to require libgbm >= 17.1.0, you should document this (and possibly change configurators.)

(EDIT: libdrm version requirement possibly needs updating too -- to what, I don't know, though.)

@ijsf
Copy link
Contributor Author

ijsf commented Jun 25, 2024

Thanks, good point, I was expecting something needed to be bumped. Not sure how to approach from here though.

@ijsf
Copy link
Contributor Author

ijsf commented Jun 25, 2024

Seems to have been added to libdrm >= 2.4.71: https://gitlab.freedesktop.org/mesa/drm/-/commit/abfa680dbdfa4600105d904f4903c047d453cdb5 in 2016.

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

Successfully merging this pull request may close these issues.

3 participants