@@ -38,6 +38,7 @@ AMDGPUDM = \
amdgpu_dm_pp_smu.o \
amdgpu_dm_psr.o \
amdgpu_dm_replay.o \
+ dc_edid.o \
amdgpu_dm_wb.o
ifdef CONFIG_DRM_AMD_DC_FP
new file mode 100644
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: MIT
+#include "amdgpu_dm/dc_edid.h"
+#include "dc.h"
+
+bool dc_edid_is_same_edid(struct dc_sink *prev_sink,
+ struct dc_sink *current_sink)
+{
+ struct dc_edid *old_edid = &prev_sink->dc_edid;
+ struct dc_edid *new_edid = ¤t_sink->dc_edid;
+
+ if (old_edid->length != new_edid->length)
+ return false;
+
+ if (new_edid->length == 0)
+ return false;
+
+ return (memcmp(old_edid->raw_edid,
+ new_edid->raw_edid, new_edid->length) == 0);
+}
new file mode 100644
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: MIT */
+
+#ifndef __DC_EDID_H__
+#define __DC_EDID_H__
+
+#include "dc.h"
+
+bool dc_edid_is_same_edid(struct dc_sink *prev_sink,
+ struct dc_sink *current_sink);
+
+#endif /* __DC_EDID_H__ */
@@ -48,6 +48,8 @@
#include "dm_helpers.h"
#include "clk_mgr.h"
+#include "dc_edid.h"
+
// Offset DPCD 050Eh == 0x5A
#define MST_HUB_ID_0x5A 0x5A
@@ -616,18 +618,6 @@ static bool detect_dp(struct dc_link *link,
return true;
}
-static bool is_same_edid(struct dc_edid *old_edid, struct dc_edid *new_edid)
-{
- if (old_edid->length != new_edid->length)
- return false;
-
- if (new_edid->length == 0)
- return false;
-
- return (memcmp(old_edid->raw_edid,
- new_edid->raw_edid, new_edid->length) == 0);
-}
-
static bool wait_for_entering_dp_alt_mode(struct dc_link *link)
{
@@ -1114,8 +1104,7 @@ static bool detect_link_and_local_sink(struct dc_link *link,
// Check if edid is the same
if ((prev_sink) &&
(edid_status == EDID_THE_SAME || edid_status == EDID_OK))
- same_edid = is_same_edid(&prev_sink->dc_edid,
- &sink->dc_edid);
+ same_edid = dc_edid_is_same_edid(prev_sink, sink);
if (sink->edid_caps.panel_patch.skip_scdc_overwrite)
link->ctx->dc->debug.hdmi20_disable = true;