diff options
author | Anthony Koo <Anthony.Koo@amd.com> | 2019-01-20 01:32:55 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2019-02-06 13:30:59 -0500 |
commit | ff582b61466f14d61f3a2a54c3d673d85bcb3c76 (patch) | |
tree | 40b73210fb2d2ebd5c0fbe83891a24af52c65965 | |
parent | a122b62d8ac484091c536ad04e1d0ea156ae6de7 (diff) |
drm/amd/display: add way to determine if link is active
[Why]
Need to understand whether link is active aside from stream state.
This could be used to check what links are enabled by GOP.
[How]
Store link_active state in link status and initialize it by checking
if the DIG is enabled.
Keep it updated on every link enable and disable
Signed-off-by: Anthony Koo <Anthony.Koo@amd.com>
Reviewed-by: Aric Cyr <Aric.Cyr@amd.com>
Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/core/dc_link.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/dc_link.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 5 |
3 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c index 137d3c126632..e2e7bf2ba84b 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c | |||
@@ -2612,6 +2612,8 @@ void core_link_enable_stream( | |||
2612 | } | 2612 | } |
2613 | } | 2613 | } |
2614 | 2614 | ||
2615 | stream->link->link_status.link_active = true; | ||
2616 | |||
2615 | core_dc->hwss.enable_audio_stream(pipe_ctx); | 2617 | core_dc->hwss.enable_audio_stream(pipe_ctx); |
2616 | 2618 | ||
2617 | /* turn off otg test pattern if enable */ | 2619 | /* turn off otg test pattern if enable */ |
@@ -2646,6 +2648,8 @@ void core_link_disable_stream(struct pipe_ctx *pipe_ctx, int option) | |||
2646 | core_dc->hwss.disable_stream(pipe_ctx, option); | 2648 | core_dc->hwss.disable_stream(pipe_ctx, option); |
2647 | 2649 | ||
2648 | disable_link(pipe_ctx->stream->link, pipe_ctx->stream->signal); | 2650 | disable_link(pipe_ctx->stream->link, pipe_ctx->stream->signal); |
2651 | |||
2652 | pipe_ctx->stream->link->link_status.link_active = false; | ||
2649 | } | 2653 | } |
2650 | 2654 | ||
2651 | void core_link_set_avmute(struct pipe_ctx *pipe_ctx, bool enable) | 2655 | void core_link_set_avmute(struct pipe_ctx *pipe_ctx, bool enable) |
diff --git a/drivers/gpu/drm/amd/display/dc/dc_link.h b/drivers/gpu/drm/amd/display/dc/dc_link.h index d26bbda61ad2..8fc223defed4 100644 --- a/drivers/gpu/drm/amd/display/dc/dc_link.h +++ b/drivers/gpu/drm/amd/display/dc/dc_link.h | |||
@@ -30,6 +30,7 @@ | |||
30 | #include "grph_object_defs.h" | 30 | #include "grph_object_defs.h" |
31 | 31 | ||
32 | struct dc_link_status { | 32 | struct dc_link_status { |
33 | bool link_active; | ||
33 | struct dpcd_caps *dpcd_caps; | 34 | struct dpcd_caps *dpcd_caps; |
34 | }; | 35 | }; |
35 | 36 | ||
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c index 7cead0398c15..7117144d48bd 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | |||
@@ -1027,6 +1027,11 @@ static void dcn10_init_hw(struct dc *dc) | |||
1027 | dc->hwss.edp_power_control(link, true); | 1027 | dc->hwss.edp_power_control(link, true); |
1028 | 1028 | ||
1029 | link->link_enc->funcs->hw_init(link->link_enc); | 1029 | link->link_enc->funcs->hw_init(link->link_enc); |
1030 | |||
1031 | /* Check for enabled DIG to identify enabled display */ | ||
1032 | if (link->link_enc->funcs->is_dig_enabled && | ||
1033 | link->link_enc->funcs->is_dig_enabled(link->link_enc)) | ||
1034 | link->link_status.link_active = true; | ||
1030 | } | 1035 | } |
1031 | } | 1036 | } |
1032 | 1037 | ||