]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
drm/nouveau: share fence structures between nv10+ and nv50 implementations
authorMarcin Slusarz <marcin.slusarz@gmail.com>
Tue, 25 Dec 2012 16:50:43 +0000 (17:50 +0100)
committerBen Skeggs <bskeggs@redhat.com>
Wed, 20 Feb 2013 06:00:34 +0000 (16:00 +1000)
We already rely on them having the same fields and layout.

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nv10_fence.c
drivers/gpu/drm/nouveau/nv10_fence.h [new file with mode: 0644]
drivers/gpu/drm/nouveau/nv50_fence.c

index 03017f24d593fa84b569a6c3f370b310b7ab09c2..a8ea4af3ca76b89bd78e99213590cd30d1129ab9 100644 (file)
 
 #include "nouveau_drm.h"
 #include "nouveau_dma.h"
-#include "nouveau_fence.h"
-
-struct nv10_fence_chan {
-       struct nouveau_fence_chan base;
-};
-
-struct nv10_fence_priv {
-       struct nouveau_fence_priv base;
-       struct nouveau_bo *bo;
-       spinlock_t lock;
-       u32 sequence;
-};
+#include "nv10_fence.h"
 
 int
 nv10_fence_emit(struct nouveau_fence *fence)
diff --git a/drivers/gpu/drm/nouveau/nv10_fence.h b/drivers/gpu/drm/nouveau/nv10_fence.h
new file mode 100644 (file)
index 0000000..e5d9204
--- /dev/null
@@ -0,0 +1,19 @@
+#ifndef __NV10_FENCE_H_
+#define __NV10_FENCE_H_
+
+#include <core/os.h>
+#include "nouveau_fence.h"
+#include "nouveau_bo.h"
+
+struct nv10_fence_chan {
+       struct nouveau_fence_chan base;
+};
+
+struct nv10_fence_priv {
+       struct nouveau_fence_priv base;
+       struct nouveau_bo *bo;
+       spinlock_t lock;
+       u32 sequence;
+};
+
+#endif
index d889f3ac0d412d4affac8c1a17428270b6f0a448..72791d658b405325f804494ff1ffef928aec405c 100644 (file)
 
 #include "nouveau_drm.h"
 #include "nouveau_dma.h"
-#include "nouveau_fence.h"
+#include "nv10_fence.h"
 
 #include "nv50_display.h"
 
-struct nv50_fence_chan {
-       struct nouveau_fence_chan base;
-};
-
-struct nv50_fence_priv {
-       struct nouveau_fence_priv base;
-       struct nouveau_bo *bo;
-       spinlock_t lock;
-       u32 sequence;
-};
-
 static int
 nv50_fence_context_new(struct nouveau_channel *chan)
 {
        struct drm_device *dev = chan->drm->dev;
-       struct nv50_fence_priv *priv = chan->drm->fence;
-       struct nv50_fence_chan *fctx;
+       struct nv10_fence_priv *priv = chan->drm->fence;
+       struct nv10_fence_chan *fctx;
        struct ttm_mem_reg *mem = &priv->bo->bo.mem;
        struct nouveau_object *object;
        int ret, i;
@@ -91,7 +80,7 @@ nv50_fence_context_new(struct nouveau_channel *chan)
 int
 nv50_fence_create(struct nouveau_drm *drm)
 {
-       struct nv50_fence_priv *priv;
+       struct nv10_fence_priv *priv;
        int ret = 0;
 
        priv = drm->fence = kzalloc(sizeof(*priv), GFP_KERNEL);