diff options
| author | Stefan Agner <stefan@agner.ch> | 2016-10-31 12:51:19 -0400 |
|---|---|---|
| committer | Stefan Agner <stefan@agner.ch> | 2016-11-08 20:14:08 -0500 |
| commit | 3d6f37102bd6e4b55a7f336d44974c0bd1c22a15 (patch) | |
| tree | 4ac427729a6a726d1319c585bcaf21acb89b0d64 /drivers/gpu/drm/fsl-dcu | |
| parent | 93daeeca2c9472a47d419884a64f6ca2b7f006e4 (diff) | |
drm/fsl-dcu: disable planes before disabling CRTC
After disabling and reenabling the CRTC the DCU sometimes got stuck
displaying the whole screen with a solid color. Disabling and
reenabling the CRTC did not recover from the situation. This was
often reproducable by just restarting the X-Server.
The disabling sequence is not explicitly documented. But it turns
out that disabling the planes before disabling the CRTC seems to
prevent the above situation from happening.
Use the callback ->atomic_disable instead of ->disable which allows
to use the drm_atomic_helper_disable_planes_on_crtc() helper to
disable planes before disabling the controller.
Signed-off-by: Stefan Agner <stefan@agner.ch>
Diffstat (limited to 'drivers/gpu/drm/fsl-dcu')
| -rw-r--r-- | drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c index 2ea9dbd9be30..deb57435cc89 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c | |||
| @@ -44,11 +44,15 @@ static void fsl_dcu_drm_crtc_atomic_flush(struct drm_crtc *crtc, | |||
| 44 | } | 44 | } |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | static void fsl_dcu_drm_disable_crtc(struct drm_crtc *crtc) | 47 | static void fsl_dcu_drm_crtc_atomic_disable(struct drm_crtc *crtc, |
| 48 | struct drm_crtc_state *old_crtc_state) | ||
| 48 | { | 49 | { |
| 49 | struct drm_device *dev = crtc->dev; | 50 | struct drm_device *dev = crtc->dev; |
| 50 | struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; | 51 | struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; |
| 51 | 52 | ||
| 53 | /* always disable planes on the CRTC */ | ||
| 54 | drm_atomic_helper_disable_planes_on_crtc(old_crtc_state, true); | ||
| 55 | |||
| 52 | drm_crtc_vblank_off(crtc); | 56 | drm_crtc_vblank_off(crtc); |
| 53 | 57 | ||
| 54 | regmap_update_bits(fsl_dev->regmap, DCU_DCU_MODE, | 58 | regmap_update_bits(fsl_dev->regmap, DCU_DCU_MODE, |
| @@ -127,8 +131,8 @@ static void fsl_dcu_drm_crtc_mode_set_nofb(struct drm_crtc *crtc) | |||
| 127 | } | 131 | } |
| 128 | 132 | ||
| 129 | static const struct drm_crtc_helper_funcs fsl_dcu_drm_crtc_helper_funcs = { | 133 | static const struct drm_crtc_helper_funcs fsl_dcu_drm_crtc_helper_funcs = { |
| 134 | .atomic_disable = fsl_dcu_drm_crtc_atomic_disable, | ||
| 130 | .atomic_flush = fsl_dcu_drm_crtc_atomic_flush, | 135 | .atomic_flush = fsl_dcu_drm_crtc_atomic_flush, |
| 131 | .disable = fsl_dcu_drm_disable_crtc, | ||
| 132 | .enable = fsl_dcu_drm_crtc_enable, | 136 | .enable = fsl_dcu_drm_crtc_enable, |
| 133 | .mode_set_nofb = fsl_dcu_drm_crtc_mode_set_nofb, | 137 | .mode_set_nofb = fsl_dcu_drm_crtc_mode_set_nofb, |
| 134 | }; | 138 | }; |
