summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2016-08-02 13:24:40 -0500
committerDerek Foreman <derekf@osg.samsung.com>2016-08-02 13:24:40 -0500
commit4cc01196681b862e4ff4164fd50399c0c215490f (patch)
treeef6b26b7fa494600e65a6cd3010d238563385bfb
parenta43fda4ddc3cb3367e300b7fe2be2b20eac07073 (diff)
downloadefl-devs/derekf/output.tar.gz
ecore_drm2: Fix a condition where no outputs are enableddevs/derekf/output
If the first output we test is disconnected but has the crtc of the primary display assigned then we'll fail to assign the crtc to the connector it's really connected to later. This is a quick hack as trying to sort this out properly may be too invasive for the upcoming 1.18 and isn't really important until 1.19 supports multihead anyway.
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_outputs.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c b/src/lib/ecore_drm2/ecore_drm2_outputs.c
index 6fe2180b68..a48170ca97 100644
--- a/src/lib/ecore_drm2/ecore_drm2_outputs.c
+++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c
@@ -234,6 +234,15 @@ _output_crtc_find(const drmModeRes *res, const drmModeConnector *conn, Ecore_Drm
uint32_t crtc;
int i = 0, j = 0;
+ /* Skip all disconnected connectors...
+ *
+ * When a connector is disconnected it still has an encoder id
+ * which messes up our output selection code later. When we support
+ * multi-head properly and hotplug becomes a real thing we'll
+ * need to revisit this hack (and the crtc assignment code as well)
+ */
+ if (conn->connection != DRM_MODE_CONNECTED) return -1;
+
for (j = 0; j < conn->count_encoders; j++)
{
enc = drmModeGetEncoder(dev->fd, conn->encoders[j]);