drm/nouveau/vp: namespace + nvidia gpu names (no binary change)
authorBen Skeggs <bskeggs@redhat.com>
Wed, 14 Jan 2015 05:32:28 +0000 (15:32 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 22 Jan 2015 02:18:06 +0000 (12:18 +1000)
The namespace of NVKM is being changed to nvkm_ instead of nouveau_,
which will be used for the DRM part of the driver.  This is being
done in order to make it very clear as to what part of the driver a
given symbol belongs to, and as a minor step towards splitting the
DRM driver out to be able to stand on its own (for virt).

Because there's already a large amount of churn here anyway, this is
as good a time as any to also switch to NVIDIA's device and chipset
naming to ease collaboration with them.

A comparison of objdump disassemblies proves no code changes.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/include/nvkm/engine/vp.h
drivers/gpu/drm/nouveau/nvkm/engine/device/nv50.c
drivers/gpu/drm/nouveau/nvkm/engine/vp/Kbuild
drivers/gpu/drm/nouveau/nvkm/engine/vp/g84.c [new file with mode: 0644]
drivers/gpu/drm/nouveau/nvkm/engine/vp/nv84.c [deleted file]

index 7175e6e032ccbb73b85d42eb3588b755ec936982..7851f18c5add14c56ac06bf0dca2f1d2c2f9d78c 100644 (file)
@@ -1,4 +1,5 @@
-#ifndef __NOUVEAU_VP_H__
-#define __NOUVEAU_VP_H__
-extern struct nouveau_oclass nv84_vp_oclass;
+#ifndef __NVKM_VP_H__
+#define __NVKM_VP_H__
+#include <core/engine.h>
+extern struct nvkm_oclass g84_vp_oclass;
 #endif
index bf3998b96bc484a3f65ae8c945b389fef844a274..36944babbb536f426f2ce5d00b9db1fd3a259379 100644 (file)
@@ -110,7 +110,7 @@ nv50_identify(struct nouveau_device *device)
                device->oclass[NVDEV_ENGINE_SW     ] =  nv50_sw_oclass;
                device->oclass[NVDEV_ENGINE_GR     ] = &nv50_gr_oclass;
                device->oclass[NVDEV_ENGINE_MPEG   ] = &g84_mpeg_oclass;
-               device->oclass[NVDEV_ENGINE_VP     ] = &nv84_vp_oclass;
+               device->oclass[NVDEV_ENGINE_VP     ] = &g84_vp_oclass;
                device->oclass[NVDEV_ENGINE_CIPHER ] = &g84_cipher_oclass;
                device->oclass[NVDEV_ENGINE_BSP    ] = &g84_bsp_oclass;
                device->oclass[NVDEV_ENGINE_DISP   ] =  g84_disp_oclass;
@@ -139,7 +139,7 @@ nv50_identify(struct nouveau_device *device)
                device->oclass[NVDEV_ENGINE_SW     ] =  nv50_sw_oclass;
                device->oclass[NVDEV_ENGINE_GR     ] = &nv50_gr_oclass;
                device->oclass[NVDEV_ENGINE_MPEG   ] = &g84_mpeg_oclass;
-               device->oclass[NVDEV_ENGINE_VP     ] = &nv84_vp_oclass;
+               device->oclass[NVDEV_ENGINE_VP     ] = &g84_vp_oclass;
                device->oclass[NVDEV_ENGINE_CIPHER ] = &g84_cipher_oclass;
                device->oclass[NVDEV_ENGINE_BSP    ] = &g84_bsp_oclass;
                device->oclass[NVDEV_ENGINE_DISP   ] =  g84_disp_oclass;
@@ -168,7 +168,7 @@ nv50_identify(struct nouveau_device *device)
                device->oclass[NVDEV_ENGINE_SW     ] =  nv50_sw_oclass;
                device->oclass[NVDEV_ENGINE_GR     ] = &nv50_gr_oclass;
                device->oclass[NVDEV_ENGINE_MPEG   ] = &g84_mpeg_oclass;
-               device->oclass[NVDEV_ENGINE_VP     ] = &nv84_vp_oclass;
+               device->oclass[NVDEV_ENGINE_VP     ] = &g84_vp_oclass;
                device->oclass[NVDEV_ENGINE_CIPHER ] = &g84_cipher_oclass;
                device->oclass[NVDEV_ENGINE_BSP    ] = &g84_bsp_oclass;
                device->oclass[NVDEV_ENGINE_DISP   ] =  g84_disp_oclass;
@@ -197,7 +197,7 @@ nv50_identify(struct nouveau_device *device)
                device->oclass[NVDEV_ENGINE_SW     ] =  nv50_sw_oclass;
                device->oclass[NVDEV_ENGINE_GR     ] = &nv50_gr_oclass;
                device->oclass[NVDEV_ENGINE_MPEG   ] = &g84_mpeg_oclass;
-               device->oclass[NVDEV_ENGINE_VP     ] = &nv84_vp_oclass;
+               device->oclass[NVDEV_ENGINE_VP     ] = &g84_vp_oclass;
                device->oclass[NVDEV_ENGINE_CIPHER ] = &g84_cipher_oclass;
                device->oclass[NVDEV_ENGINE_BSP    ] = &g84_bsp_oclass;
                device->oclass[NVDEV_ENGINE_DISP   ] =  g94_disp_oclass;
@@ -226,7 +226,7 @@ nv50_identify(struct nouveau_device *device)
                device->oclass[NVDEV_ENGINE_SW     ] =  nv50_sw_oclass;
                device->oclass[NVDEV_ENGINE_GR     ] = &nv50_gr_oclass;
                device->oclass[NVDEV_ENGINE_MPEG   ] = &g84_mpeg_oclass;
-               device->oclass[NVDEV_ENGINE_VP     ] = &nv84_vp_oclass;
+               device->oclass[NVDEV_ENGINE_VP     ] = &g84_vp_oclass;
                device->oclass[NVDEV_ENGINE_CIPHER ] = &g84_cipher_oclass;
                device->oclass[NVDEV_ENGINE_BSP    ] = &g84_bsp_oclass;
                device->oclass[NVDEV_ENGINE_DISP   ] =  g94_disp_oclass;
@@ -284,7 +284,7 @@ nv50_identify(struct nouveau_device *device)
                device->oclass[NVDEV_ENGINE_SW     ] =  nv50_sw_oclass;
                device->oclass[NVDEV_ENGINE_GR     ] = &nv50_gr_oclass;
                device->oclass[NVDEV_ENGINE_MPEG   ] = &g84_mpeg_oclass;
-               device->oclass[NVDEV_ENGINE_VP     ] = &nv84_vp_oclass;
+               device->oclass[NVDEV_ENGINE_VP     ] = &g84_vp_oclass;
                device->oclass[NVDEV_ENGINE_CIPHER ] = &g84_cipher_oclass;
                device->oclass[NVDEV_ENGINE_BSP    ] = &g84_bsp_oclass;
                device->oclass[NVDEV_ENGINE_DISP   ] =  gt200_disp_oclass;
index e4bfb6eb3d21fcacff6efc2f2a8cf4ecf178ee98..6b390eb92b0e6cd39b1d4ab52dc7f7fb4135480f 100644 (file)
@@ -1 +1 @@
-nvkm-y += nvkm/engine/vp/nv84.o
+nvkm-y += nvkm/engine/vp/g84.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/vp/g84.c b/drivers/gpu/drm/nouveau/nvkm/engine/vp/g84.c
new file mode 100644 (file)
index 0000000..45f4e18
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2012 Red Hat Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors: Ben Skeggs, Ilia Mirkin
+ */
+#include <engine/vp.h>
+#include <engine/xtensa.h>
+
+#include <core/engctx.h>
+
+/*******************************************************************************
+ * VP object classes
+ ******************************************************************************/
+
+static struct nvkm_oclass
+g84_vp_sclass[] = {
+       { 0x7476, &nvkm_object_ofuncs },
+       {},
+};
+
+/*******************************************************************************
+ * PVP context
+ ******************************************************************************/
+
+static struct nvkm_oclass
+g84_vp_cclass = {
+       .handle = NV_ENGCTX(VP, 0x84),
+       .ofuncs = &(struct nvkm_ofuncs) {
+               .ctor = _nvkm_xtensa_engctx_ctor,
+               .dtor = _nvkm_engctx_dtor,
+               .init = _nvkm_engctx_init,
+               .fini = _nvkm_engctx_fini,
+               .rd32 = _nvkm_engctx_rd32,
+               .wr32 = _nvkm_engctx_wr32,
+       },
+};
+
+/*******************************************************************************
+ * PVP engine/subdev functions
+ ******************************************************************************/
+
+static int
+g84_vp_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
+           struct nvkm_oclass *oclass, void *data, u32 size,
+           struct nvkm_object **pobject)
+{
+       struct nvkm_xtensa *priv;
+       int ret;
+
+       ret = nvkm_xtensa_create(parent, engine, oclass, 0xf000, true,
+                                "PVP", "vp", &priv);
+       *pobject = nv_object(priv);
+       if (ret)
+               return ret;
+
+       nv_subdev(priv)->unit = 0x01020000;
+       nv_engine(priv)->cclass = &g84_vp_cclass;
+       nv_engine(priv)->sclass = g84_vp_sclass;
+       priv->fifo_val = 0x111;
+       priv->unkd28 = 0x9c544;
+       return 0;
+}
+
+struct nvkm_oclass
+g84_vp_oclass = {
+       .handle = NV_ENGINE(VP, 0x84),
+       .ofuncs = &(struct nvkm_ofuncs) {
+               .ctor = g84_vp_ctor,
+               .dtor = _nvkm_xtensa_dtor,
+               .init = _nvkm_xtensa_init,
+               .fini = _nvkm_xtensa_fini,
+               .rd32 = _nvkm_xtensa_rd32,
+               .wr32 = _nvkm_xtensa_wr32,
+       },
+};
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/vp/nv84.c b/drivers/gpu/drm/nouveau/nvkm/engine/vp/nv84.c
deleted file mode 100644 (file)
index 9caa037..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright 2012 Red Hat Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors: Ben Skeggs, Ilia Mirkin
- */
-
-#include <engine/xtensa.h>
-#include <engine/vp.h>
-
-#include <core/engctx.h>
-
-/*******************************************************************************
- * VP object classes
- ******************************************************************************/
-
-static struct nouveau_oclass
-nv84_vp_sclass[] = {
-       { 0x7476, &nouveau_object_ofuncs },
-       {},
-};
-
-/*******************************************************************************
- * PVP context
- ******************************************************************************/
-
-static struct nouveau_oclass
-nv84_vp_cclass = {
-       .handle = NV_ENGCTX(VP, 0x84),
-       .ofuncs = &(struct nouveau_ofuncs) {
-               .ctor = _nouveau_xtensa_engctx_ctor,
-               .dtor = _nouveau_engctx_dtor,
-               .init = _nouveau_engctx_init,
-               .fini = _nouveau_engctx_fini,
-               .rd32 = _nouveau_engctx_rd32,
-               .wr32 = _nouveau_engctx_wr32,
-       },
-};
-
-/*******************************************************************************
- * PVP engine/subdev functions
- ******************************************************************************/
-
-static int
-nv84_vp_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
-            struct nouveau_oclass *oclass, void *data, u32 size,
-            struct nouveau_object **pobject)
-{
-       struct nouveau_xtensa *priv;
-       int ret;
-
-       ret = nouveau_xtensa_create(parent, engine, oclass, 0xf000, true,
-                                   "PVP", "vp", &priv);
-       *pobject = nv_object(priv);
-       if (ret)
-               return ret;
-
-       nv_subdev(priv)->unit = 0x01020000;
-       nv_engine(priv)->cclass = &nv84_vp_cclass;
-       nv_engine(priv)->sclass = nv84_vp_sclass;
-       priv->fifo_val = 0x111;
-       priv->unkd28 = 0x9c544;
-       return 0;
-}
-
-struct nouveau_oclass
-nv84_vp_oclass = {
-       .handle = NV_ENGINE(VP, 0x84),
-       .ofuncs = &(struct nouveau_ofuncs) {
-               .ctor = nv84_vp_ctor,
-               .dtor = _nouveau_xtensa_dtor,
-               .init = _nouveau_xtensa_init,
-               .fini = _nouveau_xtensa_fini,
-               .rd32 = _nouveau_xtensa_rd32,
-               .wr32 = _nouveau_xtensa_wr32,
-       },
-};