diff options
Diffstat (limited to 'common/recipes-kernel/linux/files/0594-drm-amd-dal-use-const-for-new-link-sink-mgmt-interfa.patch')
-rw-r--r-- | common/recipes-kernel/linux/files/0594-drm-amd-dal-use-const-for-new-link-sink-mgmt-interfa.patch | 177 |
1 files changed, 177 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/files/0594-drm-amd-dal-use-const-for-new-link-sink-mgmt-interfa.patch b/common/recipes-kernel/linux/files/0594-drm-amd-dal-use-const-for-new-link-sink-mgmt-interfa.patch new file mode 100644 index 00000000..a4d995cf --- /dev/null +++ b/common/recipes-kernel/linux/files/0594-drm-amd-dal-use-const-for-new-link-sink-mgmt-interfa.patch @@ -0,0 +1,177 @@ +From 9cdf4728c089667bee0b2297aa7ba84103f7e130 Mon Sep 17 00:00:00 2001 +From: Mykola Lysenko <Mykola.Lysenko@amd.com> +Date: Wed, 9 Dec 2015 19:50:16 +0800 +Subject: [PATCH 0594/1110] drm/amd/dal: use const for new link sink mgmt + interfaces + +We should be consistent with our approach to forbid object +changes from DM, interface we provide should receive const +pointer as parameter + +Signed-off-by: Harry Wentland <harry.wentland@amd.com> +Acked-by: Harry Wentland<harry.wentland@amd.com> +--- + .../drm/amd/dal/amdgpu_dm/amdgpu_dm_mst_types.c | 21 ++++++++++------ + drivers/gpu/drm/amd/dal/dc/core/dc.c | 29 ++++++++++++---------- + drivers/gpu/drm/amd/dal/dc/dc.h | 11 ++++---- + 3 files changed, 34 insertions(+), 27 deletions(-) + +diff --git a/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_mst_types.c +index 2f3a784..ca4a244 100644 +--- a/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_mst_types.c ++++ b/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_mst_types.c +@@ -94,8 +94,8 @@ static const struct drm_connector_funcs dm_dp_mst_connector_funcs = { + .atomic_set_property = amdgpu_dm_connector_atomic_set_property + }; + +-static const struct dc_sink *dm_dp_mst_add_mst_sink( +- struct dc_link *dc_link, ++static struct dc_sink *dm_dp_mst_add_mst_sink( ++ const struct dc_link *dc_link, + uint8_t *edid, + uint16_t len) + { +@@ -110,6 +110,11 @@ static const struct dc_sink *dm_dp_mst_add_mst_sink( + return NULL; + } + ++ if (!dc_link) { ++ BREAK_TO_DEBUGGER(); ++ return NULL; ++ } ++ + /* + * TODO make dynamic-ish? + * dc_link->connector_signal; +@@ -126,7 +131,7 @@ static const struct dc_sink *dm_dp_mst_add_mst_sink( + if (!dc_link_add_sink( + dc_link, + dc_sink)) +- goto fail; ++ goto fail_add_sink; + + edid_status = dc_helpers_parse_edid_caps( + NULL, +@@ -138,9 +143,9 @@ static const struct dc_sink *dm_dp_mst_add_mst_sink( + /* dc_sink_retain(&core_sink->public); */ + + return dc_sink; +- + fail: + dc_link_remove_sink(dc_link, dc_sink); ++fail_add_sink: + return NULL; + } + +@@ -168,10 +173,10 @@ static int dm_dp_mst_get_modes(struct drm_connector *connector) + + if (!aconnector->dc_sink) { + sink = dm_dp_mst_add_mst_sink( +- (struct dc_link *)aconnector->dc_link, +- (uint8_t *)edid, +- (edid->extensions + 1) * EDID_LENGTH); +- aconnector->dc_sink = sink; ++ aconnector->dc_link, ++ (uint8_t *)edid, ++ (edid->extensions + 1) * EDID_LENGTH); ++ aconnector->dc_sink = sink; + } + + DRM_DEBUG_KMS("edid retrieved %p\n", edid); +diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc.c b/drivers/gpu/drm/amd/dal/dc/core/dc.c +index 6351ef5..a20a5ef 100644 +--- a/drivers/gpu/drm/amd/dal/dc/core/dc.c ++++ b/drivers/gpu/drm/amd/dal/dc/core/dc.c +@@ -950,43 +950,46 @@ bool dc_write_dpcd( + return r == DDC_RESULT_SUCESSFULL; + } + +-bool dc_link_add_sink( +- struct dc_link *link, +- struct dc_sink *sink) ++bool dc_link_add_sink(const struct dc_link *link, struct dc_sink *sink) + { +- if (link->sink_count >= MAX_SINKS_PER_LINK) { ++ struct core_link *core_link = DC_LINK_TO_LINK(link); ++ struct dc_link *dc_link = &core_link->public; ++ ++ if (dc_link->sink_count >= MAX_SINKS_PER_LINK) { + BREAK_TO_DEBUGGER(); + return false; + } + +- link->sink[link->sink_count] = sink; +- link->sink_count++; ++ dc_link->sink[link->sink_count] = sink; ++ dc_link->sink_count++; + + return true; + } + + +-void dc_link_remove_sink(struct dc_link *link, const struct dc_sink *sink) ++void dc_link_remove_sink(const struct dc_link *link, const struct dc_sink *sink) + { + int i; ++ struct core_link *core_link = DC_LINK_TO_LINK(link); ++ struct dc_link *dc_link = &core_link->public; + + if (!link->sink_count) { + BREAK_TO_DEBUGGER(); + return; + } + +- for (i = 0; i < link->sink_count; i++) { +- if (link->sink[i] == sink) { ++ for (i = 0; i < dc_link->sink_count; i++) { ++ if (dc_link->sink[i] == sink) { + dc_sink_release(sink); +- link->sink[i] = NULL; ++ dc_link->sink[i] = NULL; + + /* shrink array to remove empty place */ +- while (i < link->sink_count - 1) { +- link->sink[i] = link->sink[i+1]; ++ while (i < dc_link->sink_count - 1) { ++ dc_link->sink[i] = dc_link->sink[i+1]; + i++; + } + +- link->sink_count--; ++ dc_link->sink_count--; + return; + } + } +diff --git a/drivers/gpu/drm/amd/dal/dc/dc.h b/drivers/gpu/drm/amd/dal/dc/dc.h +index fa2712c..bbeaf23 100644 +--- a/drivers/gpu/drm/amd/dal/dc/dc.h ++++ b/drivers/gpu/drm/amd/dal/dc/dc.h +@@ -303,12 +303,11 @@ void dc_link_detect(const struct dc_link *dc_link); + * from DM. */ + bool dc_link_handle_hpd_rx_irq(const struct dc_link *dc_link); + +-bool dc_link_add_sink( +- struct dc_link *link, +- struct dc_sink *sink +- ); ++bool dc_link_add_sink(const struct dc_link *link, struct dc_sink *sink); + +-void dc_link_remove_sink(struct dc_link *link, const struct dc_sink *sink); ++void dc_link_remove_sink( ++ const struct dc_link *link, ++ const struct dc_sink *sink); + + /******************************************************************************* + * Sink Interfaces - A sink corresponds to a display output device +@@ -330,7 +329,7 @@ const struct audio **dc_get_audios(struct dc *dc); + + struct sink_init_data { + enum signal_type sink_signal; +- struct dc_link *link; ++ const struct dc_link *link; + uint32_t dongle_max_pix_clk; + bool converter_disable_audio; + }; +-- +2.7.4 + |