summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_crtc_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_crtc_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_crtc_helper.c')
-rw-r--r--drivers/gpu/drm/drm_crtc_helper.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index 93104f3555f5..d3dfb0ebbeb2 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -927,10 +927,12 @@ int drm_helper_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mod
if (crtc->funcs->atomic_duplicate_state)
crtc_state = crtc->funcs->atomic_duplicate_state(crtc);
- else if (crtc->state)
+ else {
+ if (!crtc->state)
+ drm_atomic_helper_crtc_reset(crtc);
+
crtc_state = drm_atomic_helper_crtc_duplicate_state(crtc);
- else
- crtc_state = kzalloc(sizeof(*crtc_state), GFP_KERNEL);
+ }
if (!crtc_state)
return -ENOMEM;
OpenPOWER on IntegriCloud