aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/1828-drm-amd-display-Allow-commits-with-no-planes-active.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/1828-drm-amd-display-Allow-commits-with-no-planes-active.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/1828-drm-amd-display-Allow-commits-with-no-planes-active.patch81
1 files changed, 81 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/1828-drm-amd-display-Allow-commits-with-no-planes-active.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/1828-drm-amd-display-Allow-commits-with-no-planes-active.patch
new file mode 100644
index 00000000..3fefff00
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/1828-drm-amd-display-Allow-commits-with-no-planes-active.patch
@@ -0,0 +1,81 @@
+From 1cd098d049c28a8901a816312045d76975e677db Mon Sep 17 00:00:00 2001
+From: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
+Date: Thu, 4 Apr 2019 11:00:53 -0400
+Subject: [PATCH 1828/2940] drm/amd/display: Allow commits with no planes
+ active
+
+[Why]
+Many userspace applications (and IGT) seem to expect that most drivers
+can keep a CRTC active and enabled if there are no primary or overlay
+planes.
+
+DC is setup to handle this but only in the case where there are
+absolutely no planes on the CRTC - no primary, cursor, or overlay.
+
+[How]
+Add a check to reject commits that have cursor planes enabled and
+nothing else on CRTCs since we can't handle that. The new helper
+does_crtc_have_active_cursor is used for this.
+
+In atomic commit tail, we need to let DC know that there are zero
+planes enabled when doing stream updates to let it disable and blank
+pipes as appropriate.
+
+Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
+Reviewed-by: David Francis <David.Francis@amd.com>
+Acked-by: Leo Li <sunpeng.li@amd.com>
+---
+ .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 22 +++++++++++++++++--
+ 1 file changed, 20 insertions(+), 2 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 9ed7453bbe7e..2c420fddf088 100644
+--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+@@ -3976,6 +3976,19 @@ static void dm_crtc_helper_disable(struct drm_crtc *crtc)
+ {
+ }
+
++static bool does_crtc_have_active_cursor(struct drm_crtc_state *new_crtc_state)
++{
++ struct drm_device *dev = new_crtc_state->crtc->dev;
++ struct drm_plane *plane;
++
++ drm_for_each_plane_mask(plane, dev, new_crtc_state->plane_mask) {
++ if (plane->type == DRM_PLANE_TYPE_CURSOR)
++ return true;
++ }
++
++ return false;
++}
++
+ static int count_crtc_active_planes(struct drm_crtc_state *new_crtc_state)
+ {
+ struct drm_atomic_state *state = new_crtc_state->state;
+@@ -4059,8 +4072,12 @@ static int dm_crtc_helper_atomic_check(struct drm_crtc *crtc,
+ if (!dm_crtc_state->stream)
+ return 0;
+
+- /* We want at least one hardware plane enabled to use the stream. */
++ /*
++ * We want at least one hardware plane enabled to use
++ * the stream with a cursor enabled.
++ */
+ if (state->enable && state->active &&
++ does_crtc_have_active_cursor(state) &&
+ dm_crtc_state->active_planes == 0)
+ return -EINVAL;
+
+@@ -5515,7 +5532,8 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
+ }
+ }
+
+- if (planes_count) {
++ /* Update the planes if changed or disable if we don't have any. */
++ if (planes_count || acrtc_state->active_planes == 0) {
+ if (new_pcrtc_state->mode_changed) {
+ bundle->stream_update.src = acrtc_state->stream->src;
+ bundle->stream_update.dst = acrtc_state->stream->dst;
+--
+2.17.1
+