aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2782-drm-amd-display-Do-not-program-front-end-twice.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2782-drm-amd-display-Do-not-program-front-end-twice.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2782-drm-amd-display-Do-not-program-front-end-twice.patch113
1 files changed, 113 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2782-drm-amd-display-Do-not-program-front-end-twice.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2782-drm-amd-display-Do-not-program-front-end-twice.patch
new file mode 100644
index 00000000..d1898e54
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2782-drm-amd-display-Do-not-program-front-end-twice.patch
@@ -0,0 +1,113 @@
+From b61ed188ee13c003bcb2980e65ead3b1a93ffab8 Mon Sep 17 00:00:00 2001
+From: "Leo (Sunpeng) Li" <sunpeng.li@amd.com>
+Date: Fri, 10 Nov 2017 16:12:08 -0500
+Subject: [PATCH 2782/4131] drm/amd/display: Do not program front-end twice
+
+The sequence of front-end > back-end > front-end programming will
+program the front-end more than once. Add a mode_changed flag, and use
+it to determine whether the front-end should be programmed before, or
+after back-end.
+
+Signed-off-by: Leo (Sunpeng) Li <sunpeng.li@amd.com>
+Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
+Acked-by: Harry Wentland <harry.wentland@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 20 ++++++++++++++++++++
+ drivers/gpu/drm/amd/display/dc/core/dc.c | 12 +++++++++---
+ drivers/gpu/drm/amd/display/dc/dc_stream.h | 3 +++
+ 3 files changed, 32 insertions(+), 3 deletions(-)
+
+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 28b5c96..d9b204f 100644
+--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+@@ -4351,6 +4351,19 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
+ }
+ }
+
++/**
++ * amdgpu_dm_crtc_copy_transient_flags - copy mirrored flags from DRM to DC
++ * @crtc_state: the DRM CRTC state
++ * @stream_state: the DC stream state.
++ *
++ * Copy the mirrored transient state flags from DRM, to DC. It is used to bring
++ * a dc_stream_state's flags in sync with a drm_crtc_state's flags.
++ */
++static void amdgpu_dm_crtc_copy_transient_flags(struct drm_crtc_state *crtc_state,
++ struct dc_stream_state *stream_state)
++{
++ stream_state->mode_changed = crtc_state->mode_changed;
++}
+
+ static int amdgpu_dm_atomic_commit(struct drm_device *dev,
+ struct drm_atomic_state *state,
+@@ -4452,6 +4465,12 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)
+ new_crtc_state->connectors_changed);
+ #endif
+
++ /* Copy all transient state flags into dc state */
++ if (dm_new_crtc_state->stream) {
++ amdgpu_dm_crtc_copy_transient_flags(&dm_new_crtc_state->base,
++ dm_new_crtc_state->stream);
++ }
++
+ /* handles headless hotplug case, updating new_state and
+ * aconnector as needed
+ */
+@@ -5001,6 +5020,7 @@ static int dm_update_crtcs_state(struct dc *dc,
+ WARN_ON(dm_new_crtc_state->stream);
+
+ dm_new_crtc_state->stream = new_stream;
++
+ dc_stream_retain(new_stream);
+
+ DRM_DEBUG_DRIVER("Enabling DRM crtc: %d\n",
+diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
+index afa4580..ba775a1 100644
+--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
++++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
+@@ -631,10 +631,13 @@ static enum dc_status dc_commit_state_no_check(struct dc *dc, struct dc_state *c
+ /* re-program planes for existing stream, in case we need to
+ * free up plane resource for later use
+ */
+- for (i = 0; i < dc->current_state->stream_count; i++) {
++ for (i = 0; i < context->stream_count; i++) {
++ if (context->streams[i]->mode_changed)
++ continue;
++
+ dc->hwss.apply_ctx_for_surface(
+- dc, dc->current_state->streams[i],
+- dc->current_state->stream_status[i].plane_count,
++ dc, context->streams[i],
++ context->stream_status[i].plane_count,
+ context); /* use new pipe config in new context */
+ }
+
+@@ -660,6 +663,9 @@ static enum dc_status dc_commit_state_no_check(struct dc *dc, struct dc_state *c
+ for (i = 0; i < context->stream_count; i++) {
+ const struct dc_sink *sink = context->streams[i]->sink;
+
++ if (!context->streams[i]->mode_changed)
++ continue;
++
+ dc->hwss.apply_ctx_for_surface(
+ dc, context->streams[i],
+ context->stream_status[i].plane_count,
+diff --git a/drivers/gpu/drm/amd/display/dc/dc_stream.h b/drivers/gpu/drm/amd/display/dc/dc_stream.h
+index 9a64cf1..fed0e5e 100644
+--- a/drivers/gpu/drm/amd/display/dc/dc_stream.h
++++ b/drivers/gpu/drm/amd/display/dc/dc_stream.h
+@@ -92,6 +92,9 @@ struct dc_stream_state {
+
+ struct crtc_trigger_info triggered_crtc_reset;
+
++ /* Computed state bits */
++ bool mode_changed : 1;
++
+ };
+
+ struct dc_stream_update {
+--
+2.7.4
+