diff options
Diffstat (limited to 'drivers/gpu/drm/nouveau')
-rw-r--r-- | drivers/gpu/drm/nouveau/nv50_graph.c | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/drivers/gpu/drm/nouveau/nv50_graph.c b/drivers/gpu/drm/nouveau/nv50_graph.c index 69be4d190778..46b2c95de4d0 100644 --- a/drivers/gpu/drm/nouveau/nv50_graph.c +++ b/drivers/gpu/drm/nouveau/nv50_graph.c | |||
@@ -40,47 +40,6 @@ struct nv50_graph_engine { | |||
40 | }; | 40 | }; |
41 | 41 | ||
42 | static int | 42 | static int |
43 | nv50_graph_do_load_context(struct drm_device *dev, uint32_t inst) | ||
44 | { | ||
45 | uint32_t fifo = nv_rd32(dev, 0x400500); | ||
46 | |||
47 | nv_wr32(dev, 0x400500, fifo & ~1); | ||
48 | nv_wr32(dev, 0x400784, inst); | ||
49 | nv_wr32(dev, 0x400824, nv_rd32(dev, 0x400824) | 0x40); | ||
50 | nv_wr32(dev, 0x400320, nv_rd32(dev, 0x400320) | 0x11); | ||
51 | nv_wr32(dev, 0x400040, 0xffffffff); | ||
52 | (void)nv_rd32(dev, 0x400040); | ||
53 | nv_wr32(dev, 0x400040, 0x00000000); | ||
54 | nv_wr32(dev, 0x400304, nv_rd32(dev, 0x400304) | 1); | ||
55 | |||
56 | if (nouveau_wait_for_idle(dev)) | ||
57 | nv_wr32(dev, 0x40032c, inst | (1<<31)); | ||
58 | nv_wr32(dev, 0x400500, fifo); | ||
59 | |||
60 | return 0; | ||
61 | } | ||
62 | |||
63 | static int | ||
64 | nv50_graph_unload_context(struct drm_device *dev) | ||
65 | { | ||
66 | uint32_t inst; | ||
67 | |||
68 | inst = nv_rd32(dev, NV50_PGRAPH_CTXCTL_CUR); | ||
69 | if (!(inst & NV50_PGRAPH_CTXCTL_CUR_LOADED)) | ||
70 | return 0; | ||
71 | inst &= NV50_PGRAPH_CTXCTL_CUR_INSTANCE; | ||
72 | |||
73 | nouveau_wait_for_idle(dev); | ||
74 | nv_wr32(dev, 0x400784, inst); | ||
75 | nv_wr32(dev, 0x400824, nv_rd32(dev, 0x400824) | 0x20); | ||
76 | nv_wr32(dev, 0x400304, nv_rd32(dev, 0x400304) | 0x01); | ||
77 | nouveau_wait_for_idle(dev); | ||
78 | |||
79 | nv_wr32(dev, NV50_PGRAPH_CTXCTL_CUR, inst); | ||
80 | return 0; | ||
81 | } | ||
82 | |||
83 | static int | ||
84 | nv50_graph_init(struct drm_device *dev, int engine) | 43 | nv50_graph_init(struct drm_device *dev, int engine) |
85 | { | 44 | { |
86 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 45 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
@@ -255,21 +214,6 @@ nv50_graph_object_new(struct nouveau_channel *chan, int engine, | |||
255 | } | 214 | } |
256 | 215 | ||
257 | static void | 216 | static void |
258 | nv50_graph_context_switch(struct drm_device *dev) | ||
259 | { | ||
260 | uint32_t inst; | ||
261 | |||
262 | nv50_graph_unload_context(dev); | ||
263 | |||
264 | inst = nv_rd32(dev, NV50_PGRAPH_CTXCTL_NEXT); | ||
265 | inst &= NV50_PGRAPH_CTXCTL_NEXT_INSTANCE; | ||
266 | nv50_graph_do_load_context(dev, inst); | ||
267 | |||
268 | nv_wr32(dev, NV40_PGRAPH_INTR_EN, nv_rd32(dev, | ||
269 | NV40_PGRAPH_INTR_EN) | NV_PGRAPH_INTR_CONTEXT_SWITCH); | ||
270 | } | ||
271 | |||
272 | static void | ||
273 | nv50_graph_tlb_flush(struct drm_device *dev, int engine) | 217 | nv50_graph_tlb_flush(struct drm_device *dev, int engine) |
274 | { | 218 | { |
275 | nv50_vm_flush_engine(dev, 0); | 219 | nv50_vm_flush_engine(dev, 0); |
@@ -805,15 +749,6 @@ nv50_graph_isr(struct drm_device *dev) | |||
805 | show &= ~0x00000010; | 749 | show &= ~0x00000010; |
806 | } | 750 | } |
807 | 751 | ||
808 | if (stat & 0x00001000) { | ||
809 | nv_wr32(dev, 0x400500, 0x00000000); | ||
810 | nv_wr32(dev, 0x400100, 0x00001000); | ||
811 | nv_mask(dev, 0x40013c, 0x00001000, 0x00000000); | ||
812 | nv50_graph_context_switch(dev); | ||
813 | stat &= ~0x00001000; | ||
814 | show &= ~0x00001000; | ||
815 | } | ||
816 | |||
817 | show = (show && nouveau_ratelimit()) ? show : 0; | 752 | show = (show && nouveau_ratelimit()) ? show : 0; |
818 | 753 | ||
819 | if (show & 0x00100000) { | 754 | if (show & 0x00100000) { |