drm/nv50-/sw: share engine/channel struct definitions between implementations
authorBen Skeggs <bskeggs@redhat.com>
Wed, 2 Oct 2013 21:17:02 +0000 (07:17 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 8 Nov 2013 05:36:04 +0000 (15:36 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/core/engine/software/nv50.c
drivers/gpu/drm/nouveau/core/engine/software/nv50.h [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/engine/software/nvc0.c

index c48e74953771a6c02352d43c0bfa59a84be13c0e..cab64d0c67a58a406e6844f805ab55df209d89f8 100644 (file)
 
 #include <subdev/bar.h>
 
-#include <engine/software.h>
 #include <engine/disp.h>
 
-struct nv50_software_priv {
-       struct nouveau_software base;
-};
-
-struct nv50_software_chan {
-       struct nouveau_software_chan base;
-};
+#include "nv50.h"
 
 /*******************************************************************************
  * software object classes
diff --git a/drivers/gpu/drm/nouveau/core/engine/software/nv50.h b/drivers/gpu/drm/nouveau/core/engine/software/nv50.h
new file mode 100644 (file)
index 0000000..d3fedd0
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef __NVKM_SW_NV50_H__
+#define __NVKM_SW_NV50_H__
+
+#include <engine/software.h>
+
+struct nv50_software_priv {
+       struct nouveau_software base;
+};
+
+struct nv50_software_chan {
+       struct nouveau_software_chan base;
+};
+
+#endif
index d698e710ddd43cf9cf5a524201d0e8ba5c2e98e1..e8eae33ed4681793e31039d4c6040198cf1e9cdb 100644 (file)
 #include <engine/software.h>
 #include <engine/disp.h>
 
-struct nvc0_software_priv {
-       struct nouveau_software base;
-};
-
-struct nvc0_software_chan {
-       struct nouveau_software_chan base;
-};
+#include "nv50.h"
 
 /*******************************************************************************
  * software object classes
@@ -48,7 +42,7 @@ static int
 nvc0_software_mthd_vblsem_offset(struct nouveau_object *object, u32 mthd,
                                 void *args, u32 size)
 {
-       struct nvc0_software_chan *chan = (void *)nv_engctx(object->parent);
+       struct nv50_software_chan *chan = (void *)nv_engctx(object->parent);
        u64 data = *(u32 *)args;
        if (mthd == 0x0400) {
                chan->base.vblank.offset &= 0x00ffffffffULL;
@@ -64,7 +58,7 @@ static int
 nvc0_software_mthd_vblsem_value(struct nouveau_object *object, u32 mthd,
                                void *args, u32 size)
 {
-       struct nvc0_software_chan *chan = (void *)nv_engctx(object->parent);
+       struct nv50_software_chan *chan = (void *)nv_engctx(object->parent);
        chan->base.vblank.value = *(u32 *)args;
        return 0;
 }
@@ -73,7 +67,7 @@ static int
 nvc0_software_mthd_vblsem_release(struct nouveau_object *object, u32 mthd,
                                  void *args, u32 size)
 {
-       struct nvc0_software_chan *chan = (void *)nv_engctx(object->parent);
+       struct nv50_software_chan *chan = (void *)nv_engctx(object->parent);
        struct nouveau_disp *disp = nouveau_disp(object);
        u32 crtc = *(u32 *)args;
 
@@ -88,7 +82,7 @@ static int
 nvc0_software_mthd_flip(struct nouveau_object *object, u32 mthd,
                        void *args, u32 size)
 {
-       struct nvc0_software_chan *chan = (void *)nv_engctx(object->parent);
+       struct nv50_software_chan *chan = (void *)nv_engctx(object->parent);
        if (chan->base.flip)
                return chan->base.flip(chan->base.flip_data);
        return -EINVAL;
@@ -98,8 +92,8 @@ static int
 nvc0_software_mthd_mp_control(struct nouveau_object *object, u32 mthd,
                               void *args, u32 size)
 {
-       struct nvc0_software_chan *chan = (void *)nv_engctx(object->parent);
-       struct nvc0_software_priv *priv = (void *)nv_object(chan)->engine;
+       struct nv50_software_chan *chan = (void *)nv_engctx(object->parent);
+       struct nv50_software_priv *priv = (void *)nv_object(chan)->engine;
        u32 data = *(u32 *)args;
 
        switch (mthd) {
@@ -148,7 +142,7 @@ nvc0_software_vblsem_release(struct nouveau_eventh *event, int head)
 {
        struct nouveau_software_chan *chan =
                container_of(event, struct nouveau_software_chan, vblank.event);
-       struct nvc0_software_priv *priv = (void *)nv_object(chan)->engine;
+       struct nv50_software_priv *priv = (void *)nv_object(chan)->engine;
        struct nouveau_bar *bar = nouveau_bar(priv);
 
        nv_wr32(priv, 0x001718, 0x80000000 | chan->vblank.channel);
@@ -166,7 +160,7 @@ nvc0_software_context_ctor(struct nouveau_object *parent,
                           struct nouveau_oclass *oclass, void *data, u32 size,
                           struct nouveau_object **pobject)
 {
-       struct nvc0_software_chan *chan;
+       struct nv50_software_chan *chan;
        int ret;
 
        ret = nouveau_software_context_create(parent, engine, oclass, &chan);
@@ -199,7 +193,7 @@ nvc0_software_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
                   struct nouveau_oclass *oclass, void *data, u32 size,
                   struct nouveau_object **pobject)
 {
-       struct nvc0_software_priv *priv;
+       struct nv50_software_priv *priv;
        int ret;
 
        ret = nouveau_software_create(parent, engine, oclass, &priv);