aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0950-drm-amd-dal-check-stream-on-payload-table-update.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/files/0950-drm-amd-dal-check-stream-on-payload-table-update.patch')
-rw-r--r--common/recipes-kernel/linux/files/0950-drm-amd-dal-check-stream-on-payload-table-update.patch126
1 files changed, 126 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/files/0950-drm-amd-dal-check-stream-on-payload-table-update.patch b/common/recipes-kernel/linux/files/0950-drm-amd-dal-check-stream-on-payload-table-update.patch
new file mode 100644
index 00000000..dd0afa6d
--- /dev/null
+++ b/common/recipes-kernel/linux/files/0950-drm-amd-dal-check-stream-on-payload-table-update.patch
@@ -0,0 +1,126 @@
+From 596691ce6e0086573d7fecbadfda2ad960b8c0e3 Mon Sep 17 00:00:00 2001
+From: Mykola Lysenko <Mykola.Lysenko@amd.com>
+Date: Mon, 14 Dec 2015 19:04:17 +0800
+Subject: [PATCH 0950/1050] drm/amd/dal: check stream on payload table update
+
+There is a situation when drm crtc moved from one connector
+to another, and MST connector can lack DC target for one
+commit. It should be guarded both in DM and DC
+
+Change-Id: I85da568d8bd92beab14c575b75fbe6b84dd6028f
+Signed-off-by: Mykola Lysenko <Mykola.Lysenko@amd.com>
+Signed-off-by: Harry Wentland <harry.wentland@amd.com>
+Acked-by: Harry Wentland<harry.wentland@amd.com>
+---
+ .../gpu/drm/amd/dal/amdgpu_dm/amdgpu_dc_helpers.c | 8 ++++
+ .../drm/amd/dal/dc/dce110/dce110_link_encoder.c | 47 ++++++++++++++--------
+ 2 files changed, 38 insertions(+), 17 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dc_helpers.c b/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dc_helpers.c
+index f2d1dc8..0230ee9 100644
+--- a/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dc_helpers.c
++++ b/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dc_helpers.c
+@@ -311,6 +311,14 @@ bool dc_helpers_dp_mst_write_payload_allocation_table(
+ * crtc -> target -> stream -> sink
+ */
+ crtc = aconnector->base.state->crtc;
++
++ /*
++ * this situation can happen when crtc moved from one
++ * connector to another for any reason
++ */
++ if (!crtc)
++ continue;
++
+ amdgpu_crtc = to_amdgpu_crtc(crtc);
+ dc_target = amdgpu_crtc->target;
+
+diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_link_encoder.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_link_encoder.c
+index 8ddccdf..d71efa9 100644
+--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_link_encoder.c
++++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_link_encoder.c
+@@ -1630,6 +1630,24 @@ void dce110_link_encoder_set_dp_phy_pattern(
+ }
+ }
+
++static void fill_stream_allocation_row_info(
++ const struct dp_mst_stream_allocation *stream_allocation,
++ uint32_t *src,
++ uint32_t *slots)
++{
++ const struct dc_stream *dc_stream = stream_allocation->stream;
++ struct core_stream *core_stream;
++
++ if (dc_stream) {
++ core_stream = DC_STREAM_TO_CORE(dc_stream);
++ *src = core_stream->stream_enc->id;
++ *slots = stream_allocation->slot_count;
++ } else {
++ *src = 0;
++ *slots = 0;
++ }
++}
++
+ /* programs DP MST VC payload allocation */
+ void dce110_link_encoder_update_mst_stream_allocation_table(
+ struct link_encoder *enc,
+@@ -1642,8 +1660,6 @@ void dce110_link_encoder_update_mst_stream_allocation_table(
+ uint32_t slots = 0;
+ uint32_t src = 0;
+ uint32_t retries = 0;
+- struct core_stream *core_stream = NULL;
+-
+
+ /* For CZ, there are only 3 pipes. So Virtual channel is up 3.*/
+
+@@ -1657,11 +1673,10 @@ void dce110_link_encoder_update_mst_stream_allocation_table(
+ value1 = dal_read_reg(ctx, DP_REG(mmDP_MSE_SAT1));
+
+ if (table->stream_count >= 1) {
+- core_stream =
+- DC_STREAM_TO_CORE(table->stream_allocations[0].stream);
+-
+- src = core_stream->stream_enc->id;
+- slots = table->stream_allocations[0].slot_count;
++ fill_stream_allocation_row_info(
++ &table->stream_allocations[0],
++ &src,
++ &slots);
+ } else {
+ src = 0;
+ slots = 0;
+@@ -1680,11 +1695,10 @@ void dce110_link_encoder_update_mst_stream_allocation_table(
+ DP_MSE_SAT_SLOT_COUNT0);
+
+ if (table->stream_count >= 2) {
+- core_stream =
+- DC_STREAM_TO_CORE(table->stream_allocations[1].stream);
+-
+- src = core_stream->stream_enc->id;
+- slots = table->stream_allocations[1].slot_count;
++ fill_stream_allocation_row_info(
++ &table->stream_allocations[1],
++ &src,
++ &slots);
+ } else {
+ src = 0;
+ slots = 0;
+@@ -1703,11 +1717,10 @@ void dce110_link_encoder_update_mst_stream_allocation_table(
+ DP_MSE_SAT_SLOT_COUNT1);
+
+ if (table->stream_count >= 3) {
+- core_stream =
+- DC_STREAM_TO_CORE(table->stream_allocations[2].stream);
+-
+- src = core_stream->stream_enc->id;
+- slots = table->stream_allocations[2].slot_count;
++ fill_stream_allocation_row_info(
++ &table->stream_allocations[2],
++ &src,
++ &slots);
+ } else {
+ src = 0;
+ slots = 0;
+--
+1.9.1
+