diff options
author | Jiri Slaby <jslaby@suse.cz> | 2010-10-05 09:07:33 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-11-17 23:38:07 -0500 |
commit | da3bd8203082794d26de3a0a6a7d1ee639d07eb1 (patch) | |
tree | f8f9b67876023bba953f53227052c34600452b4a /drivers/gpu/drm/nouveau/nouveau_irq.c | |
parent | 0143832cc96d0bf78486297aad5c8fb2c2ead02a (diff) |
drm/nouveau: ratelimit IRQ messages
There are two messages in the ISR of nouveau which might be printed out
hundred times in a second. Ratelimit them. (We need to move
nouveau_ratelimit to the top of the file.)
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Reviewed-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_irq.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_irq.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_irq.c b/drivers/gpu/drm/nouveau/nouveau_irq.c index 6fd51a51c608..b9e1ffed8557 100644 --- a/drivers/gpu/drm/nouveau/nouveau_irq.c +++ b/drivers/gpu/drm/nouveau/nouveau_irq.c | |||
@@ -42,6 +42,13 @@ | |||
42 | #include "nouveau_connector.h" | 42 | #include "nouveau_connector.h" |
43 | #include "nv50_display.h" | 43 | #include "nv50_display.h" |
44 | 44 | ||
45 | static DEFINE_RATELIMIT_STATE(nouveau_ratelimit_state, 3 * HZ, 20); | ||
46 | |||
47 | static int nouveau_ratelimit(void) | ||
48 | { | ||
49 | return __ratelimit(&nouveau_ratelimit_state); | ||
50 | } | ||
51 | |||
45 | void | 52 | void |
46 | nouveau_irq_preinstall(struct drm_device *dev) | 53 | nouveau_irq_preinstall(struct drm_device *dev) |
47 | { | 54 | { |
@@ -213,11 +220,12 @@ nouveau_fifo_irq_handler(struct drm_device *dev) | |||
213 | u32 ib_get = nv_rd32(dev, 0x003334); | 220 | u32 ib_get = nv_rd32(dev, 0x003334); |
214 | u32 ib_put = nv_rd32(dev, 0x003330); | 221 | u32 ib_put = nv_rd32(dev, 0x003330); |
215 | 222 | ||
216 | NV_INFO(dev, "PFIFO_DMA_PUSHER - Ch %d Get 0x%02x%08x " | 223 | if (nouveau_ratelimit()) |
224 | NV_INFO(dev, "PFIFO_DMA_PUSHER - Ch %d Get 0x%02x%08x " | ||
217 | "Put 0x%02x%08x IbGet 0x%08x IbPut 0x%08x " | 225 | "Put 0x%02x%08x IbGet 0x%08x IbPut 0x%08x " |
218 | "State 0x%08x Push 0x%08x\n", | 226 | "State 0x%08x Push 0x%08x\n", |
219 | chid, ho_get, get, ho_put, put, ib_get, ib_put, | 227 | chid, ho_get, get, ho_put, put, |
220 | state, push); | 228 | ib_get, ib_put, state, push); |
221 | 229 | ||
222 | /* METHOD_COUNT, in DMA_STATE on earlier chipsets */ | 230 | /* METHOD_COUNT, in DMA_STATE on earlier chipsets */ |
223 | nv_wr32(dev, 0x003364, 0x00000000); | 231 | nv_wr32(dev, 0x003364, 0x00000000); |
@@ -266,8 +274,9 @@ nouveau_fifo_irq_handler(struct drm_device *dev) | |||
266 | } | 274 | } |
267 | 275 | ||
268 | if (status) { | 276 | if (status) { |
269 | NV_INFO(dev, "PFIFO_INTR 0x%08x - Ch %d\n", | 277 | if (nouveau_ratelimit()) |
270 | status, chid); | 278 | NV_INFO(dev, "PFIFO_INTR 0x%08x - Ch %d\n", |
279 | status, chid); | ||
271 | nv_wr32(dev, NV03_PFIFO_INTR_0, status); | 280 | nv_wr32(dev, NV03_PFIFO_INTR_0, status); |
272 | status = 0; | 281 | status = 0; |
273 | } | 282 | } |
@@ -544,13 +553,6 @@ nouveau_pgraph_intr_notify(struct drm_device *dev, uint32_t nsource) | |||
544 | nouveau_graph_dump_trap_info(dev, "PGRAPH_NOTIFY", &trap); | 553 | nouveau_graph_dump_trap_info(dev, "PGRAPH_NOTIFY", &trap); |
545 | } | 554 | } |
546 | 555 | ||
547 | static DEFINE_RATELIMIT_STATE(nouveau_ratelimit_state, 3 * HZ, 20); | ||
548 | |||
549 | static int nouveau_ratelimit(void) | ||
550 | { | ||
551 | return __ratelimit(&nouveau_ratelimit_state); | ||
552 | } | ||
553 | |||
554 | 556 | ||
555 | static inline void | 557 | static inline void |
556 | nouveau_pgraph_intr_error(struct drm_device *dev, uint32_t nsource) | 558 | nouveau_pgraph_intr_error(struct drm_device *dev, uint32_t nsource) |