diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2012-11-21 21:37:30 -0500 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2012-11-28 18:58:02 -0500 |
commit | 3cb0ebddd05b5bbdbd7d7214ee6983a034a0b0be (patch) | |
tree | d7ec511f9a7879a9fee1389b89f258932fa56870 /drivers/gpu/drm/nouveau | |
parent | 586ae46d656b1086cab74b4ade4a3e82e56e980b (diff) |
drm/nouveau/copy: remove nouveau_copy base class
nva3/nvc0 are using falcon, nve0 is now using engine directly.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau')
-rw-r--r-- | drivers/gpu/drm/nouveau/core/engine/copy/nve0.c | 36 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/core/include/engine/copy.h | 39 |
2 files changed, 19 insertions, 56 deletions
diff --git a/drivers/gpu/drm/nouveau/core/engine/copy/nve0.c b/drivers/gpu/drm/nouveau/core/engine/copy/nve0.c index 2017c1579ac..889f1f0788f 100644 --- a/drivers/gpu/drm/nouveau/core/engine/copy/nve0.c +++ b/drivers/gpu/drm/nouveau/core/engine/copy/nve0.c | |||
@@ -30,11 +30,11 @@ | |||
30 | #include <engine/copy.h> | 30 | #include <engine/copy.h> |
31 | 31 | ||
32 | struct nve0_copy_priv { | 32 | struct nve0_copy_priv { |
33 | struct nouveau_copy base; | 33 | struct nouveau_engine base; |
34 | }; | 34 | }; |
35 | 35 | ||
36 | struct nve0_copy_chan { | 36 | struct nve0_copy_chan { |
37 | struct nouveau_copy_chan base; | 37 | struct nouveau_engctx base; |
38 | }; | 38 | }; |
39 | 39 | ||
40 | /******************************************************************************* | 40 | /******************************************************************************* |
@@ -60,8 +60,8 @@ nve0_copy_context_ctor(struct nouveau_object *parent, | |||
60 | struct nve0_copy_chan *priv; | 60 | struct nve0_copy_chan *priv; |
61 | int ret; | 61 | int ret; |
62 | 62 | ||
63 | ret = nouveau_copy_context_create(parent, engine, oclass, NULL, 256, | 63 | ret = nouveau_engctx_create(parent, engine, oclass, NULL, 256, |
64 | 256, NVOBJ_FLAG_ZERO_ALLOC, &priv); | 64 | 256, NVOBJ_FLAG_ZERO_ALLOC, &priv); |
65 | *pobject = nv_object(priv); | 65 | *pobject = nv_object(priv); |
66 | if (ret) | 66 | if (ret) |
67 | return ret; | 67 | return ret; |
@@ -72,11 +72,11 @@ nve0_copy_context_ctor(struct nouveau_object *parent, | |||
72 | static struct nouveau_ofuncs | 72 | static struct nouveau_ofuncs |
73 | nve0_copy_context_ofuncs = { | 73 | nve0_copy_context_ofuncs = { |
74 | .ctor = nve0_copy_context_ctor, | 74 | .ctor = nve0_copy_context_ctor, |
75 | .dtor = _nouveau_copy_context_dtor, | 75 | .dtor = _nouveau_engctx_dtor, |
76 | .init = _nouveau_copy_context_init, | 76 | .init = _nouveau_engctx_init, |
77 | .fini = _nouveau_copy_context_fini, | 77 | .fini = _nouveau_engctx_fini, |
78 | .rd32 = _nouveau_copy_context_rd32, | 78 | .rd32 = _nouveau_engctx_rd32, |
79 | .wr32 = _nouveau_copy_context_wr32, | 79 | .wr32 = _nouveau_engctx_wr32, |
80 | }; | 80 | }; |
81 | 81 | ||
82 | static struct nouveau_oclass | 82 | static struct nouveau_oclass |
@@ -100,7 +100,8 @@ nve0_copy0_ctor(struct nouveau_object *parent, struct nouveau_object *engine, | |||
100 | if (nv_rd32(parent, 0x022500) & 0x00000100) | 100 | if (nv_rd32(parent, 0x022500) & 0x00000100) |
101 | return -ENODEV; | 101 | return -ENODEV; |
102 | 102 | ||
103 | ret = nouveau_copy_create(parent, engine, oclass, true, 0, &priv); | 103 | ret = nouveau_engine_create(parent, engine, oclass, true, |
104 | "PCE0", "copy0", &priv); | ||
104 | *pobject = nv_object(priv); | 105 | *pobject = nv_object(priv); |
105 | if (ret) | 106 | if (ret) |
106 | return ret; | 107 | return ret; |
@@ -122,7 +123,8 @@ nve0_copy1_ctor(struct nouveau_object *parent, struct nouveau_object *engine, | |||
122 | if (nv_rd32(parent, 0x022500) & 0x00000200) | 123 | if (nv_rd32(parent, 0x022500) & 0x00000200) |
123 | return -ENODEV; | 124 | return -ENODEV; |
124 | 125 | ||
125 | ret = nouveau_copy_create(parent, engine, oclass, true, 1, &priv); | 126 | ret = nouveau_engine_create(parent, engine, oclass, true, |
127 | "PCE1", "copy1", &priv); | ||
126 | *pobject = nv_object(priv); | 128 | *pobject = nv_object(priv); |
127 | if (ret) | 129 | if (ret) |
128 | return ret; | 130 | return ret; |
@@ -138,9 +140,9 @@ nve0_copy0_oclass = { | |||
138 | .handle = NV_ENGINE(COPY0, 0xe0), | 140 | .handle = NV_ENGINE(COPY0, 0xe0), |
139 | .ofuncs = &(struct nouveau_ofuncs) { | 141 | .ofuncs = &(struct nouveau_ofuncs) { |
140 | .ctor = nve0_copy0_ctor, | 142 | .ctor = nve0_copy0_ctor, |
141 | .dtor = _nouveau_copy_dtor, | 143 | .dtor = _nouveau_engine_dtor, |
142 | .init = _nouveau_copy_init, | 144 | .init = _nouveau_engine_init, |
143 | .fini = _nouveau_copy_fini, | 145 | .fini = _nouveau_engine_fini, |
144 | }, | 146 | }, |
145 | }; | 147 | }; |
146 | 148 | ||
@@ -149,8 +151,8 @@ nve0_copy1_oclass = { | |||
149 | .handle = NV_ENGINE(COPY1, 0xe0), | 151 | .handle = NV_ENGINE(COPY1, 0xe0), |
150 | .ofuncs = &(struct nouveau_ofuncs) { | 152 | .ofuncs = &(struct nouveau_ofuncs) { |
151 | .ctor = nve0_copy1_ctor, | 153 | .ctor = nve0_copy1_ctor, |
152 | .dtor = _nouveau_copy_dtor, | 154 | .dtor = _nouveau_engine_dtor, |
153 | .init = _nouveau_copy_init, | 155 | .init = _nouveau_engine_init, |
154 | .fini = _nouveau_copy_fini, | 156 | .fini = _nouveau_engine_fini, |
155 | }, | 157 | }, |
156 | }; | 158 | }; |
diff --git a/drivers/gpu/drm/nouveau/core/include/engine/copy.h b/drivers/gpu/drm/nouveau/core/include/engine/copy.h index 70b9d8c5fcf..5596fbb1339 100644 --- a/drivers/gpu/drm/nouveau/core/include/engine/copy.h +++ b/drivers/gpu/drm/nouveau/core/include/engine/copy.h | |||
@@ -1,45 +1,6 @@ | |||
1 | #ifndef __NOUVEAU_COPY_H__ | 1 | #ifndef __NOUVEAU_COPY_H__ |
2 | #define __NOUVEAU_COPY_H__ | 2 | #define __NOUVEAU_COPY_H__ |
3 | 3 | ||
4 | #include <core/engine.h> | ||
5 | #include <core/engctx.h> | ||
6 | |||
7 | struct nouveau_copy_chan { | ||
8 | struct nouveau_engctx base; | ||
9 | }; | ||
10 | |||
11 | #define nouveau_copy_context_create(p,e,c,g,s,a,f,d) \ | ||
12 | nouveau_engctx_create((p), (e), (c), (g), (s), (a), (f), (d)) | ||
13 | #define nouveau_copy_context_destroy(d) \ | ||
14 | nouveau_engctx_destroy(&(d)->base) | ||
15 | #define nouveau_copy_context_init(d) \ | ||
16 | nouveau_engctx_init(&(d)->base) | ||
17 | #define nouveau_copy_context_fini(d,s) \ | ||
18 | nouveau_engctx_fini(&(d)->base, (s)) | ||
19 | |||
20 | #define _nouveau_copy_context_dtor _nouveau_engctx_dtor | ||
21 | #define _nouveau_copy_context_init _nouveau_engctx_init | ||
22 | #define _nouveau_copy_context_fini _nouveau_engctx_fini | ||
23 | #define _nouveau_copy_context_rd32 _nouveau_engctx_rd32 | ||
24 | #define _nouveau_copy_context_wr32 _nouveau_engctx_wr32 | ||
25 | |||
26 | struct nouveau_copy { | ||
27 | struct nouveau_engine base; | ||
28 | }; | ||
29 | |||
30 | #define nouveau_copy_create(p,e,c,y,i,d) \ | ||
31 | nouveau_engine_create((p), (e), (c), (y), "PCE"#i, "copy"#i, (d)) | ||
32 | #define nouveau_copy_destroy(d) \ | ||
33 | nouveau_engine_destroy(&(d)->base) | ||
34 | #define nouveau_copy_init(d) \ | ||
35 | nouveau_engine_init(&(d)->base) | ||
36 | #define nouveau_copy_fini(d,s) \ | ||
37 | nouveau_engine_fini(&(d)->base, (s)) | ||
38 | |||
39 | #define _nouveau_copy_dtor _nouveau_engine_dtor | ||
40 | #define _nouveau_copy_init _nouveau_engine_init | ||
41 | #define _nouveau_copy_fini _nouveau_engine_fini | ||
42 | |||
43 | extern struct nouveau_oclass nva3_copy_oclass; | 4 | extern struct nouveau_oclass nva3_copy_oclass; |
44 | extern struct nouveau_oclass nvc0_copy0_oclass; | 5 | extern struct nouveau_oclass nvc0_copy0_oclass; |
45 | extern struct nouveau_oclass nvc0_copy1_oclass; | 6 | extern struct nouveau_oclass nvc0_copy1_oclass; |