Skip to content

Commit aae74ff

Browse files
AinuxThomas Zimmermann
authored andcommitted
drm/ast: Add detect function support
The existence of the connector cannot be detected, so add the detect function to support. Signed-off-by: Ainux <[email protected]> Signed-off-by: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent c2a6186 commit aae74ff

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

drivers/gpu/drm/ast/ast_mode.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1293,6 +1293,18 @@ static enum drm_mode_status ast_mode_valid(struct drm_connector *connector,
12931293
return flags;
12941294
}
12951295

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+
12961308
static void ast_connector_destroy(struct drm_connector *connector)
12971309
{
12981310
struct ast_connector *ast_connector = to_ast_connector(connector);
@@ -1307,6 +1319,7 @@ static const struct drm_connector_helper_funcs ast_connector_helper_funcs = {
13071319

13081320
static const struct drm_connector_funcs ast_connector_funcs = {
13091321
.reset = drm_atomic_helper_connector_reset,
1322+
.detect = ast_connector_detect,
13101323
.fill_modes = drm_helper_probe_single_connector_modes,
13111324
.destroy = ast_connector_destroy,
13121325
.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
@@ -1334,7 +1347,8 @@ static int ast_connector_init(struct drm_device *dev)
13341347
connector->interlace_allowed = 0;
13351348
connector->doublescan_allowed = 0;
13361349

1337-
connector->polled = DRM_CONNECTOR_POLL_CONNECT;
1350+
connector->polled = DRM_CONNECTOR_POLL_CONNECT |
1351+
DRM_CONNECTOR_POLL_DISCONNECT;
13381352

13391353
drm_connector_attach_encoder(connector, encoder);
13401354

@@ -1403,6 +1417,8 @@ int ast_mode_config_init(struct ast_private *ast)
14031417

14041418
drm_mode_config_reset(dev);
14051419

1420+
drm_kms_helper_poll_init(dev);
1421+
14061422
return 0;
14071423
}
14081424

0 commit comments

Comments
 (0)