drmModeConnectorPtr connector;
drmModeEncoderPtr encoder;
int conn_idx = -1;
+ int hdmia_idx = -1, hdmib_idx = -1;
int crtc_id = 0, c, j;
RETURN_VAL_IF_FAIL(LIST_IS_EMPTY(&nexell_data->output_list),
drmModeFreeConnector(connector);
break;
}
+
+ if (connector->connector_type == DRM_MODE_CONNECTOR_HDMIA)
+ hdmia_idx = i;
+ if (connector->connector_type == DRM_MODE_CONNECTOR_HDMIB)
+ hdmib_idx = i;
+
drmModeFreeConnector(connector);
}
- /* use the first connecoct_id if there is not connector which is connected */
- if (conn_idx == -1)
- conn_idx = 0;
+ /* use the hdmi connector if there is no connected connector. */
+ /* if there is no hdmi connector, use first connector. */
+ if (conn_idx == -1) {
+ if (hdmia_idx != -1)
+ conn_idx = hdmia_idx;
+ else if (hdmib_idx != -1)
+ conn_idx = hdmib_idx;
+ else
+ conn_idx = 0;
+ }
/* The TDM drm backend considers only 1 connector because it is the TDM
* reference backend and can't take care of all hardware devices.