diff options
| author | Stephane Marchesin <marchesin@icps.u-strasbg.fr> | 2007-01-05 20:50:46 +0100 | 
|---|---|---|
| committer | Stephane Marchesin <marchesin@icps.u-strasbg.fr> | 2007-01-05 20:50:46 +0100 | 
| commit | d99c7c27e2df1a7093f3d2f5c7d196f58bfe1647 (patch) | |
| tree | 37a2028b05c8f02ea07d29ee48c4233fbd73a614 /shared-core/nouveau_irq.c | |
| parent | 025f281bbfe81960e8c60234f5eafd37cbe2d881 (diff) | |
| parent | 0f95ddc42892abdbc1f111b6b105f2ef4ed2b05f (diff) | |
Merge branch 'master' of git+ssh://marcheu@git.freedesktop.org/git/mesa/drm
Diffstat (limited to 'shared-core/nouveau_irq.c')
| -rw-r--r-- | shared-core/nouveau_irq.c | 37 | 
1 files changed, 24 insertions, 13 deletions
diff --git a/shared-core/nouveau_irq.c b/shared-core/nouveau_irq.c index 160016ea..7a31fb0b 100644 --- a/shared-core/nouveau_irq.c +++ b/shared-core/nouveau_irq.c @@ -240,21 +240,32 @@ static void nouveau_nv04_context_switch(drm_device_t *dev)  static void nouveau_nv10_context_switch(drm_device_t *dev)  {  	drm_nouveau_private_t *dev_priv = dev->dev_private; -	int channel; +	int channel, channel_old;  	channel=NV_READ(NV_PFIFO_CACH1_PSH1)&(nouveau_fifo_number(dev)-1); -	/* 2-channel commute */ -//	if (channel==0) -//		channel=1; -//	else -//		channel=0; -//	dev_priv->cur_fifo=channel; - -//	NV_WRITE(NV_PGRAPH_CTX_CONTROL, 0x10000100); -	NV_WRITE(NV_PGRAPH_CTX_USER, NV_READ(NV_PGRAPH_CTX_USER)|0x1F000000); -//	NV_WRITE(NV_PGRAPH_FFINTFC_ST2, NV_READ(NV_PGRAPH_FFINTFC_ST2)&0xCFFFFFFF); -	/* touch PGRAPH_CTX_SWITCH* here ? */ -	NV_WRITE(NV_PGRAPH_CTX_CONTROL, 0x10000100); +	channel_old = (NV_READ(NV_PGRAPH_CTX_USER) >> 24) & (nouveau_fifo_number(dev)-1); + +	DRM_INFO("NV: PGRAPH context switch interrupt channel %x -> %x\n",channel_old, channel); + +	NV_WRITE(NV_PGRAPH_FIFO,0x0); +	NV_WRITE(NV_PFIFO_CACH1_PUL0, 0x00000000); +	NV_WRITE(NV_PFIFO_CACH1_PUL1, 0x00000000); +	NV_WRITE(NV_PFIFO_CACHES, 0x00000000); + +	dev_priv->fifos[channel_old].pgraph_ctx_user = NV_READ(NV_PGRAPH_CTX_USER); +	//XXX save PGRAPH context +	NV_WRITE(NV_PGRAPH_CTX_CONTROL, 0x10000000); +	NV_WRITE(NV_PGRAPH_CTX_USER, dev_priv->fifos[channel].pgraph_ctx_user); +	//XXX restore PGRAPH context +	printk("ctx_user %x %x\n", dev_priv->fifos[channel_old].pgraph_ctx_user, dev_priv->fifos[channel].pgraph_ctx_user); + +	NV_WRITE(NV_PGRAPH_FFINTFC_ST2, NV_READ(NV_PGRAPH_FFINTFC_ST2)&0xCFFFFFFF); +	NV_WRITE(NV_PGRAPH_CTX_CONTROL, 0x10010100); + +	NV_WRITE(NV_PFIFO_CACH1_PUL0, 0x00000001); +	NV_WRITE(NV_PFIFO_CACH1_PUL1, 0x00000001); +	NV_WRITE(NV_PFIFO_CACHES, 0x00000001); +	NV_WRITE(NV_PGRAPH_FIFO,0x1);  }  static void nouveau_pgraph_irq_handler(drm_device_t *dev)  | 
