public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/atomic: Fix bookkeeping with TEST_ONLY.
@ 2015-08-04 11:34 Maarten Lankhorst
  2015-08-11 10:03 ` shuang.he
  2015-08-27 12:19 ` Daniel Stone
  0 siblings, 2 replies; 16+ messages in thread
From: Maarten Lankhorst @ 2015-08-04 11:34 UTC (permalink / raw)
  To: dri-devel@lists.freedesktop.org; +Cc: Intel Graphics Development

Commit ec9f932ed41622d120de52a5b525e4d77b9ef17e
"drm/atomic: Cleanup on error properly in the atomic ioctl."
cleaned up some error paths, but didn't fix the TEST_ONLY path.
In the check only case plane->fb shouldn't be updated, and
the vblank events should be cleared as on failure.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index d719ce0b10a0..03672a782e84 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -1507,7 +1507,8 @@ retry:
 			copied_props++;
 		}
 
-		if (obj->type == DRM_MODE_OBJECT_PLANE && count_props) {
+		if (obj->type == DRM_MODE_OBJECT_PLANE && count_props &&
+		    !(arg->flags & DRM_MODE_ATOMIC_TEST_ONLY)) {
 			plane = obj_to_plane(obj);
 			plane_mask |= (1 << drm_plane_index(plane));
 			plane->old_fb = plane->fb;
@@ -1532,7 +1533,7 @@ retry:
 		ret = drm_atomic_check_only(state);
 		/* _check_only() does not free state, unlike _commit() */
 		if (!ret)
-			drm_atomic_state_free(state);
+			goto free;
 	} else if (arg->flags & DRM_MODE_ATOMIC_NONBLOCK) {
 		ret = drm_atomic_async_commit(state);
 	} else {
@@ -1566,6 +1567,7 @@ out:
 	}
 
 	if (ret) {
+free:
 		if (arg->flags & DRM_MODE_PAGE_FLIP_EVENT) {
 			for_each_crtc_in_state(state, crtc, crtc_state, i) {
 				if (!crtc_state->event)

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2015-08-31 13:56 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-04 11:34 [PATCH] drm/atomic: Fix bookkeeping with TEST_ONLY Maarten Lankhorst
2015-08-11 10:03 ` shuang.he
2015-08-27 12:19 ` Daniel Stone
2015-08-27 12:43   ` [PATCH v2] drm/atomic: Fix bookkeeping with TEST_ONLY, v2 Maarten Lankhorst
2015-08-27 12:48     ` Ville Syrjälä
2015-08-27 12:50       ` Maarten Lankhorst
2015-08-27 12:52         ` Ville Syrjälä
2015-08-27 13:05           ` Maarten Lankhorst
2015-08-27 13:50             ` Ville Syrjälä
2015-08-27 14:00               ` Maarten Lankhorst
2015-08-27 14:09                 ` Ville Syrjälä
2015-08-27 14:28                   ` Daniel Stone
2015-08-27 14:34                     ` Ville Syrjälä
2015-08-27 14:42                       ` Daniel Stone
2015-08-27 13:34     ` Daniel Stone
2015-08-31 13:56     ` shuang.he

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox