[PATCH 2/2] drm/plane-helper: Use init state when freshly allocating them

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Daniel fixed the same issue for crtc states in

commit 9f658b7b62e7aefc1ee067136126eca3f58cabfd
Author: Daniel Stone <daniels@xxxxxxxxxxxxx>
Date:   Fri May 22 13:34:45 2015 +0100

    drm/crtc_helper: Replace open-coded CRTC state helpers

Follow suite.

Cc: Daniel Stone <daniels@xxxxxxxxxxxxx>
Signed-off-by: Daniel Vetter <daniel.vetter@xxxxxxxxx>
---
 drivers/gpu/drm/drm_plane_helper.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_plane_helper.c b/drivers/gpu/drm/drm_plane_helper.c
index 2f0ed11024eb..cd367dde7521 100644
--- a/drivers/gpu/drm/drm_plane_helper.c
+++ b/drivers/gpu/drm/drm_plane_helper.c
@@ -527,8 +527,11 @@ int drm_plane_helper_update(struct drm_plane *plane, struct drm_crtc *crtc,
 		plane_state = plane->funcs->atomic_duplicate_state(plane);
 	else if (plane->state)
 		plane_state = drm_atomic_helper_plane_duplicate_state(plane);
-	else
+	else {
 		plane_state = kzalloc(sizeof(*plane_state), GFP_KERNEL);
+		if (plane_state)
+			__drm_atomic_helper_plane_duplicate_state(plane, plane_state);
+	}
 	if (!plane_state)
 		return -ENOMEM;
 	plane_state->plane = plane;
@@ -574,8 +577,11 @@ int drm_plane_helper_disable(struct drm_plane *plane)
 		plane_state = plane->funcs->atomic_duplicate_state(plane);
 	else if (plane->state)
 		plane_state = drm_atomic_helper_plane_duplicate_state(plane);
-	else
+	else {
 		plane_state = kzalloc(sizeof(*plane_state), GFP_KERNEL);
+		if (plane_state)
+			__drm_atomic_helper_plane_duplicate_state(plane, plane_state);
+	}
 	if (!plane_state)
 		return -ENOMEM;
 	plane_state->plane = plane;
-- 
2.1.4

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux