nouveau: silence irq handler a bit

main
Ben Skeggs 2007-08-09 11:12:13 +10:00
parent 7281463f8d
commit 7784e8c6e7
1 changed files with 20 additions and 67 deletions

View File

@ -72,12 +72,10 @@ static void nouveau_fifo_irq_handler(struct drm_device *dev)
chstat = NV_READ(NV04_PFIFO_DMA); chstat = NV_READ(NV04_PFIFO_DMA);
channel=NV_READ(NV03_PFIFO_CACHE1_PUSH1)&(nouveau_fifo_number(dev)-1); channel=NV_READ(NV03_PFIFO_CACHE1_PUSH1)&(nouveau_fifo_number(dev)-1);
DRM_DEBUG("NV: PFIFO interrupt! Channel=%d, INTSTAT=0x%08x/MODE=0x%08x/PEND=0x%08x\n", channel, status, chmode, chstat);
if (status & NV_PFIFO_INTR_CACHE_ERROR) { if (status & NV_PFIFO_INTR_CACHE_ERROR) {
uint32_t c1get, c1method, c1data; uint32_t c1get, c1method, c1data;
DRM_ERROR("NV: PFIFO error interrupt\n"); DRM_ERROR("PFIFO error interrupt\n");
c1get = NV_READ(NV03_PFIFO_CACHE1_GET) >> 2; c1get = NV_READ(NV03_PFIFO_CACHE1_GET) >> 2;
if (dev_priv->card_type < NV_40) { if (dev_priv->card_type < NV_40) {
@ -89,17 +87,17 @@ static void nouveau_fifo_irq_handler(struct drm_device *dev)
c1data = NV_READ(NV40_PFIFO_CACHE1_DATA(c1get)); c1data = NV_READ(NV40_PFIFO_CACHE1_DATA(c1get));
} }
DRM_ERROR("NV: Channel %d/%d - Method 0x%04x, Data 0x%08x\n", DRM_ERROR("Channel %d/%d - Method 0x%04x, Data 0x%08x\n",
channel, (c1method >> 13) & 7, channel, (c1method >> 13) & 7, c1method & 0x1ffc,
c1method & 0x1ffc, c1data c1data);
);
status &= ~NV_PFIFO_INTR_CACHE_ERROR; status &= ~NV_PFIFO_INTR_CACHE_ERROR;
NV_WRITE(NV03_PFIFO_INTR_0, NV_PFIFO_INTR_CACHE_ERROR); NV_WRITE(NV03_PFIFO_INTR_0, NV_PFIFO_INTR_CACHE_ERROR);
} }
if (status & NV_PFIFO_INTR_DMA_PUSHER) { if (status & NV_PFIFO_INTR_DMA_PUSHER) {
DRM_INFO("NV: PFIFO DMA pusher interrupt\n"); DRM_ERROR("PFIFO DMA pusher interrupt: ch%d, 0x%08x\n",
channel, NV_READ(NV04_PFIFO_CACHE1_DMA_GET));
status &= ~NV_PFIFO_INTR_DMA_PUSHER; status &= ~NV_PFIFO_INTR_DMA_PUSHER;
NV_WRITE(NV03_PFIFO_INTR_0, NV_PFIFO_INTR_DMA_PUSHER); NV_WRITE(NV03_PFIFO_INTR_0, NV_PFIFO_INTR_DMA_PUSHER);
@ -113,7 +111,7 @@ static void nouveau_fifo_irq_handler(struct drm_device *dev)
} }
if (status) { if (status) {
DRM_INFO("NV: unknown PFIFO interrupt. status=0x%08x\n", status); DRM_ERROR("Unhandled PFIFO interrupt: status=0x%08x\n", status);
NV_WRITE(NV03_PFIFO_INTR_0, status); NV_WRITE(NV03_PFIFO_INTR_0, status);
} }
@ -311,77 +309,31 @@ nouveau_graph_dump_trap_info(struct drm_device *dev)
ARRAY_SIZE(nouveau_nstatus_names)); ARRAY_SIZE(nouveau_nstatus_names));
printk("\n"); printk("\n");
DRM_ERROR("NV: Channel %d/%d (class 0x%04x) - " DRM_ERROR("Channel %d/%d (class 0x%04x) - Method 0x%04x, Data 0x%08x\n",
"Method 0x%04x, Data 0x%08x\n", channel, subc, class, method, data);
channel, subc, class, method, data
);
} }
static void nouveau_pgraph_irq_handler(struct drm_device *dev) static void nouveau_pgraph_irq_handler(struct drm_device *dev)
{ {
uint32_t status;
struct drm_nouveau_private *dev_priv = dev->dev_private; struct drm_nouveau_private *dev_priv = dev->dev_private;
uint32_t status, nsource;
status = NV_READ(NV03_PGRAPH_INTR); status = NV_READ(NV03_PGRAPH_INTR);
if (!status) if (!status)
return; return;
nsource = NV_READ(NV03_PGRAPH_NSOURCE);
if (status & NV_PGRAPH_INTR_NOTIFY) { if (status & NV_PGRAPH_INTR_NOTIFY) {
uint32_t nsource, nstatus, instance, notify; DRM_DEBUG("PGRAPH notify interrupt\n");
DRM_DEBUG("NV: PGRAPH notify interrupt\n");
nstatus = NV_READ(NV03_PGRAPH_NSTATUS); nouveau_graph_dump_trap_info(dev);
nsource = NV_READ(NV03_PGRAPH_NSOURCE);
DRM_DEBUG("nsource:0x%08x\tnstatus:0x%08x\n", nsource, nstatus);
/* if this wasn't NOTIFICATION_PENDING, dump extra trap info */
if (nsource & ~(1<<0)) {
nouveau_graph_dump_trap_info(dev);
} else {
instance = NV_READ(0x00400158);
notify = NV_READ(0x00400150) >> 16;
DRM_DEBUG("instance:0x%08x\tnotify:0x%08x\n",
instance, notify);
}
status &= ~NV_PGRAPH_INTR_NOTIFY; status &= ~NV_PGRAPH_INTR_NOTIFY;
NV_WRITE(NV03_PGRAPH_INTR, NV_PGRAPH_INTR_NOTIFY); NV_WRITE(NV03_PGRAPH_INTR, NV_PGRAPH_INTR_NOTIFY);
} }
if (status & NV_PGRAPH_INTR_BUFFER_NOTIFY) {
uint32_t nsource, nstatus, instance, notify;
DRM_DEBUG("NV: PGRAPH buffer notify interrupt\n");
nstatus = NV_READ(NV03_PGRAPH_NSTATUS);
nsource = NV_READ(NV03_PGRAPH_NSOURCE);
DRM_DEBUG("nsource:0x%08x\tnstatus:0x%08x\n", nsource, nstatus);
instance = NV_READ(0x00400158);
notify = NV_READ(0x00400150) >> 16;
DRM_DEBUG("instance:0x%08x\tnotify:0x%08x\n", instance, notify);
status &= ~NV_PGRAPH_INTR_BUFFER_NOTIFY;
NV_WRITE(NV03_PGRAPH_INTR, NV_PGRAPH_INTR_BUFFER_NOTIFY);
}
if (status & NV_PGRAPH_INTR_MISSING_HW) {
DRM_ERROR("NV: PGRAPH missing hw interrupt\n");
status &= ~NV_PGRAPH_INTR_MISSING_HW;
NV_WRITE(NV03_PGRAPH_INTR, NV_PGRAPH_INTR_MISSING_HW);
}
if (status & NV_PGRAPH_INTR_ERROR) { if (status & NV_PGRAPH_INTR_ERROR) {
uint32_t nsource, nstatus, instance; DRM_ERROR("PGRAPH error interrupt\n");
DRM_ERROR("NV: PGRAPH error interrupt\n");
nstatus = NV_READ(NV03_PGRAPH_NSTATUS);
nsource = NV_READ(NV03_PGRAPH_NSOURCE);
DRM_ERROR("nsource:0x%08x\tnstatus:0x%08x\n", nsource, nstatus);
instance = NV_READ(0x00400158);
DRM_ERROR("instance:0x%08x\n", instance);
nouveau_graph_dump_trap_info(dev); nouveau_graph_dump_trap_info(dev);
@ -391,7 +343,7 @@ static void nouveau_pgraph_irq_handler(struct drm_device *dev)
if (status & NV_PGRAPH_INTR_CONTEXT_SWITCH) { if (status & NV_PGRAPH_INTR_CONTEXT_SWITCH) {
uint32_t channel=NV_READ(NV03_PFIFO_CACHE1_PUSH1)&(nouveau_fifo_number(dev)-1); uint32_t channel=NV_READ(NV03_PFIFO_CACHE1_PUSH1)&(nouveau_fifo_number(dev)-1);
DRM_INFO("NV: PGRAPH context switch interrupt channel %x\n",channel); DRM_DEBUG("PGRAPH context switch interrupt channel %x\n",channel);
switch(dev_priv->card_type) switch(dev_priv->card_type)
{ {
case NV_04: case NV_04:
@ -408,7 +360,7 @@ static void nouveau_pgraph_irq_handler(struct drm_device *dev)
nouveau_nv20_context_switch(dev); nouveau_nv20_context_switch(dev);
break; break;
default: default:
DRM_INFO("NV: Context switch not implemented\n"); DRM_ERROR("Context switch not implemented\n");
break; break;
} }
@ -417,7 +369,7 @@ static void nouveau_pgraph_irq_handler(struct drm_device *dev)
} }
if (status) { if (status) {
DRM_INFO("NV: Unknown PGRAPH interrupt! STAT=0x%08x\n", status); DRM_ERROR("Unhandled PGRAPH interrupt: STAT=0x%08x\n", status);
NV_WRITE(NV03_PGRAPH_INTR, status); NV_WRITE(NV03_PGRAPH_INTR, status);
} }
@ -427,6 +379,7 @@ static void nouveau_pgraph_irq_handler(struct drm_device *dev)
static void nouveau_crtc_irq_handler(struct drm_device *dev, int crtc) static void nouveau_crtc_irq_handler(struct drm_device *dev, int crtc)
{ {
struct drm_nouveau_private *dev_priv = dev->dev_private; struct drm_nouveau_private *dev_priv = dev->dev_private;
if (crtc&1) { if (crtc&1) {
NV_WRITE(NV_CRTC0_INTSTAT, NV_CRTC_INTR_VBLANK); NV_WRITE(NV_CRTC0_INTSTAT, NV_CRTC_INTR_VBLANK);
} }
@ -446,16 +399,16 @@ irqreturn_t nouveau_irq_handler(DRM_IRQ_ARGS)
if (!status) if (!status)
return IRQ_NONE; return IRQ_NONE;
DRM_DEBUG("PMC INTSTAT: 0x%08x\n", status);
if (status & NV_PMC_INTR_0_PFIFO_PENDING) { if (status & NV_PMC_INTR_0_PFIFO_PENDING) {
nouveau_fifo_irq_handler(dev); nouveau_fifo_irq_handler(dev);
status &= ~NV_PMC_INTR_0_PFIFO_PENDING; status &= ~NV_PMC_INTR_0_PFIFO_PENDING;
} }
if (status & NV_PMC_INTR_0_PGRAPH_PENDING) { if (status & NV_PMC_INTR_0_PGRAPH_PENDING) {
nouveau_pgraph_irq_handler(dev); nouveau_pgraph_irq_handler(dev);
status &= ~NV_PMC_INTR_0_PGRAPH_PENDING; status &= ~NV_PMC_INTR_0_PGRAPH_PENDING;
} }
if (status & NV_PMC_INTR_0_CRTCn_PENDING) { if (status & NV_PMC_INTR_0_CRTCn_PENDING) {
nouveau_crtc_irq_handler(dev, (status>>24)&3); nouveau_crtc_irq_handler(dev, (status>>24)&3);
status &= ~NV_PMC_INTR_0_CRTCn_PENDING; status &= ~NV_PMC_INTR_0_CRTCn_PENDING;