libplatsch: handle possible clones#9
Open
bith3ad wants to merge 1 commit intopengutronix:mainfrom
Open
Conversation
At the moment we miss the support to drive multiple connectors which are connected to the same CRTC, also called a hardware clone mode. libplatsch is not using the DRM atomic API due to it limited scope therefore using properties values isn't sufficient. Instead all possible connector ids need to be passed during the drmModeSetCrtc(). To find all connectors which belong to the same CRTC, the encoder behind each connector must be validated by making use of the encoders '.possible_clones' array. If a connector shall be added which belongs to an already used CRTC, a check is performed to see if this connector can be driven by the CRTC. In that case the connector id is added to the 'struct modeset_dev::conn_id' array and -EEXIST is returned. Because of this error, no new 'struct modeset_dev' is added and certain error() messages aren't printed because this can be a valid use-case. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
lynxeye-dev
reviewed
Sep 10, 2025
Comment on lines
+176
to
+179
| for (i = 0; i < dev->max_conn_num; i++) { | ||
| if (dev->conn_id[i] == 0) | ||
| break; | ||
| } |
Contributor
There was a problem hiding this comment.
Why is this iteration needed? AFAICS you already know the last used array entry by looking at dev->conn_num.
Comment on lines
+181
to
+184
| if (i == dev->max_conn_num) { | ||
| error("Failed to add connector-id: %u\n", connector_id); | ||
| return; | ||
| } |
Contributor
There was a problem hiding this comment.
How would this happen? The array is sized to hold all connectors of the device, so this should not ever happen. Seems a bit over-defensive.
|
|
||
| /* | ||
| * Get the global encoder idx first to be able to check for | ||
| * possible clonse later. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
At the moment we miss the support to drive multiple connectors which are connected to the same CRTC, also called a hardware clone mode.
libplatsch is not using the DRM atomic API due to it limited scope therefore using properties values isn't sufficient. Instead all possible connector ids need to be passed during the drmModeSetCrtc().
To find all connectors which belong to the same CRTC, the encoder behind each connector must be validated by making use of the encoders '.possible_clones' array.
If a connector shall be added which belongs to an already used CRTC, a check is performed to see if this connector can be driven by the CRTC. In that case the connector id is added to the 'struct modeset_dev::conn_id' array and -EEXIST is returned.
Because of this error, no new 'struct modeset_dev' is added and certain error() messages aren't printed because this can be a valid use-case.