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:29:09 -0500
commit871a9cff032e8802684a66eaa8a7b7bcc50f6947 (patch)
treeef6b26b7fa494600e65a6cd3010d238563385bfb
parenta43fda4ddc3cb3367e300b7fe2be2b20eac07073 (diff)
ecore_drm2: Fix a condition where no outputs are enabled
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
234 uint32_t crtc; 234 uint32_t crtc;
235 int i = 0, j = 0; 235 int i = 0, j = 0;
236 236
237 /* Skip all disconnected connectors...
238 *
239 * When a connector is disconnected it still has an encoder id
240 * which messes up our output selection code later. When we support
241 * multi-head properly and hotplug becomes a real thing we'll
242 * need to revisit this hack (and the crtc assignment code as well)
243 */
244 if (conn->connection != DRM_MODE_CONNECTED) return -1;
245
237 for (j = 0; j < conn->count_encoders; j++) 246 for (j = 0; j < conn->count_encoders; j++)
238 { 247 {
239 enc = drmModeGetEncoder(dev->fd, conn->encoders[j]); 248 enc = drmModeGetEncoder(dev->fd, conn->encoders[j]);