aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-07-19 21:04:46 -0400
committerBen Skeggs <bskeggs@redhat.com>2011-07-24 19:42:27 -0400
commit70ad25ab735a016c48183875f657d90d592b773d (patch)
tree9596e372527faf3e924ae3bab421bbfb2bf8b8d8 /drivers/gpu/drm
parent12a30e267c162145df3c104d0f4aabff7bce56a5 (diff)
drm/nouveau: replace nv04_graph_fifo_access() use with direct reg bashing
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_drv.h1
-rw-r--r--drivers/gpu/drm/nouveau/nv04_graph.c15
-rw-r--r--drivers/gpu/drm/nouveau/nv10_graph.c8
-rw-r--r--drivers/gpu/drm/nouveau/nv20_graph.c4
4 files changed, 8 insertions, 20 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h
index 72bfc143eb47..d0bd010585ab 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drv.h
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.h
@@ -1142,7 +1142,6 @@ extern int nvc0_fifo_unload_context(struct drm_device *);
1142 1142
1143/* nv04_graph.c */ 1143/* nv04_graph.c */
1144extern int nv04_graph_create(struct drm_device *); 1144extern int nv04_graph_create(struct drm_device *);
1145extern void nv04_graph_fifo_access(struct drm_device *, bool);
1146extern int nv04_graph_object_new(struct nouveau_channel *, int, u32, u16); 1145extern int nv04_graph_object_new(struct nouveau_channel *, int, u32, u16);
1147extern int nv04_graph_mthd_page_flip(struct nouveau_channel *chan, 1146extern int nv04_graph_mthd_page_flip(struct nouveau_channel *chan,
1148 u32 class, u32 mthd, u32 data); 1147 u32 class, u32 mthd, u32 data);
diff --git a/drivers/gpu/drm/nouveau/nv04_graph.c b/drivers/gpu/drm/nouveau/nv04_graph.c
index 3626ee7db3ba..412979352c35 100644
--- a/drivers/gpu/drm/nouveau/nv04_graph.c
+++ b/drivers/gpu/drm/nouveau/nv04_graph.c
@@ -450,13 +450,13 @@ nv04_graph_context_del(struct nouveau_channel *chan, int engine)
450 unsigned long flags; 450 unsigned long flags;
451 451
452 spin_lock_irqsave(&dev_priv->context_switch_lock, flags); 452 spin_lock_irqsave(&dev_priv->context_switch_lock, flags);
453 nv04_graph_fifo_access(dev, false); 453 nv_mask(dev, NV04_PGRAPH_FIFO, 0x00000001, 0x00000000);
454 454
455 /* Unload the context if it's the currently active one */ 455 /* Unload the context if it's the currently active one */
456 if (nv04_graph_channel(dev) == chan) 456 if (nv04_graph_channel(dev) == chan)
457 nv04_graph_unload_context(dev); 457 nv04_graph_unload_context(dev);
458 458
459 nv04_graph_fifo_access(dev, true); 459 nv_mask(dev, NV04_PGRAPH_FIFO, 0x00000001, 0x00000001);
460 spin_unlock_irqrestore(&dev_priv->context_switch_lock, flags); 460 spin_unlock_irqrestore(&dev_priv->context_switch_lock, flags);
461 461
462 /* Free the context resources */ 462 /* Free the context resources */
@@ -545,17 +545,6 @@ nv04_graph_fini(struct drm_device *dev, int engine)
545 return 0; 545 return 0;
546} 546}
547 547
548void
549nv04_graph_fifo_access(struct drm_device *dev, bool enabled)
550{
551 if (enabled)
552 nv_wr32(dev, NV04_PGRAPH_FIFO,
553 nv_rd32(dev, NV04_PGRAPH_FIFO) | 1);
554 else
555 nv_wr32(dev, NV04_PGRAPH_FIFO,
556 nv_rd32(dev, NV04_PGRAPH_FIFO) & ~1);
557}
558
559static int 548static int
560nv04_graph_mthd_set_ref(struct nouveau_channel *chan, 549nv04_graph_mthd_set_ref(struct nouveau_channel *chan,
561 u32 class, u32 mthd, u32 data) 550 u32 class, u32 mthd, u32 data)
diff --git a/drivers/gpu/drm/nouveau/nv10_graph.c b/drivers/gpu/drm/nouveau/nv10_graph.c
index 0930c6cb88e0..25675225750c 100644
--- a/drivers/gpu/drm/nouveau/nv10_graph.c
+++ b/drivers/gpu/drm/nouveau/nv10_graph.c
@@ -708,8 +708,8 @@ static void nv10_graph_load_dma_vtxbuf(struct nouveau_channel *chan,
708 0x2c000000 | chan->id << 20 | subchan << 16 | 0x18c); 708 0x2c000000 | chan->id << 20 | subchan << 16 | 0x18c);
709 nv_wr32(dev, NV10_PGRAPH_FFINTFC_ST2_DL, inst); 709 nv_wr32(dev, NV10_PGRAPH_FFINTFC_ST2_DL, inst);
710 nv_mask(dev, NV10_PGRAPH_CTX_CONTROL, 0, 0x10000); 710 nv_mask(dev, NV10_PGRAPH_CTX_CONTROL, 0, 0x10000);
711 nv04_graph_fifo_access(dev, true); 711 nv_mask(dev, NV04_PGRAPH_FIFO, 0x00000001, 0x00000001);
712 nv04_graph_fifo_access(dev, false); 712 nv_mask(dev, NV04_PGRAPH_FIFO, 0x00000001, 0x00000000);
713 713
714 /* Restore the FIFO state */ 714 /* Restore the FIFO state */
715 for (i = 0; i < ARRAY_SIZE(fifo); i++) 715 for (i = 0; i < ARRAY_SIZE(fifo); i++)
@@ -879,13 +879,13 @@ nv10_graph_context_del(struct nouveau_channel *chan, int engine)
879 unsigned long flags; 879 unsigned long flags;
880 880
881 spin_lock_irqsave(&dev_priv->context_switch_lock, flags); 881 spin_lock_irqsave(&dev_priv->context_switch_lock, flags);
882 nv04_graph_fifo_access(dev, false); 882 nv_mask(dev, NV04_PGRAPH_FIFO, 0x00000001, 0x00000000);
883 883
884 /* Unload the context if it's the currently active one */ 884 /* Unload the context if it's the currently active one */
885 if (nv10_graph_channel(dev) == chan) 885 if (nv10_graph_channel(dev) == chan)
886 nv10_graph_unload_context(dev); 886 nv10_graph_unload_context(dev);
887 887
888 nv04_graph_fifo_access(dev, true); 888 nv_mask(dev, NV04_PGRAPH_FIFO, 0x00000001, 0x00000001);
889 spin_unlock_irqrestore(&dev_priv->context_switch_lock, flags); 889 spin_unlock_irqrestore(&dev_priv->context_switch_lock, flags);
890 890
891 /* Free the context resources */ 891 /* Free the context resources */
diff --git a/drivers/gpu/drm/nouveau/nv20_graph.c b/drivers/gpu/drm/nouveau/nv20_graph.c
index f8736270f62f..3791222f20b9 100644
--- a/drivers/gpu/drm/nouveau/nv20_graph.c
+++ b/drivers/gpu/drm/nouveau/nv20_graph.c
@@ -454,13 +454,13 @@ nv20_graph_context_del(struct nouveau_channel *chan, int engine)
454 unsigned long flags; 454 unsigned long flags;
455 455
456 spin_lock_irqsave(&dev_priv->context_switch_lock, flags); 456 spin_lock_irqsave(&dev_priv->context_switch_lock, flags);
457 nv04_graph_fifo_access(dev, false); 457 nv_mask(dev, NV04_PGRAPH_FIFO, 0x00000001, 0x00000000);
458 458
459 /* Unload the context if it's the currently active one */ 459 /* Unload the context if it's the currently active one */
460 if (nv10_graph_channel(dev) == chan) 460 if (nv10_graph_channel(dev) == chan)
461 nv20_graph_unload_context(dev); 461 nv20_graph_unload_context(dev);
462 462
463 nv04_graph_fifo_access(dev, true); 463 nv_mask(dev, NV04_PGRAPH_FIFO, 0x00000001, 0x00000001);
464 spin_unlock_irqrestore(&dev_priv->context_switch_lock, flags); 464 spin_unlock_irqrestore(&dev_priv->context_switch_lock, flags);
465 465
466 /* Free the context resources */ 466 /* Free the context resources */