diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2024-08-15 17:18:50 +0200 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2024-08-22 09:13:11 +0200 |
commit | 44a37ba12857c78389cda176c093967406250cfe (patch) | |
tree | 9d774d3ad0057cf974aad63d5593f908187e3467 /drivers/gpu/drm/ast | |
parent | 9e7a74a12101bb07ccc22fb180c5e44051c5a407 (diff) | |
download | linux-stable-44a37ba12857c78389cda176c093967406250cfe.tar.gz linux-stable-44a37ba12857c78389cda176c093967406250cfe.tar.bz2 linux-stable-44a37ba12857c78389cda176c093967406250cfe.zip |
drm/ast: dp501: Transparently handle BMC support
Permanently set the connector status to 'connected'. Return BMC modes
for connector if no display is attached to the physical DP connector.
Otherwise use EDID modes as before.
If the status of the physical connector changes, the driver still
generates a hotplug event. DRM clients will then reconfigure their
output to a mode appropriate for either physical display or BMC.
v3:
- use struct ast_connector.physical_status to handle BMC
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240815151953.184679-9-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/ast')
-rw-r--r-- | drivers/gpu/drm/ast/ast_dp501.c | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/drivers/gpu/drm/ast/ast_dp501.c b/drivers/gpu/drm/ast/ast_dp501.c index 8cc7d20a8999..e4c636f45082 100644 --- a/drivers/gpu/drm/ast/ast_dp501.c +++ b/drivers/gpu/drm/ast/ast_dp501.c @@ -509,14 +509,29 @@ static const struct drm_encoder_helper_funcs ast_dp501_encoder_helper_funcs = { static int ast_dp501_connector_helper_get_modes(struct drm_connector *connector) { - struct ast_device *ast = to_ast_device(connector->dev); - const struct drm_edid *drm_edid; + struct ast_connector *ast_connector = to_ast_connector(connector); int count; - drm_edid = drm_edid_read_custom(connector, ast_dp512_read_edid_block, ast); - drm_edid_connector_update(connector, drm_edid); - count = drm_edid_connector_add_modes(connector); - drm_edid_free(drm_edid); + if (ast_connector->physical_status == connector_status_connected) { + struct ast_device *ast = to_ast_device(connector->dev); + const struct drm_edid *drm_edid; + + drm_edid = drm_edid_read_custom(connector, ast_dp512_read_edid_block, ast); + drm_edid_connector_update(connector, drm_edid); + count = drm_edid_connector_add_modes(connector); + drm_edid_free(drm_edid); + } else { + drm_edid_connector_update(connector, NULL); + + /* + * There's no EDID data without a connected monitor. Set BMC- + * compatible modes in this case. The XGA default resolution + * should work well for all BMCs. + */ + count = drm_add_modes_noedid(connector, 4096, 4096); + if (count) + drm_set_preferred_mode(connector, 1024, 768); + } return count; } @@ -530,11 +545,13 @@ static int ast_dp501_connector_helper_detect_ctx(struct drm_connector *connector enum drm_connector_status status = connector_status_disconnected; if (ast_dp501_is_connected(ast)) - return connector_status_connected; + status = connector_status_connected; + if (status != ast_connector->physical_status) + ++connector->epoch_counter; ast_connector->physical_status = status; - return status; + return connector_status_connected; } static const struct drm_connector_helper_funcs ast_dp501_connector_helper_funcs = { |