summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_plane_helper.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2015-07-02 16:33:53 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-07-03 09:16:10 +0200
commite4f31ad2b7138db449310c9b63d402a29dc0e1c9 (patch)
tree25b0ef6fa14d3c89e47a31cf008b8601900804c2 /drivers/gpu/drm/drm_plane_helper.c
parentce14ec20a1ffcd356f578036617d657be8429c00 (diff)
downloadtalos-obmc-linux-e4f31ad2b7138db449310c9b63d402a29dc0e1c9.tar.gz
talos-obmc-linux-e4f31ad2b7138db449310c9b63d402a29dc0e1c9.zip
drm: reset empty state in transitional helpers
Transitional drivers might not have all the state frobbing lined up yet. But since the initial code has been merged a lot more state was added, so we really need this. Cc: Daniel Stone <daniels@collabora.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Reported-and-tested-by: John Hunter <zhaojunwang@pku.edu.cn> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/drm_plane_helper.c')
-rw-r--r--drivers/gpu/drm/drm_plane_helper.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/gpu/drm/drm_plane_helper.c b/drivers/gpu/drm/drm_plane_helper.c
index 2f0ed11024eb..b07a213f5655 100644
--- a/drivers/gpu/drm/drm_plane_helper.c
+++ b/drivers/gpu/drm/drm_plane_helper.c
@@ -525,10 +525,12 @@ int drm_plane_helper_update(struct drm_plane *plane, struct drm_crtc *crtc,
if (plane->funcs->atomic_duplicate_state)
plane_state = plane->funcs->atomic_duplicate_state(plane);
- else if (plane->state)
+ else {
+ if (!plane->state)
+ drm_atomic_helper_plane_reset(plane);
+
plane_state = drm_atomic_helper_plane_duplicate_state(plane);
- else
- plane_state = kzalloc(sizeof(*plane_state), GFP_KERNEL);
+ }
if (!plane_state)
return -ENOMEM;
plane_state->plane = plane;
@@ -572,10 +574,12 @@ int drm_plane_helper_disable(struct drm_plane *plane)
if (plane->funcs->atomic_duplicate_state)
plane_state = plane->funcs->atomic_duplicate_state(plane);
- else if (plane->state)
+ else {
+ if (!plane->state)
+ drm_atomic_helper_plane_reset(plane);
+
plane_state = drm_atomic_helper_plane_duplicate_state(plane);
- else
- plane_state = kzalloc(sizeof(*plane_state), GFP_KERNEL);
+ }
if (!plane_state)
return -ENOMEM;
plane_state->plane = plane;
OpenPOWER on IntegriCloud