diff options
author | Dave Airlie <airlied@redhat.com> | 2015-03-30 23:38:01 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2015-03-30 23:38:01 -0400 |
commit | d7de390bff7ad0f551fc0e409543e98db86a65df (patch) | |
tree | fbf28d2b4f40e674fa6a179d5f6f4e51ad1b15af /drivers | |
parent | b1f389ecc20b95f0f64515588d3736e85146848f (diff) | |
parent | f026eb6e031f704fad991fdeb76c40d7c4a301bd (diff) |
Merge branch 'drm-atmel-hlcdc-4.1-fixes' of git://github.com/bbrezillon/linux-at91 into drm-next
add PM fix.
* 'drm-atmel-hlcdc-4.1-fixes' of git://github.com/bbrezillon/linux-at91:
drm: atmel-hlcdc: use appropriate enabled flag in suspend/resume
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 21 | ||||
-rw-r--r-- | drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 19 | ||||
-rw-r--r-- | drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h | 3 |
3 files changed, 28 insertions, 15 deletions
diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c index d55c0c232e1d..f69b92535505 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | |||
@@ -207,6 +207,27 @@ static void atmel_hlcdc_crtc_enable(struct drm_crtc *c) | |||
207 | crtc->enabled = true; | 207 | crtc->enabled = true; |
208 | } | 208 | } |
209 | 209 | ||
210 | void atmel_hlcdc_crtc_suspend(struct drm_crtc *c) | ||
211 | { | ||
212 | struct atmel_hlcdc_crtc *crtc = drm_crtc_to_atmel_hlcdc_crtc(c); | ||
213 | |||
214 | if (crtc->enabled) { | ||
215 | atmel_hlcdc_crtc_disable(c); | ||
216 | /* save enable state for resume */ | ||
217 | crtc->enabled = true; | ||
218 | } | ||
219 | } | ||
220 | |||
221 | void atmel_hlcdc_crtc_resume(struct drm_crtc *c) | ||
222 | { | ||
223 | struct atmel_hlcdc_crtc *crtc = drm_crtc_to_atmel_hlcdc_crtc(c); | ||
224 | |||
225 | if (crtc->enabled) { | ||
226 | crtc->enabled = false; | ||
227 | atmel_hlcdc_crtc_enable(c); | ||
228 | } | ||
229 | } | ||
230 | |||
210 | static int atmel_hlcdc_crtc_atomic_check(struct drm_crtc *c, | 231 | static int atmel_hlcdc_crtc_atomic_check(struct drm_crtc *c, |
211 | struct drm_crtc_state *s) | 232 | struct drm_crtc_state *s) |
212 | { | 233 | { |
diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c index c4bb1f9f95c6..60b0c13d7ff5 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | |||
@@ -569,14 +569,8 @@ static int atmel_hlcdc_dc_drm_suspend(struct device *dev) | |||
569 | return 0; | 569 | return 0; |
570 | 570 | ||
571 | drm_modeset_lock_all(drm_dev); | 571 | drm_modeset_lock_all(drm_dev); |
572 | list_for_each_entry(crtc, &drm_dev->mode_config.crtc_list, head) { | 572 | list_for_each_entry(crtc, &drm_dev->mode_config.crtc_list, head) |
573 | struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; | 573 | atmel_hlcdc_crtc_suspend(crtc); |
574 | if (crtc->enabled) { | ||
575 | crtc_funcs->disable(crtc); | ||
576 | /* save enable state for resume */ | ||
577 | crtc->enabled = true; | ||
578 | } | ||
579 | } | ||
580 | drm_modeset_unlock_all(drm_dev); | 574 | drm_modeset_unlock_all(drm_dev); |
581 | return 0; | 575 | return 0; |
582 | } | 576 | } |
@@ -590,13 +584,8 @@ static int atmel_hlcdc_dc_drm_resume(struct device *dev) | |||
590 | return 0; | 584 | return 0; |
591 | 585 | ||
592 | drm_modeset_lock_all(drm_dev); | 586 | drm_modeset_lock_all(drm_dev); |
593 | list_for_each_entry(crtc, &drm_dev->mode_config.crtc_list, head) { | 587 | list_for_each_entry(crtc, &drm_dev->mode_config.crtc_list, head) |
594 | struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; | 588 | atmel_hlcdc_crtc_resume(crtc); |
595 | if (crtc->enabled) { | ||
596 | crtc->enabled = false; | ||
597 | crtc_funcs->enable(crtc); | ||
598 | } | ||
599 | } | ||
600 | drm_modeset_unlock_all(drm_dev); | 589 | drm_modeset_unlock_all(drm_dev); |
601 | return 0; | 590 | return 0; |
602 | } | 591 | } |
diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h index 1ea9c2ccd8a7..cf6b375bc38d 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h | |||
@@ -155,6 +155,9 @@ void atmel_hlcdc_crtc_irq(struct drm_crtc *c); | |||
155 | void atmel_hlcdc_crtc_cancel_page_flip(struct drm_crtc *crtc, | 155 | void atmel_hlcdc_crtc_cancel_page_flip(struct drm_crtc *crtc, |
156 | struct drm_file *file); | 156 | struct drm_file *file); |
157 | 157 | ||
158 | void atmel_hlcdc_crtc_suspend(struct drm_crtc *crtc); | ||
159 | void atmel_hlcdc_crtc_resume(struct drm_crtc *crtc); | ||
160 | |||
158 | int atmel_hlcdc_crtc_create(struct drm_device *dev); | 161 | int atmel_hlcdc_crtc_create(struct drm_device *dev); |
159 | 162 | ||
160 | int atmel_hlcdc_create_outputs(struct drm_device *dev); | 163 | int atmel_hlcdc_create_outputs(struct drm_device *dev); |