summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@bootlin.com>2018-07-24 15:32:15 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-08-06 16:18:22 +0200
commit3859ebae85c7263a438a8d836e5934d3f31aae93 (patch)
tree257f166678e1bcdf260cad6317dcf4ffcb9df84d
parent53a1cb1c35dfc0a2b16acd9f9da3459c5da05c3e (diff)
downloadlinux-stable-3859ebae85c7263a438a8d836e5934d3f31aae93.tar.gz
linux-stable-3859ebae85c7263a438a8d836e5934d3f31aae93.tar.bz2
linux-stable-3859ebae85c7263a438a8d836e5934d3f31aae93.zip
drm/atomic: Check old_plane_state->crtc in drm_atomic_helper_async_check()
commit 603ba2dfb338b307aebe95fe344c479a59b3a175 upstream. Async plane update is supposed to work only when updating the FB or FB position of an already enabled plane. That does not apply to requests where the plane was previously disabled or assigned to a different CTRC. Check old_plane_state->crtc value to make sure async plane update is allowed. Fixes: fef9df8b5945 ("drm/atomic: initial support for asynchronous plane update") Cc: <stable@vger.kernel.org> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: Eric Anholt <eric@anholt.net> Link: https://patchwork.freedesktop.org/patch/msgid/20180724133215.31917-1-boris.brezillon@bootlin.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/gpu/drm/drm_atomic_helper.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 3448e8e44c35..33c582a82d82 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -1516,7 +1516,8 @@ int drm_atomic_helper_async_check(struct drm_device *dev,
if (n_planes != 1)
return -EINVAL;
- if (!new_plane_state->crtc)
+ if (!new_plane_state->crtc ||
+ old_plane_state->crtc != new_plane_state->crtc)
return -EINVAL;
funcs = plane->helper_private;