* Re: linux-next: manual merge of the amdgpu tree with the drm-misc,drm-fixes tree
2026-09-11 13:25 linux-next: manual merge of the amdgpu tree with the drm-misc,drm-fixes tree Mark Brown
@ 2026-09-11 15:09 ` Mark Brown
2026-09-14 23:08 ` Nathan Chancellor
1 sibling, 0 replies; 5+ messages in thread
From: Mark Brown @ 2026-09-11 15:09 UTC (permalink / raw)
To: Alex Deucher
Cc: Alex Deucher, Alex Huang, Alex Hung, Alvin Lee,
Arunpravin Paneer Selvam, Bhawanpreet Lakha, Dillon Varone,
Dr. David Alan Gilbert, Fangzhi Zuo, Feifei Xu, Harry Wentland,
Ivan Lipski, James Lin, Linux Kernel Mailing List,
Linux Next Mailing List, Maarten Lankhorst, Mario Limonciello,
Michel Dänzer, Ray Wu, Rodrigo Vivi, Satyajit Roy,
Thomas Hellström, Timur Kristóf, Tomasz Pakuła,
Tom Chung, Wenjing Liu, YiPeng Chai
[-- Attachment #1: Type: text/plain, Size: 12303 bytes --]
On Fri, Sep 11, 2026 at 02:25:38PM +0100, Mark Brown wrote:
> Hi all,
>
> Today's linux-next merge of the amdgpu tree got conflicts in:
>
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.h
> drivers/gpu/drm/amd/display/dc/clk_mgr/dcn60/dcn60_clk_mgr.c
*sigh* This isn't the right fixup in a similar way to what happened
earlier this week. In this case it looks like whatever you are doing
has massively confused git too, there's horrible messes in files that
didn't show up as needing merge resolutions. I've done something that
builds but I'm confident it doesn't work, especially given that it's
layered on top of the cleanup of the earlier fallout which I'm also
confident didn't work.
Please, could you have a look at your processes so that you are not
continually introducing noisy conflicts with your own work so that when
there is an actual conflict like seems to be happening here it's
actually visible when doing the resolution rather than showing up as
build failures like this.
One thing that would be very helpful if you have a super invasive change
would be to actively merge up branches that conflict so they're not so
visible externally, this looks a lot like something we went through the
entire last release cycle with *huge* conflicts caused by splitting up a
big file needing to be redone every time either your fixes or new work
touched that file, when there's a change in a conflict I have to redo
the whole merge.
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 2db5fd0e72d16..0c19188df3755 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -2941,7 +2941,7 @@ STATIC_IFN_KUNIT bool modereset_required(struct drm_crtc_state *crtc_state)
EXPORT_IF_KUNIT(modereset_required);
STATIC_IFN_KUNIT int
-fill_plane_color_attributes(struct drm_atomic_commit *state,
+fill_plane_color_attributes(const struct drm_atomic_commit *state,
const struct drm_plane_state *plane_state,
const enum surface_pixel_format format,
enum dc_color_space *color_space)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
index 27753bf50b706..256d2c0e5fba3 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
@@ -1242,7 +1242,8 @@ bool update_planes_and_stream_adapter(struct dc *dc,
struct dc_stream_state *stream,
struct dc_stream_update *stream_update,
struct dc_surface_update *array_of_surface_update);
-int fill_plane_color_attributes(const struct drm_plane_state *plane_state,
+int fill_plane_color_attributes(const struct drm_atomic_commit *state,
+ const struct drm_plane_state *plane_state,
const enum surface_pixel_format format,
enum dc_color_space *color_space);
bool modereset_required(struct drm_crtc_state *crtc_state);
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
index d3d362a99674e..d76ebf145dfc3 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
@@ -3666,42 +3666,6 @@ STATIC_IFN_KUNIT bool parse_edid_cea_dmcu(struct amdgpu_display_manager *dm,
u8 *edid_ext, int len,
struct amdgpu_hdmi_vsdb_info *vsdb_info)
{
- int i;
-
- /* send extension block to DMCU for parsing */
- for (i = 0; i < len; i += 8) {
- bool res;
- int offset;
-
- /* send 8 bytes a time */
- if (!dc_edid_parser_send_cea(dm->dc, i, len, &edid_ext[i], 8))
- return false;
-
- if (i+8 == len) {
- /* EDID block sent completed, expect result */
- int version, min_rate, max_rate;
-
- res = dc_edid_parser_recv_amd_vsdb(dm->dc, &version, &min_rate, &max_rate);
- if (res) {
- /* amd vsdb found */
- vsdb_info->freesync_supported = 1;
- vsdb_info->amd_vsdb_version = version;
- vsdb_info->min_refresh_rate_hz = min_rate;
- vsdb_info->max_refresh_rate_hz = max_rate;
- /* Not enabled on DMCU*/
- vsdb_info->freesync_mccs_vcp_code = 0;
- return true;
- }
- /* not amd vsdb */
- return false;
- }
-
- /* check for ack*/
- res = dc_edid_parser_recv_cea_ack(dm->dc, &offset);
- if (!res)
- return false;
- }
-
return false;
}
EXPORT_IF_KUNIT(parse_edid_cea_dmcu);
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_connector_test.c b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_connector_test.c
index 8107be27d324e..19ead11b5e73c 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_connector_test.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_connector_test.c
@@ -6140,57 +6140,16 @@ static bool dm_test_dmcu_is_init(struct dmcu *dmcu)
return true;
}
-static bool dm_test_dmcu_send_cea(struct dmcu *dmcu, int offset,
- int total_length, u8 *data, int length)
-{
- return true;
-}
-
-static bool dm_test_dmcu_recv_ack_ok(struct dmcu *dmcu, int *offset)
-{
- *offset = 0;
- return true;
-}
-
-static bool dm_test_dmcu_recv_ack_fail(struct dmcu *dmcu, int *offset)
-{
- return false;
-}
-
-static bool dm_test_dmcu_recv_vsdb_found(struct dmcu *dmcu, int *version,
- int *min_frame_rate, int *max_frame_rate)
-{
- *version = 2;
- *min_frame_rate = 24;
- *max_frame_rate = 60;
- return true;
-}
-
-static bool dm_test_dmcu_recv_vsdb_none(struct dmcu *dmcu, int *version,
- int *min_frame_rate, int *max_frame_rate)
-{
- return false;
-}
-
static const struct dmcu_funcs dm_test_dmcu_funcs_vsdb = {
.is_dmcu_initialized = dm_test_dmcu_is_init,
- .send_edid_cea = dm_test_dmcu_send_cea,
- .recv_edid_cea_ack = dm_test_dmcu_recv_ack_ok,
- .recv_amd_vsdb = dm_test_dmcu_recv_vsdb_found,
};
static const struct dmcu_funcs dm_test_dmcu_funcs_novsdb = {
.is_dmcu_initialized = dm_test_dmcu_is_init,
- .send_edid_cea = dm_test_dmcu_send_cea,
- .recv_edid_cea_ack = dm_test_dmcu_recv_ack_ok,
- .recv_amd_vsdb = dm_test_dmcu_recv_vsdb_none,
};
static const struct dmcu_funcs dm_test_dmcu_funcs_ackfail = {
.is_dmcu_initialized = dm_test_dmcu_is_init,
- .send_edid_cea = dm_test_dmcu_send_cea,
- .recv_edid_cea_ack = dm_test_dmcu_recv_ack_fail,
- .recv_amd_vsdb = dm_test_dmcu_recv_vsdb_none,
};
/*
@@ -6295,37 +6254,6 @@ static void dm_test_parse_cea_dmcu_empty(struct kunit *test)
*/
static void dm_test_parse_cea_dmcu_no_dmcu(struct kunit *test)
{
- struct amdgpu_display_manager *dm = dm_test_alloc_dm_dmcu(test, NULL);
- struct amdgpu_hdmi_vsdb_info vsdb = {0};
- u8 ext[DMUB_EDID_CEA_DATA_CHUNK_BYTES] = {0};
- bool ret;
-
- /* res_pool->dmcu is NULL, so the CEA send returns false. */
- ret = parse_edid_cea_dmcu(dm, ext, DMUB_EDID_CEA_DATA_CHUNK_BYTES,
- &vsdb);
- KUNIT_EXPECT_FALSE(test, ret);
-}
-
-/**
- * dm_test_parse_cea_dmcu_vsdb_found - Test the DMCU reports an AMD VSDB
- * @test: KUnit test context
- */
-static void dm_test_parse_cea_dmcu_vsdb_found(struct kunit *test)
-{
- struct amdgpu_display_manager *dm =
- dm_test_alloc_dm_dmcu(test, &dm_test_dmcu_funcs_vsdb);
- struct amdgpu_hdmi_vsdb_info vsdb = {0};
- u8 ext[DMUB_EDID_CEA_DATA_CHUNK_BYTES] = {0};
- bool ret;
-
- ret = parse_edid_cea_dmcu(dm, ext, DMUB_EDID_CEA_DATA_CHUNK_BYTES,
- &vsdb);
- KUNIT_EXPECT_TRUE(test, ret);
- KUNIT_EXPECT_TRUE(test, vsdb.freesync_supported);
- KUNIT_EXPECT_EQ(test, vsdb.amd_vsdb_version, 2);
- KUNIT_EXPECT_EQ(test, vsdb.min_refresh_rate_hz, 24);
- KUNIT_EXPECT_EQ(test, vsdb.max_refresh_rate_hz, 60);
- KUNIT_EXPECT_EQ(test, vsdb.freesync_mccs_vcp_code, 0);
}
/**
@@ -9159,7 +9087,6 @@ static struct kunit_case amdgpu_dm_connector_tests[] = {
KUNIT_CASE(dm_test_send_cea_dmub_unavailable),
KUNIT_CASE(dm_test_parse_cea_dmcu_empty),
KUNIT_CASE(dm_test_parse_cea_dmcu_no_dmcu),
- KUNIT_CASE(dm_test_parse_cea_dmcu_vsdb_found),
KUNIT_CASE(dm_test_parse_cea_dmcu_vsdb_none),
KUNIT_CASE(dm_test_parse_cea_dmcu_multi_chunk),
KUNIT_CASE(dm_test_parse_cea_dmcu_ack_fail),
diff --git a/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h b/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
index 45385f9eb8932..58826291827b1 100644
--- a/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
+++ b/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
@@ -1957,6 +1957,10 @@ enum dmub_cmd_type {
* Command type used for interfacing with DPIA.
*/
DMUB_CMD__DPIA = 77,
+ /**
+ * Command type used for EDID CEA parsing
+ */
+ DMUB_CMD__EDID_CEA = 79,
/**
* Command type used for getting usbc cable ID
*/
@@ -6926,6 +6930,72 @@ struct dmub_rb_cmd_transmitter_set_phy_fsm {
struct dmub_rb_cmd_transmitter_set_phy_fsm_data data; /**< payload */
};
+/**
+ * Maximum number of bytes a chunk sent to DMUB for parsing
+ */
+#define DMUB_EDID_CEA_DATA_CHUNK_BYTES 8
+
+/**
+ * Represent a chunk of CEA blocks sent to DMUB for parsing
+ */
+struct dmub_cmd_send_edid_cea {
+ uint16_t offset; /**< offset into the CEA block */
+ uint8_t length; /**< number of bytes in payload to copy as part of CEA block */
+ uint16_t cea_total_length; /**< total length of the CEA block */
+ uint8_t payload[DMUB_EDID_CEA_DATA_CHUNK_BYTES]; /**< data chunk of the CEA block */
+ uint8_t pad[3]; /**< padding and for future expansion */
+};
+
+/**
+ * Result of VSDB parsing from CEA block
+ */
+struct dmub_cmd_edid_cea_amd_vsdb {
+ uint8_t vsdb_found; /**< 1 if parsing has found valid AMD VS
+DB */
+ uint8_t freesync_supported; /**< 1 if Freesync is supported */
+ uint16_t amd_vsdb_version; /**< AMD VSDB version */
+ uint16_t min_frame_rate; /**< Maximum frame rate */
+ uint16_t max_frame_rate; /**< Minimum frame rate */
+ uint8_t freesync_mccs_vcp_code; /**< Freesync MCCS VCP code */
+};
+
+/**
+ * Result of sending a CEA chunk
+ */
+struct dmub_cmd_edid_cea_ack {
+ uint16_t offset; /**< offset of the chunk into the CEA block */
+ uint8_t success; /**< 1 if this sending of chunk succeeded */
+ uint8_t pad; /**< padding and for future expansion */
+};
+
+/**
+ * Specify whether the result is an ACK/NACK or the parsing has finished
+ */
+enum dmub_cmd_edid_cea_reply_type {
+ DMUB_CMD__EDID_CEA_AMD_VSDB = 1, /**< VSDB parsing has finished */
+ DMUB_CMD__EDID_CEA_ACK = 2, /**< acknowledges the CEA sending i
+s OK or failing */
+};
+
+/**
+ * Definition of a DMUB_CMD__EDID_CEA command.
+ */
+struct dmub_rb_cmd_edid_cea {
+ struct dmub_cmd_header header; /**< Command header */
+ union dmub_cmd_edid_cea_data {
+ struct dmub_cmd_send_edid_cea input; /**< input to send CEA chun
+ks */
+ struct dmub_cmd_edid_cea_output { /**< output with results */
+ uint8_t type; /**< dmub_cmd_edid_cea_reply_type */
+ union {
+ struct dmub_cmd_edid_cea_amd_vsdb amd_vsdb;
+ struct dmub_cmd_edid_cea_ack ack;
+ };
+ } output; /**< output to retrieve ACK/NACK or VSDB parsing results */
+ } data; /**< Command data */
+
+};
+
/**
* struct dmub_cmd_cable_id_input - Defines the input of DMUB_CMD_GET_USBC_CABLE_ID command.
*/
@@ -7797,6 +7867,12 @@ union dmub_rb_cmd {
* Definition of a DMUB_CMD__DPIA_SET_TPS_NOTIFICATION command.
*/
struct dmub_rb_cmd_set_tps_notification set_tps_notification;
+
+ /**
+ * Definition of a DMUB_CMD__EDID_CEA command.
+ */
+ struct dmub_rb_cmd_edid_cea edid_cea;
+
/**
* Definition of a DMUB_CMD_GET_USBC_CABLE_ID command.
*/
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: linux-next: manual merge of the amdgpu tree with the drm-misc,drm-fixes tree
2026-09-11 13:25 linux-next: manual merge of the amdgpu tree with the drm-misc,drm-fixes tree Mark Brown
2026-09-11 15:09 ` Mark Brown
@ 2026-09-14 23:08 ` Nathan Chancellor
2026-09-14 23:19 ` Mark Brown
2026-09-15 16:39 ` Mark Brown
1 sibling, 2 replies; 5+ messages in thread
From: Nathan Chancellor @ 2026-09-14 23:08 UTC (permalink / raw)
To: Mark Brown, Alex Deucher, Mario Limonciello
Cc: Alex Deucher, Alex Huang, Alex Hung, Alvin Lee,
Arunpravin Paneer Selvam, Bhawanpreet Lakha, Dillon Varone,
Dr. David Alan Gilbert, Fangzhi Zuo, Feifei Xu, Harry Wentland,
Ivan Lipski, James Lin, Linux Kernel Mailing List,
Linux Next Mailing List, Maarten Lankhorst, Michel Dänzer,
Ray Wu, Rodrigo Vivi, Satyajit Roy, Thomas Hellström,
Timur Kristóf, Tomasz Pakuła, Tom Chung, Wenjing Liu,
YiPeng Chai
Hi AMD folks,
On Fri, Sep 11, 2026 at 02:25:38PM +0100, Mark Brown wrote:
> Today's linux-next merge of the amdgpu tree got conflicts in:
>
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
>
> between commits:
>
> f65198b3d0738 ("drm/amd/display: Use HDMI FreeSync range from common EDID parser")
>
> from the drm-misc,drm-fixes tree and commits:
>
> 0412b1064a3bd ("drm/amd/display: Cover EDID CEA parsing helpers")
>
> from the amdgpu tree.
I (and KernelCI [1][2]) are seeing a build breakage from a conflict
between these two changes in -next, which can be easily reproduced when
the KUnit tests are disabled.
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_connector.c:3690:23: error: 'parse_edid_cea' defined but not used [-Werror=unused-function]
3690 | STATIC_IFN_KUNIT bool parse_edid_cea(struct amdgpu_dm_connector *aconnector,
| ^~~~~~~~~~~~~~
f65198b3d0738 removed the use of parse_edid_cea() in
amdgpu_dm_connector.c but it looks like Mark put these functions back
into place to keep everything building and working for 0412b1064a3bd
when the two are merged together.
Given f65198b3d0738, it seems like 0412b1064a3bd is pointless and could
be reverted entirely to try and avoid this conflict altogether? I tested
the following diff and it seems to build cleanly for me.
[1]: https://lore.kernel.org/178914594745.4423.13336797159691042320@kernelci.org/
[2]: https://lore.kernel.org/178914594374.4423.11399857311284391817@kernelci.org/
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
index d76ebf145dfc..37d1508d656b 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
@@ -3603,107 +3603,6 @@ void dm_restore_drm_connector_state(struct drm_device *dev,
}
EXPORT_IF_KUNIT(dm_restore_drm_connector_state);
-STATIC_IFN_KUNIT bool dm_edid_parser_send_cea(struct amdgpu_display_manager *dm,
- unsigned int offset,
- unsigned int total_length,
- u8 *data,
- unsigned int length,
- struct amdgpu_hdmi_vsdb_info *vsdb)
-{
- bool res;
- union dmub_rb_cmd cmd;
- struct dmub_cmd_send_edid_cea *input;
- struct dmub_cmd_edid_cea_output *output;
-
- if (length > DMUB_EDID_CEA_DATA_CHUNK_BYTES)
- return false;
-
- memset(&cmd, 0, sizeof(cmd));
-
- input = &cmd.edid_cea.data.input;
-
- cmd.edid_cea.header.type = DMUB_CMD__EDID_CEA;
- cmd.edid_cea.header.sub_type = 0;
- cmd.edid_cea.header.payload_bytes =
- sizeof(cmd.edid_cea) - sizeof(cmd.edid_cea.header);
- input->offset = offset;
- input->length = length;
- input->cea_total_length = total_length;
- memcpy(input->payload, data, length);
-
- res = dc_wake_and_execute_dmub_cmd(dm->dc->ctx, &cmd, DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY);
- if (!res) {
- drm_err(adev_to_drm(dm->adev), "EDID CEA parser failed\n");
- return false;
- }
-
- output = &cmd.edid_cea.data.output;
-
- if (output->type == DMUB_CMD__EDID_CEA_ACK) {
- if (!output->ack.success) {
- drm_err(adev_to_drm(dm->adev), "EDID CEA ack failed at offset %d\n",
- output->ack.offset);
- }
- } else if (output->type == DMUB_CMD__EDID_CEA_AMD_VSDB) {
- if (!output->amd_vsdb.vsdb_found)
- return false;
-
- vsdb->freesync_supported = output->amd_vsdb.freesync_supported;
- vsdb->amd_vsdb_version = output->amd_vsdb.amd_vsdb_version;
- vsdb->min_refresh_rate_hz = output->amd_vsdb.min_frame_rate;
- vsdb->max_refresh_rate_hz = output->amd_vsdb.max_frame_rate;
- vsdb->freesync_mccs_vcp_code = output->amd_vsdb.freesync_mccs_vcp_code;
- } else {
- drm_warn(adev_to_drm(dm->adev), "Unknown EDID CEA parser results\n");
- return false;
- }
-
- return true;
-}
-EXPORT_IF_KUNIT(dm_edid_parser_send_cea);
-
-STATIC_IFN_KUNIT bool parse_edid_cea_dmcu(struct amdgpu_display_manager *dm,
- u8 *edid_ext, int len,
- struct amdgpu_hdmi_vsdb_info *vsdb_info)
-{
- return false;
-}
-EXPORT_IF_KUNIT(parse_edid_cea_dmcu);
-
-STATIC_IFN_KUNIT bool parse_edid_cea_dmub(struct amdgpu_display_manager *dm,
- u8 *edid_ext, int len,
- struct amdgpu_hdmi_vsdb_info *vsdb_info)
-{
- int i;
-
- /* send extension block to DMCU for parsing */
- for (i = 0; i < len; i += 8) {
- /* send 8 bytes a time */
- if (!dm_edid_parser_send_cea(dm, i, len, &edid_ext[i], 8, vsdb_info))
- return false;
- }
-
- return vsdb_info->freesync_supported;
-}
-EXPORT_IF_KUNIT(parse_edid_cea_dmub);
-
-STATIC_IFN_KUNIT bool parse_edid_cea(struct amdgpu_dm_connector *aconnector,
- u8 *edid_ext, int len,
- struct amdgpu_hdmi_vsdb_info *vsdb_info)
-{
- struct amdgpu_device *adev = drm_to_adev(aconnector->base.dev);
- bool ret;
-
- mutex_lock(&adev->dm.dc_lock);
- if (adev->dm.dmub_srv)
- ret = parse_edid_cea_dmub(&adev->dm, edid_ext, len, vsdb_info);
- else
- ret = parse_edid_cea_dmcu(&adev->dm, edid_ext, len, vsdb_info);
- mutex_unlock(&adev->dm.dc_lock);
- return ret;
-}
-EXPORT_IF_KUNIT(parse_edid_cea);
-
STATIC_IFN_KUNIT void parse_edid_displayid_vrr(struct drm_connector *connector,
const struct edid *edid)
{
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.h
index e42a0d53b549..6732e5e644cd 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.h
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.h
@@ -158,16 +158,6 @@ int get_amd_vsdb(struct amdgpu_dm_connector *aconnector,
int parse_hdmi_amd_vsdb(struct amdgpu_dm_connector *aconnector,
const struct edid *edid,
struct amdgpu_hdmi_vsdb_info *vsdb_info);
-bool dm_edid_parser_send_cea(struct amdgpu_display_manager *dm,
- unsigned int offset, unsigned int total_length,
- u8 *data, unsigned int length,
- struct amdgpu_hdmi_vsdb_info *vsdb);
-bool parse_edid_cea_dmcu(struct amdgpu_display_manager *dm, u8 *edid_ext,
- int len, struct amdgpu_hdmi_vsdb_info *vsdb_info);
-bool parse_edid_cea_dmub(struct amdgpu_display_manager *dm, u8 *edid_ext,
- int len, struct amdgpu_hdmi_vsdb_info *vsdb_info);
-bool parse_edid_cea(struct amdgpu_dm_connector *aconnector, u8 *edid_ext,
- int len, struct amdgpu_hdmi_vsdb_info *vsdb_info);
void amdgpu_dm_connector_funcs_force(struct drm_connector *connector);
enum dc_status dm_validate_stream_and_context(struct dc *dc,
struct dc_stream_state *stream);
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_connector_test.c b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_connector_test.c
index 19ead11b5e73..7b6400ec8107 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_connector_test.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_connector_test.c
@@ -6134,259 +6134,6 @@ static void dm_test_restore_state_same_sink(struct kunit *test)
KUNIT_EXPECT_PTR_EQ(test, stream->sink, aconnector->dc_sink);
}
-/* Mock DMCU plumbing for parse_edid_cea_dmcu() tests. */
-static bool dm_test_dmcu_is_init(struct dmcu *dmcu)
-{
- return true;
-}
-
-static const struct dmcu_funcs dm_test_dmcu_funcs_vsdb = {
- .is_dmcu_initialized = dm_test_dmcu_is_init,
-};
-
-static const struct dmcu_funcs dm_test_dmcu_funcs_novsdb = {
- .is_dmcu_initialized = dm_test_dmcu_is_init,
-};
-
-static const struct dmcu_funcs dm_test_dmcu_funcs_ackfail = {
- .is_dmcu_initialized = dm_test_dmcu_is_init,
-};
-
-/*
- * Build a bare display manager carrying a dc with a resource pool whose DMCU
- * uses the supplied funcs table (or no DMCU at all when @funcs is NULL). The
- * DMCU CEA parser path only touches dm->dc->res_pool->dmcu, so no adev/ctx is
- * required.
- */
-static struct amdgpu_display_manager *
-dm_test_alloc_dm_dmcu(struct kunit *test, const struct dmcu_funcs *funcs)
-{
- struct amdgpu_display_manager *dm;
- struct resource_pool *pool;
- struct dmcu *dmcu = NULL;
- struct dc *dc;
-
- dm = kunit_kzalloc(test, sizeof(*dm), GFP_KERNEL);
- KUNIT_ASSERT_NOT_NULL(test, dm);
- dc = kunit_kzalloc(test, sizeof(*dc), GFP_KERNEL);
- KUNIT_ASSERT_NOT_NULL(test, dc);
- pool = kunit_kzalloc(test, sizeof(*pool), GFP_KERNEL);
- KUNIT_ASSERT_NOT_NULL(test, pool);
-
- if (funcs) {
- dmcu = kunit_kzalloc(test, sizeof(*dmcu), GFP_KERNEL);
- KUNIT_ASSERT_NOT_NULL(test, dmcu);
- dmcu->funcs = funcs;
- }
-
- pool->dmcu = dmcu;
- dc->res_pool = pool;
- dm->dc = dc;
- return dm;
-}
-
-/*
- * Build a display manager backed by an amdgpu_device and a dc with a ctx (but
- * no DMUB), so the DMUB CEA send path can build a command, fail the execute,
- * and log via drm_err() safely.
- */
-static struct amdgpu_display_manager *dm_test_alloc_dm_adev(struct kunit *test)
-{
- struct amdgpu_device *adev = dm_kunit_alloc_adev(test);
- struct dc *dc = dm_kunit_alloc_dc_with_ctx(test);
-
- KUNIT_ASSERT_NOT_NULL(test, adev);
- KUNIT_ASSERT_NOT_NULL(test, dc);
- adev->dm.adev = adev;
- adev->dm.dc = dc;
- return &adev->dm;
-}
-
-/**
- * dm_test_send_cea_length_too_long - Test an oversized chunk is rejected
- * @test: KUnit test context
- */
-static void dm_test_send_cea_length_too_long(struct kunit *test)
-{
- struct amdgpu_display_manager *dm = dm_test_alloc_dm_adev(test);
- struct amdgpu_hdmi_vsdb_info vsdb = {0};
- u8 data[16] = {0};
- bool ret;
-
- ret = dm_edid_parser_send_cea(dm, 0, 128, data,
- DMUB_EDID_CEA_DATA_CHUNK_BYTES + 1, &vsdb);
- KUNIT_EXPECT_FALSE(test, ret);
-}
-
-/**
- * dm_test_send_cea_dmub_unavailable - Test a failed DMUB command reports false
- * @test: KUnit test context
- */
-static void dm_test_send_cea_dmub_unavailable(struct kunit *test)
-{
- struct amdgpu_display_manager *dm = dm_test_alloc_dm_adev(test);
- struct amdgpu_hdmi_vsdb_info vsdb = {0};
- u8 data[DMUB_EDID_CEA_DATA_CHUNK_BYTES] = {0};
- bool ret;
-
- /* ctx->dmub_srv is NULL, so the DMUB command execute fails. */
- ret = dm_edid_parser_send_cea(dm, 0, 8, data,
- DMUB_EDID_CEA_DATA_CHUNK_BYTES, &vsdb);
- KUNIT_EXPECT_FALSE(test, ret);
-}
-
-/**
- * dm_test_parse_cea_dmcu_empty - Test an empty extension parses to no VSDB
- * @test: KUnit test context
- */
-static void dm_test_parse_cea_dmcu_empty(struct kunit *test)
-{
- struct amdgpu_display_manager *dm = dm_test_alloc_dm_dmcu(test, NULL);
- struct amdgpu_hdmi_vsdb_info vsdb = {0};
- u8 ext[1] = {0};
-
- KUNIT_EXPECT_FALSE(test, parse_edid_cea_dmcu(dm, ext, 0, &vsdb));
-}
-
-/**
- * dm_test_parse_cea_dmcu_no_dmcu - Test a missing DMCU fails the first send
- * @test: KUnit test context
- */
-static void dm_test_parse_cea_dmcu_no_dmcu(struct kunit *test)
-{
-}
-
-/**
- * dm_test_parse_cea_dmcu_vsdb_none - Test the DMCU finds no AMD VSDB
- * @test: KUnit test context
- */
-static void dm_test_parse_cea_dmcu_vsdb_none(struct kunit *test)
-{
- struct amdgpu_display_manager *dm =
- dm_test_alloc_dm_dmcu(test, &dm_test_dmcu_funcs_novsdb);
- struct amdgpu_hdmi_vsdb_info vsdb = {0};
- u8 ext[DMUB_EDID_CEA_DATA_CHUNK_BYTES] = {0};
- bool ret;
-
- ret = parse_edid_cea_dmcu(dm, ext, DMUB_EDID_CEA_DATA_CHUNK_BYTES,
- &vsdb);
- KUNIT_EXPECT_FALSE(test, ret);
-}
-
-/**
- * dm_test_parse_cea_dmcu_multi_chunk - Test intermediate chunks are acked
- * @test: KUnit test context
- */
-static void dm_test_parse_cea_dmcu_multi_chunk(struct kunit *test)
-{
- struct amdgpu_display_manager *dm =
- dm_test_alloc_dm_dmcu(test, &dm_test_dmcu_funcs_vsdb);
- struct amdgpu_hdmi_vsdb_info vsdb = {0};
- u8 ext[2 * DMUB_EDID_CEA_DATA_CHUNK_BYTES] = {0};
- bool ret;
-
- ret = parse_edid_cea_dmcu(dm, ext, 2 * DMUB_EDID_CEA_DATA_CHUNK_BYTES,
- &vsdb);
- KUNIT_EXPECT_TRUE(test, ret);
-}
-
-/**
- * dm_test_parse_cea_dmcu_ack_fail - Test a failed chunk ack aborts the parse
- * @test: KUnit test context
- */
-static void dm_test_parse_cea_dmcu_ack_fail(struct kunit *test)
-{
- struct amdgpu_display_manager *dm =
- dm_test_alloc_dm_dmcu(test, &dm_test_dmcu_funcs_ackfail);
- struct amdgpu_hdmi_vsdb_info vsdb = {0};
- u8 ext[2 * DMUB_EDID_CEA_DATA_CHUNK_BYTES] = {0};
- bool ret;
-
- ret = parse_edid_cea_dmcu(dm, ext, 2 * DMUB_EDID_CEA_DATA_CHUNK_BYTES,
- &vsdb);
- KUNIT_EXPECT_FALSE(test, ret);
-}
-
-/**
- * dm_test_parse_cea_dmub_empty - Test an empty extension returns the flag
- * @test: KUnit test context
- */
-static void dm_test_parse_cea_dmub_empty(struct kunit *test)
-{
- struct amdgpu_display_manager *dm = dm_test_alloc_dm_adev(test);
- struct amdgpu_hdmi_vsdb_info vsdb = {0};
- u8 ext[1] = {0};
-
- /* No chunks are sent, so the freesync flag is returned as-is. */
- vsdb.freesync_supported = true;
- KUNIT_EXPECT_TRUE(test, parse_edid_cea_dmub(dm, ext, 0, &vsdb));
-}
-
-/**
- * dm_test_parse_cea_dmub_send_fail - Test a chunk send failure aborts the parse
- * @test: KUnit test context
- */
-static void dm_test_parse_cea_dmub_send_fail(struct kunit *test)
-{
- struct amdgpu_display_manager *dm = dm_test_alloc_dm_adev(test);
- struct amdgpu_hdmi_vsdb_info vsdb = {0};
- u8 ext[DMUB_EDID_CEA_DATA_CHUNK_BYTES] = {0};
- bool ret;
-
- /* The first chunk send fails (no DMUB), so the parse bails out. */
- ret = parse_edid_cea_dmub(dm, ext, DMUB_EDID_CEA_DATA_CHUNK_BYTES,
- &vsdb);
- KUNIT_EXPECT_FALSE(test, ret);
-}
-
-/**
- * dm_test_parse_cea_routes_dmub - Test a present dmub_srv routes to DMUB
- * @test: KUnit test context
- */
-static void dm_test_parse_cea_routes_dmub(struct kunit *test)
-{
- struct amdgpu_device *adev = dm_kunit_alloc_adev(test);
- struct amdgpu_dm_connector *aconnector;
- struct amdgpu_hdmi_vsdb_info vsdb = {0};
- u8 ext[1] = {0};
-
- KUNIT_ASSERT_NOT_NULL(test, adev);
- mutex_init(&adev->dm.dc_lock);
- adev->dm.dmub_srv = kunit_kzalloc(test, 1, GFP_KERNEL);
- KUNIT_ASSERT_NOT_NULL(test, adev->dm.dmub_srv);
-
- aconnector = kunit_kzalloc(test, sizeof(*aconnector), GFP_KERNEL);
- KUNIT_ASSERT_NOT_NULL(test, aconnector);
- aconnector->base.dev = &adev->ddev;
-
- /* len 0 routes to the DMUB parser, which returns the freesync flag. */
- vsdb.freesync_supported = true;
- KUNIT_EXPECT_TRUE(test, parse_edid_cea(aconnector, ext, 0, &vsdb));
-}
-
-/**
- * dm_test_parse_cea_routes_dmcu - Test a missing dmub_srv routes to DMCU
- * @test: KUnit test context
- */
-static void dm_test_parse_cea_routes_dmcu(struct kunit *test)
-{
- struct amdgpu_device *adev = dm_kunit_alloc_adev(test);
- struct amdgpu_dm_connector *aconnector;
- struct amdgpu_hdmi_vsdb_info vsdb = {0};
- u8 ext[1] = {0};
-
- KUNIT_ASSERT_NOT_NULL(test, adev);
- mutex_init(&adev->dm.dc_lock);
- adev->dm.dmub_srv = NULL;
-
- aconnector = kunit_kzalloc(test, sizeof(*aconnector), GFP_KERNEL);
- KUNIT_ASSERT_NOT_NULL(test, aconnector);
- aconnector->base.dev = &adev->ddev;
-
- /* len 0 routes to the DMCU parser, which returns false. */
- KUNIT_EXPECT_FALSE(test, parse_edid_cea(aconnector, ext, 0, &vsdb));
-}
-
/**
* dm_test_get_amd_vsdb_unsupported - Test a zero VSDB version reports no support
* @test: The KUnit test context
@@ -9083,17 +8830,6 @@ static struct kunit_case amdgpu_dm_connector_tests[] = {
KUNIT_CASE(dm_test_restore_state_no_encoder),
KUNIT_CASE(dm_test_restore_state_no_stream),
KUNIT_CASE(dm_test_restore_state_same_sink),
- KUNIT_CASE(dm_test_send_cea_length_too_long),
- KUNIT_CASE(dm_test_send_cea_dmub_unavailable),
- KUNIT_CASE(dm_test_parse_cea_dmcu_empty),
- KUNIT_CASE(dm_test_parse_cea_dmcu_no_dmcu),
- KUNIT_CASE(dm_test_parse_cea_dmcu_vsdb_none),
- KUNIT_CASE(dm_test_parse_cea_dmcu_multi_chunk),
- KUNIT_CASE(dm_test_parse_cea_dmcu_ack_fail),
- KUNIT_CASE(dm_test_parse_cea_dmub_empty),
- KUNIT_CASE(dm_test_parse_cea_dmub_send_fail),
- KUNIT_CASE(dm_test_parse_cea_routes_dmub),
- KUNIT_CASE(dm_test_parse_cea_routes_dmcu),
/* get_amd_vsdb */
KUNIT_CASE(dm_test_get_amd_vsdb_unsupported),
KUNIT_CASE(dm_test_get_amd_vsdb_supported),
--
Cheers,
Nathan
^ permalink raw reply [flat|nested] 5+ messages in thread