Skip to contentSkip to conversation

drm/atomic: Check old_plane_state->crtc in drm_atomic_helper_async_check()

PATCH Applied Boris Brezillon 1 participant 2 messages Jul 24, 2018 – Jul 25, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 drm/atomic: Check old_plane_state->crtc in drm_atomic_helper_async_check()

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")

---
Changes in v2:
- Cc stable
- Add Eric's R-b

---
 drivers/gpu/drm/drm_atomic_helper.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_atomic_helper.c +2 -1
index 866a2cc72ef6..f7ccfebd3ca8 100644
@@ -1555,7 +1555,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;
Signature · 6 lines
2.14.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author Applied
#1 lore raw
Quoted 5 lines · On Tue, 24 Jul 2018 15:32:15 +0200 Boris Brezillon…

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.

Quoted 7 lines

Check old_plane_state->crtc value to make sure async plane update is allowed.

Fixes fef9df8b5945 ("drm/atomic: initial support for asynchronous plane update")

Applied to drm-misc-fixes.

Quoted 22 lines

---
Changes in v2:
- Cc stable
- Add Eric's R-b

---
 drivers/gpu/drm/drm_atomic_helper.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_atomic_helper.c +2 -1
index 866a2cc72ef6..f7ccfebd3ca8 100644
@@ -1555,7 +1555,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;