Skip to content

Commit

Permalink
drm/ast: Add detect function support
Browse files Browse the repository at this point in the history
The existence of the connector cannot be detected,
so add the detect function to support.

Signed-off-by: Ainux <ainux.wang@gmail.com>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20210526111515.40015-1-ainux.wang@gmail.com
  • Loading branch information
Ainux authored and Thomas Zimmermann committed Jun 15, 2021
1 parent c2a6186 commit aae74ff
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion drivers/gpu/drm/ast/ast_mode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1293,6 +1293,18 @@ static enum drm_mode_status ast_mode_valid(struct drm_connector *connector,
return flags;
}

static enum drm_connector_status ast_connector_detect(struct drm_connector
*connector, bool force)
{
int r;

r = ast_get_modes(connector);
if (r < 0)
return connector_status_disconnected;

return connector_status_connected;
}

static void ast_connector_destroy(struct drm_connector *connector)
{
struct ast_connector *ast_connector = to_ast_connector(connector);
Expand All @@ -1307,6 +1319,7 @@ static const struct drm_connector_helper_funcs ast_connector_helper_funcs = {

static const struct drm_connector_funcs ast_connector_funcs = {
.reset = drm_atomic_helper_connector_reset,
.detect = ast_connector_detect,
.fill_modes = drm_helper_probe_single_connector_modes,
.destroy = ast_connector_destroy,
.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
Expand Down Expand Up @@ -1334,7 +1347,8 @@ static int ast_connector_init(struct drm_device *dev)
connector->interlace_allowed = 0;
connector->doublescan_allowed = 0;

connector->polled = DRM_CONNECTOR_POLL_CONNECT;
connector->polled = DRM_CONNECTOR_POLL_CONNECT |
DRM_CONNECTOR_POLL_DISCONNECT;

drm_connector_attach_encoder(connector, encoder);

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

drm_mode_config_reset(dev);

drm_kms_helper_poll_init(dev);

return 0;
}

Expand Down

0 comments on commit aae74ff

Please sign in to comment.