aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2012-10-08 00:11:35 -0400
committerBen Skeggs <bskeggs@redhat.com>2012-11-28 18:56:39 -0500
commit344e107df7a5c365287aabe9df7df58b3765246b (patch)
tree238f5db4bcd6d38e9775d4fce9421ac54b57ed1c /drivers/gpu/drm/nouveau
parent82d23aea108886c869fce4c1e3178db5f57b6e9c (diff)
drm/nvd0/dmaobj: duplicate fermi class, will diverge real soon now
The hardware dmaobj format completely changed in GF119, so these will need a separate implementation. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau')
-rw-r--r--drivers/gpu/drm/nouveau/Makefile1
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/dmaobj/nvd0.c83
-rw-r--r--drivers/gpu/drm/nouveau/core/include/engine/dmaobj.h1
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/device/nvc0.c2
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/device/nve0.c4
5 files changed, 88 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/Makefile b/drivers/gpu/drm/nouveau/Makefile
index 76cdb27fd4d8..b629abf2c28d 100644
--- a/drivers/gpu/drm/nouveau/Makefile
+++ b/drivers/gpu/drm/nouveau/Makefile
@@ -121,6 +121,7 @@ nouveau-y += core/engine/dmaobj/base.o
121nouveau-y += core/engine/dmaobj/nv04.o 121nouveau-y += core/engine/dmaobj/nv04.o
122nouveau-y += core/engine/dmaobj/nv50.o 122nouveau-y += core/engine/dmaobj/nv50.o
123nouveau-y += core/engine/dmaobj/nvc0.o 123nouveau-y += core/engine/dmaobj/nvc0.o
124nouveau-y += core/engine/dmaobj/nvd0.o
124nouveau-y += core/engine/bsp/nv84.o 125nouveau-y += core/engine/bsp/nv84.o
125nouveau-y += core/engine/copy/nva3.o 126nouveau-y += core/engine/copy/nva3.o
126nouveau-y += core/engine/copy/nvc0.o 127nouveau-y += core/engine/copy/nvc0.o
diff --git a/drivers/gpu/drm/nouveau/core/engine/dmaobj/nvd0.c b/drivers/gpu/drm/nouveau/core/engine/dmaobj/nvd0.c
new file mode 100644
index 000000000000..7211cd83c0ee
--- /dev/null
+++ b/drivers/gpu/drm/nouveau/core/engine/dmaobj/nvd0.c
@@ -0,0 +1,83 @@
1/*
2 * Copyright 2012 Red Hat Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 *
22 * Authors: Ben Skeggs
23 */
24
25#include <core/device.h>
26#include <core/gpuobj.h>
27#include <core/class.h>
28
29#include <subdev/fb.h>
30#include <engine/dmaobj.h>
31
32struct nvd0_dmaeng_priv {
33 struct nouveau_dmaeng base;
34};
35
36static int
37nvd0_dmaobj_bind(struct nouveau_dmaeng *dmaeng,
38 struct nouveau_object *parent,
39 struct nouveau_dmaobj *dmaobj,
40 struct nouveau_gpuobj **pgpuobj)
41{
42 int ret = 0;
43
44 if (!nv_iclass(parent, NV_ENGCTX_CLASS)) {
45 switch (nv_mclass(parent->parent)) {
46 break;
47 default:
48 return -EINVAL;
49 }
50 } else
51 return 0;
52
53 return ret;
54}
55
56static int
57nvd0_dmaeng_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
58 struct nouveau_oclass *oclass, void *data, u32 size,
59 struct nouveau_object **pobject)
60{
61 struct nvd0_dmaeng_priv *priv;
62 int ret;
63
64 ret = nouveau_dmaeng_create(parent, engine, oclass, &priv);
65 *pobject = nv_object(priv);
66 if (ret)
67 return ret;
68
69 nv_engine(priv)->sclass = nouveau_dmaobj_sclass;
70 priv->base.bind = nvd0_dmaobj_bind;
71 return 0;
72}
73
74struct nouveau_oclass
75nvd0_dmaeng_oclass = {
76 .handle = NV_ENGINE(DMAOBJ, 0xd0),
77 .ofuncs = &(struct nouveau_ofuncs) {
78 .ctor = nvd0_dmaeng_ctor,
79 .dtor = _nouveau_dmaeng_dtor,
80 .init = _nouveau_dmaeng_init,
81 .fini = _nouveau_dmaeng_fini,
82 },
83};
diff --git a/drivers/gpu/drm/nouveau/core/include/engine/dmaobj.h b/drivers/gpu/drm/nouveau/core/include/engine/dmaobj.h
index a0b102680d81..21f9edcdd6c9 100644
--- a/drivers/gpu/drm/nouveau/core/include/engine/dmaobj.h
+++ b/drivers/gpu/drm/nouveau/core/include/engine/dmaobj.h
@@ -40,6 +40,7 @@ struct nouveau_dmaeng {
40extern struct nouveau_oclass nv04_dmaeng_oclass; 40extern struct nouveau_oclass nv04_dmaeng_oclass;
41extern struct nouveau_oclass nv50_dmaeng_oclass; 41extern struct nouveau_oclass nv50_dmaeng_oclass;
42extern struct nouveau_oclass nvc0_dmaeng_oclass; 42extern struct nouveau_oclass nvc0_dmaeng_oclass;
43extern struct nouveau_oclass nvd0_dmaeng_oclass;
43 44
44extern struct nouveau_oclass nouveau_dmaobj_sclass[]; 45extern struct nouveau_oclass nouveau_dmaobj_sclass[];
45 46
diff --git a/drivers/gpu/drm/nouveau/core/subdev/device/nvc0.c b/drivers/gpu/drm/nouveau/core/subdev/device/nvc0.c
index 6697f0f9c293..0429ab450367 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/device/nvc0.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/device/nvc0.c
@@ -266,7 +266,7 @@ nvc0_identify(struct nouveau_device *device)
266 device->oclass[NVDEV_SUBDEV_INSTMEM] = &nv50_instmem_oclass; 266 device->oclass[NVDEV_SUBDEV_INSTMEM] = &nv50_instmem_oclass;
267 device->oclass[NVDEV_SUBDEV_VM ] = &nvc0_vmmgr_oclass; 267 device->oclass[NVDEV_SUBDEV_VM ] = &nvc0_vmmgr_oclass;
268 device->oclass[NVDEV_SUBDEV_BAR ] = &nvc0_bar_oclass; 268 device->oclass[NVDEV_SUBDEV_BAR ] = &nvc0_bar_oclass;
269 device->oclass[NVDEV_ENGINE_DMAOBJ ] = &nvc0_dmaeng_oclass; 269 device->oclass[NVDEV_ENGINE_DMAOBJ ] = &nvd0_dmaeng_oclass;
270 device->oclass[NVDEV_ENGINE_FIFO ] = &nvc0_fifo_oclass; 270 device->oclass[NVDEV_ENGINE_FIFO ] = &nvc0_fifo_oclass;
271 device->oclass[NVDEV_ENGINE_SW ] = &nvc0_software_oclass; 271 device->oclass[NVDEV_ENGINE_SW ] = &nvc0_software_oclass;
272 device->oclass[NVDEV_ENGINE_GR ] = &nvc0_graph_oclass; 272 device->oclass[NVDEV_ENGINE_GR ] = &nvc0_graph_oclass;
diff --git a/drivers/gpu/drm/nouveau/core/subdev/device/nve0.c b/drivers/gpu/drm/nouveau/core/subdev/device/nve0.c
index 4a280b7ab853..d5b4781bf454 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/device/nve0.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/device/nve0.c
@@ -67,7 +67,7 @@ nve0_identify(struct nouveau_device *device)
67 device->oclass[NVDEV_SUBDEV_INSTMEM] = &nv50_instmem_oclass; 67 device->oclass[NVDEV_SUBDEV_INSTMEM] = &nv50_instmem_oclass;
68 device->oclass[NVDEV_SUBDEV_VM ] = &nvc0_vmmgr_oclass; 68 device->oclass[NVDEV_SUBDEV_VM ] = &nvc0_vmmgr_oclass;
69 device->oclass[NVDEV_SUBDEV_BAR ] = &nvc0_bar_oclass; 69 device->oclass[NVDEV_SUBDEV_BAR ] = &nvc0_bar_oclass;
70 device->oclass[NVDEV_ENGINE_DMAOBJ ] = &nvc0_dmaeng_oclass; 70 device->oclass[NVDEV_ENGINE_DMAOBJ ] = &nvd0_dmaeng_oclass;
71 device->oclass[NVDEV_ENGINE_FIFO ] = &nve0_fifo_oclass; 71 device->oclass[NVDEV_ENGINE_FIFO ] = &nve0_fifo_oclass;
72 device->oclass[NVDEV_ENGINE_SW ] = &nvc0_software_oclass; 72 device->oclass[NVDEV_ENGINE_SW ] = &nvc0_software_oclass;
73 device->oclass[NVDEV_ENGINE_GR ] = &nve0_graph_oclass; 73 device->oclass[NVDEV_ENGINE_GR ] = &nve0_graph_oclass;
@@ -92,7 +92,7 @@ nve0_identify(struct nouveau_device *device)
92 device->oclass[NVDEV_SUBDEV_INSTMEM] = &nv50_instmem_oclass; 92 device->oclass[NVDEV_SUBDEV_INSTMEM] = &nv50_instmem_oclass;
93 device->oclass[NVDEV_SUBDEV_VM ] = &nvc0_vmmgr_oclass; 93 device->oclass[NVDEV_SUBDEV_VM ] = &nvc0_vmmgr_oclass;
94 device->oclass[NVDEV_SUBDEV_BAR ] = &nvc0_bar_oclass; 94 device->oclass[NVDEV_SUBDEV_BAR ] = &nvc0_bar_oclass;
95 device->oclass[NVDEV_ENGINE_DMAOBJ ] = &nvc0_dmaeng_oclass; 95 device->oclass[NVDEV_ENGINE_DMAOBJ ] = &nvd0_dmaeng_oclass;
96 device->oclass[NVDEV_ENGINE_FIFO ] = &nve0_fifo_oclass; 96 device->oclass[NVDEV_ENGINE_FIFO ] = &nve0_fifo_oclass;
97 device->oclass[NVDEV_ENGINE_SW ] = &nvc0_software_oclass; 97 device->oclass[NVDEV_ENGINE_SW ] = &nvc0_software_oclass;
98 device->oclass[NVDEV_ENGINE_GR ] = &nve0_graph_oclass; 98 device->oclass[NVDEV_ENGINE_GR ] = &nve0_graph_oclass;