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 5513 - [KMS/DRM] backend can't manage several displays.
Summary: [KMS/DRM] backend can't manage several displays.
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 2.0.15
Hardware: All Linux
: P2 normal
Assignee: Manuel Alfayate Corchete
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-29 00:37 UTC by Manuel Alfayate Corchete
Modified: 2021-01-29 17:10 UTC (History)
0 users

See Also:


Attachments
Patch that adds multiple displays support to the SDL2 KMSDRM backend. (34.66 KB, patch)
2021-01-29 00:37 UTC, Manuel Alfayate Corchete
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Manuel Alfayate Corchete 2021-01-29 00:37:23 UTC
Created attachment 4731 [details]
Patch that adds multiple displays support to the SDL2 KMSDRM backend.

Hi,

Until now, the KMSDRM backend didn't even try to detect and use several connected connectors, resulting in a single display always (ie: a single SDL Display was created around the first connected connector, and that was about it).

The included patch adds support for several displays on the same machine.
Some notes:
-An SDL Display is an internal SDL2 entity built around a connected connector: a connector is a DRM-side resource.
-A single video card DRI dev node (/dev/dri/card0, for example) can have several connectors. We don't manage several video cards: just several connectors on a video card.
-Mouse cursor can be drawn on different displays, of course, so access to the cursor-related GBM-side resources is now done through each SDL Display driverdata pointer: each display driverdata pointer has it's own cursor GBM BO (so, in practice, each display can have it's own cursor on screen now).

Please review so I can merge. Thanks!
Comment 1 Sam Lantinga 2021-01-29 16:54:41 UTC
You have an empty SetWindowGrab implementation mixed in there. Otherwise it looks good.
Comment 2 Manuel Alfayate Corchete 2021-01-29 17:10:01 UTC
@Sam: removed the empty SetWindowGrab code (we don't use that in KMSDRM) and did the commit.

Closing this, thanks!