diff options
author | 2024-08-15 17:18:44 +0200 | |
---|---|---|
committer | 2024-08-22 09:12:50 +0200 | |
commit | 80431c017f745a818ea45ae6a8373b737f73b1a8 (patch) | |
tree | 4a2dd3fbc516e2244ea76942cb39f6e78b79da45 /drivers/gpu/drm/ast/ast_vga.c | |
parent | drm/ast: Move code for physical outputs into separate files (diff) | |
download | wireguard-linux-80431c017f745a818ea45ae6a8373b737f73b1a8.tar.xz wireguard-linux-80431c017f745a818ea45ae6a8373b737f73b1a8.zip |
drm/ast: Add struct ast_connector
Add struct ast_connector to track a connector's physical status. With
the upcoming BMC support, the physical status can be different from the
reported status.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240815151953.184679-3-tzimmermann@suse.de
Diffstat (limited to '')
-rw-r--r-- | drivers/gpu/drm/ast/ast_vga.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/gpu/drm/ast/ast_vga.c b/drivers/gpu/drm/ast/ast_vga.c index 2ea0763844f3..fdbd0daca7dc 100644 --- a/drivers/gpu/drm/ast/ast_vga.c +++ b/drivers/gpu/drm/ast/ast_vga.c @@ -21,9 +21,23 @@ static const struct drm_encoder_funcs ast_vga_encoder_funcs = { * Connector */ +static int ast_vga_connector_helper_detect_ctx(struct drm_connector *connector, + struct drm_modeset_acquire_ctx *ctx, + bool force) +{ + struct ast_connector *ast_connector = to_ast_connector(connector); + enum drm_connector_status status; + + status = drm_connector_helper_detect_from_ddc(connector, ctx, force); + + ast_connector->physical_status = status; + + return status; +} + static const struct drm_connector_helper_funcs ast_vga_connector_helper_funcs = { .get_modes = drm_connector_helper_get_modes, - .detect_ctx = drm_connector_helper_detect_from_ddc, + .detect_ctx = ast_vga_connector_helper_detect_ctx, }; static const struct drm_connector_funcs ast_vga_connector_funcs = { @@ -67,7 +81,8 @@ int ast_vga_output_init(struct ast_device *ast) struct drm_device *dev = &ast->base; struct drm_crtc *crtc = &ast->crtc; struct drm_encoder *encoder = &ast->output.vga.encoder; - struct drm_connector *connector = &ast->output.vga.connector; + struct ast_connector *ast_connector = &ast->output.vga.connector; + struct drm_connector *connector = &ast_connector->base; int ret; ret = drm_encoder_init(dev, encoder, &ast_vga_encoder_funcs, @@ -79,6 +94,7 @@ int ast_vga_output_init(struct ast_device *ast) ret = ast_vga_connector_init(dev, connector); if (ret) return ret; + ast_connector->physical_status = connector->status; ret = drm_connector_attach_encoder(connector, encoder); if (ret) |