Commit a4cea27b authored by Marcin Slusarz's avatar Marcin Slusarz Committed by Ben Skeggs

drm/nouveau: share fence structures between nv10+ and nv50 implementations

We already rely on them having the same fields and layout.
Signed-off-by: default avatarMarcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent a624bafb
...@@ -27,18 +27,7 @@ ...@@ -27,18 +27,7 @@
#include "nouveau_drm.h" #include "nouveau_drm.h"
#include "nouveau_dma.h" #include "nouveau_dma.h"
#include "nouveau_fence.h" #include "nv10_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;
};
int int
nv10_fence_emit(struct nouveau_fence *fence) nv10_fence_emit(struct nouveau_fence *fence)
......
#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
...@@ -27,27 +27,16 @@ ...@@ -27,27 +27,16 @@
#include "nouveau_drm.h" #include "nouveau_drm.h"
#include "nouveau_dma.h" #include "nouveau_dma.h"
#include "nouveau_fence.h" #include "nv10_fence.h"
#include "nv50_display.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 static int
nv50_fence_context_new(struct nouveau_channel *chan) nv50_fence_context_new(struct nouveau_channel *chan)
{ {
struct drm_device *dev = chan->drm->dev; struct drm_device *dev = chan->drm->dev;
struct nv50_fence_priv *priv = chan->drm->fence; struct nv10_fence_priv *priv = chan->drm->fence;
struct nv50_fence_chan *fctx; struct nv10_fence_chan *fctx;
struct ttm_mem_reg *mem = &priv->bo->bo.mem; struct ttm_mem_reg *mem = &priv->bo->bo.mem;
struct nouveau_object *object; struct nouveau_object *object;
int ret, i; int ret, i;
...@@ -91,7 +80,7 @@ nv50_fence_context_new(struct nouveau_channel *chan) ...@@ -91,7 +80,7 @@ nv50_fence_context_new(struct nouveau_channel *chan)
int int
nv50_fence_create(struct nouveau_drm *drm) nv50_fence_create(struct nouveau_drm *drm)
{ {
struct nv50_fence_priv *priv; struct nv10_fence_priv *priv;
int ret = 0; int ret = 0;
priv = drm->fence = kzalloc(sizeof(*priv), GFP_KERNEL); priv = drm->fence = kzalloc(sizeof(*priv), GFP_KERNEL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment