@@ -1293,6 +1293,18 @@ static enum drm_mode_status ast_mode_valid(struct drm_connector *connector,
1293
1293
return flags ;
1294
1294
}
1295
1295
1296
+ static enum drm_connector_status ast_connector_detect (struct drm_connector
1297
+ * connector , bool force )
1298
+ {
1299
+ int r ;
1300
+
1301
+ r = ast_get_modes (connector );
1302
+ if (r < 0 )
1303
+ return connector_status_disconnected ;
1304
+
1305
+ return connector_status_connected ;
1306
+ }
1307
+
1296
1308
static void ast_connector_destroy (struct drm_connector * connector )
1297
1309
{
1298
1310
struct ast_connector * ast_connector = to_ast_connector (connector );
@@ -1307,6 +1319,7 @@ static const struct drm_connector_helper_funcs ast_connector_helper_funcs = {
1307
1319
1308
1320
static const struct drm_connector_funcs ast_connector_funcs = {
1309
1321
.reset = drm_atomic_helper_connector_reset ,
1322
+ .detect = ast_connector_detect ,
1310
1323
.fill_modes = drm_helper_probe_single_connector_modes ,
1311
1324
.destroy = ast_connector_destroy ,
1312
1325
.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state ,
@@ -1334,7 +1347,8 @@ static int ast_connector_init(struct drm_device *dev)
1334
1347
connector -> interlace_allowed = 0 ;
1335
1348
connector -> doublescan_allowed = 0 ;
1336
1349
1337
- connector -> polled = DRM_CONNECTOR_POLL_CONNECT ;
1350
+ connector -> polled = DRM_CONNECTOR_POLL_CONNECT |
1351
+ DRM_CONNECTOR_POLL_DISCONNECT ;
1338
1352
1339
1353
drm_connector_attach_encoder (connector , encoder );
1340
1354
@@ -1403,6 +1417,8 @@ int ast_mode_config_init(struct ast_private *ast)
1403
1417
1404
1418
drm_mode_config_reset (dev );
1405
1419
1420
+ drm_kms_helper_poll_init (dev );
1421
+
1406
1422
return 0 ;
1407
1423
}
1408
1424
0 commit comments