diff options
author | Ilia Mirkin <imirkin@alum.mit.edu> | 2013-06-27 00:12:46 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2013-06-30 23:50:49 -0400 |
commit | a0376b1481fdb9c9e8064ea0c5af8bd80da3f8f3 (patch) | |
tree | e81222d1e51be2b4720b53493c0d46df77606de0 | |
parent | 44b1e3bd6adc050fac1daccee5bbff019daadc8e (diff) |
drm/nouveau/vp/nv84: initial vp2 engine implementation
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r-- | drivers/gpu/drm/nouveau/core/engine/fifo/nv84.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/core/engine/vp/nv84.c | 27 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/mc/nv50.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/vm/nv50.c | 1 |
4 files changed, 17 insertions, 14 deletions
diff --git a/drivers/gpu/drm/nouveau/core/engine/fifo/nv84.c b/drivers/gpu/drm/nouveau/core/engine/fifo/nv84.c index 35b94bd18808..65519dc75ba7 100644 --- a/drivers/gpu/drm/nouveau/core/engine/fifo/nv84.c +++ b/drivers/gpu/drm/nouveau/core/engine/fifo/nv84.c | |||
@@ -56,6 +56,7 @@ nv84_fifo_context_attach(struct nouveau_object *parent, | |||
56 | switch (nv_engidx(object->engine)) { | 56 | switch (nv_engidx(object->engine)) { |
57 | case NVDEV_ENGINE_SW : return 0; | 57 | case NVDEV_ENGINE_SW : return 0; |
58 | case NVDEV_ENGINE_GR : addr = 0x0020; break; | 58 | case NVDEV_ENGINE_GR : addr = 0x0020; break; |
59 | case NVDEV_ENGINE_VP : addr = 0x0040; break; | ||
59 | case NVDEV_ENGINE_MPEG : addr = 0x0060; break; | 60 | case NVDEV_ENGINE_MPEG : addr = 0x0060; break; |
60 | case NVDEV_ENGINE_CRYPT: addr = 0x00a0; break; | 61 | case NVDEV_ENGINE_CRYPT: addr = 0x00a0; break; |
61 | case NVDEV_ENGINE_COPY0: addr = 0x00c0; break; | 62 | case NVDEV_ENGINE_COPY0: addr = 0x00c0; break; |
@@ -89,6 +90,7 @@ nv84_fifo_context_detach(struct nouveau_object *parent, bool suspend, | |||
89 | switch (nv_engidx(object->engine)) { | 90 | switch (nv_engidx(object->engine)) { |
90 | case NVDEV_ENGINE_SW : return 0; | 91 | case NVDEV_ENGINE_SW : return 0; |
91 | case NVDEV_ENGINE_GR : engn = 0; addr = 0x0020; break; | 92 | case NVDEV_ENGINE_GR : engn = 0; addr = 0x0020; break; |
93 | case NVDEV_ENGINE_VP : engn = 3; addr = 0x0040; break; | ||
92 | case NVDEV_ENGINE_MPEG : engn = 1; addr = 0x0060; break; | 94 | case NVDEV_ENGINE_MPEG : engn = 1; addr = 0x0060; break; |
93 | case NVDEV_ENGINE_CRYPT: engn = 4; addr = 0x00a0; break; | 95 | case NVDEV_ENGINE_CRYPT: engn = 4; addr = 0x00a0; break; |
94 | case NVDEV_ENGINE_COPY0: engn = 2; addr = 0x00c0; break; | 96 | case NVDEV_ENGINE_COPY0: engn = 2; addr = 0x00c0; break; |
diff --git a/drivers/gpu/drm/nouveau/core/engine/vp/nv84.c b/drivers/gpu/drm/nouveau/core/engine/vp/nv84.c index 261cd96e6951..fd6272b8cdb2 100644 --- a/drivers/gpu/drm/nouveau/core/engine/vp/nv84.c +++ b/drivers/gpu/drm/nouveau/core/engine/vp/nv84.c | |||
@@ -19,24 +19,19 @@ | |||
19 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | 19 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
20 | * OTHER DEALINGS IN THE SOFTWARE. | 20 | * OTHER DEALINGS IN THE SOFTWARE. |
21 | * | 21 | * |
22 | * Authors: Ben Skeggs | 22 | * Authors: Ben Skeggs, Ilia Mirkin |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include <core/engctx.h> | 25 | #include <engine/xtensa.h> |
26 | #include <core/class.h> | ||
27 | |||
28 | #include <engine/vp.h> | 26 | #include <engine/vp.h> |
29 | 27 | ||
30 | struct nv84_vp_priv { | ||
31 | struct nouveau_engine base; | ||
32 | }; | ||
33 | |||
34 | /******************************************************************************* | 28 | /******************************************************************************* |
35 | * VP object classes | 29 | * VP object classes |
36 | ******************************************************************************/ | 30 | ******************************************************************************/ |
37 | 31 | ||
38 | static struct nouveau_oclass | 32 | static struct nouveau_oclass |
39 | nv84_vp_sclass[] = { | 33 | nv84_vp_sclass[] = { |
34 | { 0x7476, &nouveau_object_ofuncs }, | ||
40 | {}, | 35 | {}, |
41 | }; | 36 | }; |
42 | 37 | ||
@@ -48,7 +43,7 @@ static struct nouveau_oclass | |||
48 | nv84_vp_cclass = { | 43 | nv84_vp_cclass = { |
49 | .handle = NV_ENGCTX(VP, 0x84), | 44 | .handle = NV_ENGCTX(VP, 0x84), |
50 | .ofuncs = &(struct nouveau_ofuncs) { | 45 | .ofuncs = &(struct nouveau_ofuncs) { |
51 | .ctor = _nouveau_engctx_ctor, | 46 | .ctor = _nouveau_xtensa_engctx_ctor, |
52 | .dtor = _nouveau_engctx_dtor, | 47 | .dtor = _nouveau_engctx_dtor, |
53 | .init = _nouveau_engctx_init, | 48 | .init = _nouveau_engctx_init, |
54 | .fini = _nouveau_engctx_fini, | 49 | .fini = _nouveau_engctx_fini, |
@@ -66,10 +61,10 @@ nv84_vp_ctor(struct nouveau_object *parent, struct nouveau_object *engine, | |||
66 | struct nouveau_oclass *oclass, void *data, u32 size, | 61 | struct nouveau_oclass *oclass, void *data, u32 size, |
67 | struct nouveau_object **pobject) | 62 | struct nouveau_object **pobject) |
68 | { | 63 | { |
69 | struct nv84_vp_priv *priv; | 64 | struct nouveau_xtensa *priv; |
70 | int ret; | 65 | int ret; |
71 | 66 | ||
72 | ret = nouveau_engine_create(parent, engine, oclass, true, | 67 | ret = nouveau_xtensa_create(parent, engine, oclass, 0xf000, true, |
73 | "PVP", "vp", &priv); | 68 | "PVP", "vp", &priv); |
74 | *pobject = nv_object(priv); | 69 | *pobject = nv_object(priv); |
75 | if (ret) | 70 | if (ret) |
@@ -78,6 +73,8 @@ nv84_vp_ctor(struct nouveau_object *parent, struct nouveau_object *engine, | |||
78 | nv_subdev(priv)->unit = 0x01020000; | 73 | nv_subdev(priv)->unit = 0x01020000; |
79 | nv_engine(priv)->cclass = &nv84_vp_cclass; | 74 | nv_engine(priv)->cclass = &nv84_vp_cclass; |
80 | nv_engine(priv)->sclass = nv84_vp_sclass; | 75 | nv_engine(priv)->sclass = nv84_vp_sclass; |
76 | priv->fifo_val = 0x111; | ||
77 | priv->unkd28 = 0x9c544; | ||
81 | return 0; | 78 | return 0; |
82 | } | 79 | } |
83 | 80 | ||
@@ -86,8 +83,10 @@ nv84_vp_oclass = { | |||
86 | .handle = NV_ENGINE(VP, 0x84), | 83 | .handle = NV_ENGINE(VP, 0x84), |
87 | .ofuncs = &(struct nouveau_ofuncs) { | 84 | .ofuncs = &(struct nouveau_ofuncs) { |
88 | .ctor = nv84_vp_ctor, | 85 | .ctor = nv84_vp_ctor, |
89 | .dtor = _nouveau_engine_dtor, | 86 | .dtor = _nouveau_xtensa_dtor, |
90 | .init = _nouveau_engine_init, | 87 | .init = _nouveau_xtensa_init, |
91 | .fini = _nouveau_engine_fini, | 88 | .fini = _nouveau_xtensa_fini, |
89 | .rd32 = _nouveau_xtensa_rd32, | ||
90 | .wr32 = _nouveau_xtensa_wr32, | ||
92 | }, | 91 | }, |
93 | }; | 92 | }; |
diff --git a/drivers/gpu/drm/nouveau/core/subdev/mc/nv50.c b/drivers/gpu/drm/nouveau/core/subdev/mc/nv50.c index d796924f9930..0cb322a5e72c 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/mc/nv50.c +++ b/drivers/gpu/drm/nouveau/core/subdev/mc/nv50.c | |||
@@ -35,6 +35,7 @@ nv50_mc_intr[] = { | |||
35 | { 0x00001000, NVDEV_ENGINE_GR }, | 35 | { 0x00001000, NVDEV_ENGINE_GR }, |
36 | { 0x00004000, NVDEV_ENGINE_CRYPT }, /* NV84- */ | 36 | { 0x00004000, NVDEV_ENGINE_CRYPT }, /* NV84- */ |
37 | { 0x00008000, NVDEV_ENGINE_BSP }, /* NV84- */ | 37 | { 0x00008000, NVDEV_ENGINE_BSP }, /* NV84- */ |
38 | { 0x00020000, NVDEV_ENGINE_VP }, /* NV84- */ | ||
38 | { 0x00100000, NVDEV_SUBDEV_TIMER }, | 39 | { 0x00100000, NVDEV_SUBDEV_TIMER }, |
39 | { 0x00200000, NVDEV_SUBDEV_GPIO }, | 40 | { 0x00200000, NVDEV_SUBDEV_GPIO }, |
40 | { 0x04000000, NVDEV_ENGINE_DISP }, | 41 | { 0x04000000, NVDEV_ENGINE_DISP }, |
diff --git a/drivers/gpu/drm/nouveau/core/subdev/vm/nv50.c b/drivers/gpu/drm/nouveau/core/subdev/vm/nv50.c index 486c813b9ea9..fcae49f678b5 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/vm/nv50.c +++ b/drivers/gpu/drm/nouveau/core/subdev/vm/nv50.c | |||
@@ -172,6 +172,7 @@ nv50_vm_flush(struct nouveau_vm *vm) | |||
172 | 172 | ||
173 | switch (i) { | 173 | switch (i) { |
174 | case NVDEV_ENGINE_GR : vme = 0x00; break; | 174 | case NVDEV_ENGINE_GR : vme = 0x00; break; |
175 | case NVDEV_ENGINE_VP : vme = 0x01; break; | ||
175 | case NVDEV_SUBDEV_BAR : vme = 0x06; break; | 176 | case NVDEV_SUBDEV_BAR : vme = 0x06; break; |
176 | case NVDEV_ENGINE_MPEG : vme = 0x08; break; | 177 | case NVDEV_ENGINE_MPEG : vme = 0x08; break; |
177 | case NVDEV_ENGINE_CRYPT: vme = 0x0a; break; | 178 | case NVDEV_ENGINE_CRYPT: vme = 0x0a; break; |