We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5279

Summary: KMSDRM: modeset support removed
Product: SDL Reporter: Anthony Pesch <inolen>
Component: videoAssignee: Manuel Alfayate Corchete <redwindwanderer>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.1   
Hardware: x86_64   
OS: Linux   

Description Anthony Pesch 2020-09-02 15:20:26 UTC
Hi,

In https://bugzilla.libsdl.org/show_bug.cgi?id=4966 support was added for changing the display mode at runtime with the KMSDRM backend.

It looks like with the latest code this has been removed with this comment:
https://github.com/spurious/SDL-mirror/blob/master/src/video/kmsdrm/SDL_kmsdrmvideo.c#L1317

However, I don't entirely understand the thoughts behind this comment. The reason for adding that support initially has nothing to do with scaling an image to fit the default display mode, it's because I do in fact want to change the display mode.

We have users who get a default display mode of 30hz instead of 60hz when running on a TV, we get users who get a default display mode that consumes way too much bandwidth (when they only need 720x480), etc. and they need the ability to change this at runtime.

Given that, is there an issue reverting and re-enabling support for this?

 - Anthony
Comment 1 Anthony Pesch 2020-09-02 18:00:49 UTC
Also of course, we have the opposite case sometimes where the default mode is low and the user wants to render at a higher resolution. All in all, the user wants to change the display mode in-app at runtime just like with the other video backends.
Comment 2 Manuel Alfayate Corchete 2020-09-14 12:31:21 UTC
@Anthony Pesch:

Modesetting was re-added in https://hg.libsdl.org/SDL/rev/1db0e22d45c0

It's now working in every situation, where the previous implementation was breaking some programs (Commander Genius dynamic mode change, etc).

Everything you mention is now working as intended, using the modern ATOMIC DRM interface instead of the legacy DRM functions.

I REPEAT: REAL, actual modesetting is working now an nothing has to be reverted, in fact there is nothing to revert because we are using the ATOMIC interface now, and previous legacy DRM functions are incompatible.