aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2016-11-10 19:00:39 -0500
committerDave Airlie <airlied@redhat.com>2016-11-10 19:00:39 -0500
commit76af753bf8d11c40cc4950cc32d9cc3aee852b25 (patch)
treef28ebcea5c2fa365023617962f9c4b984acad6db /drivers/gpu
parent24399f4f0b95522e01e212537d26880227787670 (diff)
parent3d6f37102bd6e4b55a7f336d44974c0bd1c22a15 (diff)
Merge branch 'fixes-for-v4.9-rc5' of http://git.agner.ch/git/linux-drm-fsl-dcu into drm-fixes
Yet another small batch of fixes. Two of the patches I had prepared since quite some time, but they did not seem to affect operation in a visible manner so far. Until recently, when I discovered the third issue (disable planes before disabling CRTC), which made the two previous fixes necessary. * 'fixes-for-v4.9-rc5' of http://git.agner.ch/git/linux-drm-fsl-dcu: drm/fsl-dcu: disable planes before disabling CRTC drm/fsl-dcu: update all registers on flush drm/fsl-dcu: do not update when modifying irq registers
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c13
-rw-r--r--drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c4
-rw-r--r--drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c5
3 files changed, 11 insertions, 11 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 b2d5e188b1b8..deb57435cc89 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c
+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c
@@ -25,8 +25,13 @@
25static void fsl_dcu_drm_crtc_atomic_flush(struct drm_crtc *crtc, 25static void fsl_dcu_drm_crtc_atomic_flush(struct drm_crtc *crtc,
26 struct drm_crtc_state *old_crtc_state) 26 struct drm_crtc_state *old_crtc_state)
27{ 27{
28 struct drm_device *dev = crtc->dev;
29 struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;
28 struct drm_pending_vblank_event *event = crtc->state->event; 30 struct drm_pending_vblank_event *event = crtc->state->event;
29 31
32 regmap_write(fsl_dev->regmap,
33 DCU_UPDATE_MODE, DCU_UPDATE_MODE_READREG);
34
30 if (event) { 35 if (event) {
31 crtc->state->event = NULL; 36 crtc->state->event = NULL;
32 37
@@ -39,11 +44,15 @@ static void fsl_dcu_drm_crtc_atomic_flush(struct drm_crtc *crtc,
39 } 44 }
40} 45}
41 46
42static void fsl_dcu_drm_disable_crtc(struct drm_crtc *crtc) 47static void fsl_dcu_drm_crtc_atomic_disable(struct drm_crtc *crtc,
48 struct drm_crtc_state *old_crtc_state)
43{ 49{
44 struct drm_device *dev = crtc->dev; 50 struct drm_device *dev = crtc->dev;
45 struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; 51 struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;
46 52
53 /* always disable planes on the CRTC */
54 drm_atomic_helper_disable_planes_on_crtc(old_crtc_state, true);
55
47 drm_crtc_vblank_off(crtc); 56 drm_crtc_vblank_off(crtc);
48 57
49 regmap_update_bits(fsl_dev->regmap, DCU_DCU_MODE, 58 regmap_update_bits(fsl_dev->regmap, DCU_DCU_MODE,
@@ -122,8 +131,8 @@ static void fsl_dcu_drm_crtc_mode_set_nofb(struct drm_crtc *crtc)
122} 131}
123 132
124static const struct drm_crtc_helper_funcs fsl_dcu_drm_crtc_helper_funcs = { 133static const struct drm_crtc_helper_funcs fsl_dcu_drm_crtc_helper_funcs = {
134 .atomic_disable = fsl_dcu_drm_crtc_atomic_disable,
125 .atomic_flush = fsl_dcu_drm_crtc_atomic_flush, 135 .atomic_flush = fsl_dcu_drm_crtc_atomic_flush,
126 .disable = fsl_dcu_drm_disable_crtc,
127 .enable = fsl_dcu_drm_crtc_enable, 136 .enable = fsl_dcu_drm_crtc_enable,
128 .mode_set_nofb = fsl_dcu_drm_crtc_mode_set_nofb, 137 .mode_set_nofb = fsl_dcu_drm_crtc_mode_set_nofb,
129}; 138};
diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
index e04efbed1a54..cc2fde2ae5ef 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
@@ -59,8 +59,6 @@ static int fsl_dcu_drm_irq_init(struct drm_device *dev)
59 59
60 regmap_write(fsl_dev->regmap, DCU_INT_STATUS, 0); 60 regmap_write(fsl_dev->regmap, DCU_INT_STATUS, 0);
61 regmap_write(fsl_dev->regmap, DCU_INT_MASK, ~0); 61 regmap_write(fsl_dev->regmap, DCU_INT_MASK, ~0);
62 regmap_write(fsl_dev->regmap, DCU_UPDATE_MODE,
63 DCU_UPDATE_MODE_READREG);
64 62
65 return ret; 63 return ret;
66} 64}
@@ -139,8 +137,6 @@ static irqreturn_t fsl_dcu_drm_irq(int irq, void *arg)
139 drm_handle_vblank(dev, 0); 137 drm_handle_vblank(dev, 0);
140 138
141 regmap_write(fsl_dev->regmap, DCU_INT_STATUS, int_status); 139 regmap_write(fsl_dev->regmap, DCU_INT_STATUS, int_status);
142 regmap_write(fsl_dev->regmap, DCU_UPDATE_MODE,
143 DCU_UPDATE_MODE_READREG);
144 140
145 return IRQ_HANDLED; 141 return IRQ_HANDLED;
146} 142}
diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c
index 9e6f7d8112b3..a99f48847420 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c
+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c
@@ -160,11 +160,6 @@ static void fsl_dcu_drm_plane_atomic_update(struct drm_plane *plane,
160 DCU_LAYER_POST_SKIP(0) | 160 DCU_LAYER_POST_SKIP(0) |
161 DCU_LAYER_PRE_SKIP(0)); 161 DCU_LAYER_PRE_SKIP(0));
162 } 162 }
163 regmap_update_bits(fsl_dev->regmap, DCU_DCU_MODE,
164 DCU_MODE_DCU_MODE_MASK,
165 DCU_MODE_DCU_MODE(DCU_MODE_NORMAL));
166 regmap_write(fsl_dev->regmap,
167 DCU_UPDATE_MODE, DCU_UPDATE_MODE_READREG);
168 163
169 return; 164 return;
170} 165}