From 097db7a9b0cd0e53fb82dffa57c662f327c19670 Mon Sep 17 00:00:00 2001 From: Matthieu Castet Date: Sat, 29 Sep 2007 23:05:44 +0200 Subject: nouveau : nv1x fix strange corruption that appears when running glxgears and nouveau demo --- shared-core/nv10_graph.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/shared-core/nv10_graph.c b/shared-core/nv10_graph.c index 311e0e91..c115ba7f 100644 --- a/shared-core/nv10_graph.c +++ b/shared-core/nv10_graph.c @@ -714,7 +714,7 @@ void nouveau_nv10_context_switch(struct drm_device *dev) next = dev_priv->fifos[chid]; if (!next) { - DRM_DEBUG("Invalid next channel\n"); + DRM_ERROR("Invalid next channel\n"); return; } @@ -722,7 +722,7 @@ void nouveau_nv10_context_switch(struct drm_device *dev) last = dev_priv->fifos[chid]; if (!last) { - DRM_DEBUG("WARNING: Invalid last channel, switch to %x\n", + DRM_INFO("WARNING: Invalid last channel, switch to %x\n", next->id); } else { DRM_DEBUG("NV: PGRAPH context switch interrupt channel %x -> %x\n", @@ -827,6 +827,9 @@ void nv10_graph_destroy_context(struct nouveau_channel *chan) int chid; chid = (NV_READ(NV10_PGRAPH_CTX_USER) >> 24) & (nouveau_fifo_number(dev)-1); + /* This code seems to corrupt the 3D pipe, but blob seems to do similar things ???? + */ +#if 0 /* does this avoid a potential context switch while we are written graph * reg, or we should mask graph interrupt ??? */ @@ -838,7 +841,12 @@ void nv10_graph_destroy_context(struct nouveau_channel *chan) nv10_graph_create_context(chan); nv10_graph_load_context(chan); } - NV_WRITE(NV04_PGRAPH_FIFO,0x1); + NV_WRITE(NV04_PGRAPH_FIFO, 0x1); +#else + if (chid == chan->id) { + DRM_INFO("cleanning a channel with graph in current context\n"); + } +#endif } int nv10_graph_init(struct drm_device *dev) { -- cgit v1.2.3