Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ff582b61 authored by Anthony Koo's avatar Anthony Koo Committed by Alex Deucher
Browse files

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: default avatarAnthony Koo <Anthony.Koo@amd.com>
Reviewed-by: default avatarAric Cyr <Aric.Cyr@amd.com>
Acked-by: default avatarBhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent a122b62d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2612,6 +2612,8 @@ void core_link_enable_stream(
			}
		}

		stream->link->link_status.link_active = true;

		core_dc->hwss.enable_audio_stream(pipe_ctx);

		/* turn off otg test pattern if enable */
@@ -2646,6 +2648,8 @@ void core_link_disable_stream(struct pipe_ctx *pipe_ctx, int option)
	core_dc->hwss.disable_stream(pipe_ctx, option);

	disable_link(pipe_ctx->stream->link, pipe_ctx->stream->signal);

	pipe_ctx->stream->link->link_status.link_active = false;
}

void core_link_set_avmute(struct pipe_ctx *pipe_ctx, bool enable)
+1 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@
#include "grph_object_defs.h"

struct dc_link_status {
	bool link_active;
	struct dpcd_caps *dpcd_caps;
};

+5 −0
Original line number Diff line number Diff line
@@ -1027,6 +1027,11 @@ static void dcn10_init_hw(struct dc *dc)
				dc->hwss.edp_power_control(link, true);

			link->link_enc->funcs->hw_init(link->link_enc);

			/* Check for enabled DIG to identify enabled display */
			if (link->link_enc->funcs->is_dig_enabled &&
				link->link_enc->funcs->is_dig_enabled(link->link_enc))
				link->link_status.link_active = true;
		}
	}