aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_fbcon.c34
1 files changed, 2 insertions, 32 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
index bce2e73b9ebd..153b9a15469b 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c
+++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
@@ -153,7 +153,7 @@ nouveau_fbcon_sync(struct fb_info *info)
153 struct drm_device *dev = nfbdev->dev; 153 struct drm_device *dev = nfbdev->dev;
154 struct drm_nouveau_private *dev_priv = dev->dev_private; 154 struct drm_nouveau_private *dev_priv = dev->dev_private;
155 struct nouveau_channel *chan = dev_priv->channel; 155 struct nouveau_channel *chan = dev_priv->channel;
156 int ret, i; 156 int ret;
157 157
158 if (!chan || !chan->accel_done || in_interrupt() || 158 if (!chan || !chan->accel_done || in_interrupt() ||
159 info->state != FBINFO_STATE_RUNNING || 159 info->state != FBINFO_STATE_RUNNING ||
@@ -163,38 +163,8 @@ nouveau_fbcon_sync(struct fb_info *info)
163 if (!mutex_trylock(&chan->mutex)) 163 if (!mutex_trylock(&chan->mutex))
164 return 0; 164 return 0;
165 165
166 ret = RING_SPACE(chan, 4); 166 ret = nouveau_channel_idle(chan);
167 if (ret) {
168 mutex_unlock(&chan->mutex);
169 nouveau_fbcon_gpu_lockup(info);
170 return 0;
171 }
172
173 if (dev_priv->card_type >= NV_C0) {
174 BEGIN_NVC0(chan, NvSub2D, 0x010c, 1);
175 OUT_RING (chan, 0);
176 BEGIN_NVC0(chan, NvSub2D, 0x0100, 1);
177 OUT_RING (chan, 0);
178 } else {
179 BEGIN_NV04(chan, 0, 0x0104, 1);
180 OUT_RING (chan, 0);
181 BEGIN_NV04(chan, 0, 0x0100, 1);
182 OUT_RING (chan, 0);
183 }
184
185 nouveau_bo_wr32(chan->notifier_bo, chan->m2mf_ntfy/4 + 3, 0xffffffff);
186 FIRE_RING(chan);
187 mutex_unlock(&chan->mutex); 167 mutex_unlock(&chan->mutex);
188
189 ret = -EBUSY;
190 for (i = 0; i < 100000; i++) {
191 if (!nouveau_bo_rd32(chan->notifier_bo, chan->m2mf_ntfy/4 + 3)) {
192 ret = 0;
193 break;
194 }
195 DRM_UDELAY(1);
196 }
197
198 if (ret) { 168 if (ret) {
199 nouveau_fbcon_gpu_lockup(info); 169 nouveau_fbcon_gpu_lockup(info);
200 return 0; 170 return 0;