From 82d23aea108886c869fce4c1e3178db5f57b6e9c Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Mon, 8 Oct 2012 13:39:13 +1000 Subject: [PATCH] drm/nvc0/dmaobj: stub bind function for now so we can call unconditionally Signed-off-by: Ben Skeggs --- .../gpu/drm/nouveau/core/engine/dmaobj/nvc0.c | 23 +++++++++++++++++++ .../gpu/drm/nouveau/core/engine/fifo/base.c | 9 +++----- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/nouveau/core/engine/dmaobj/nvc0.c b/drivers/gpu/drm/nouveau/core/engine/dmaobj/nvc0.c index 36de44916292..6fe20d21158f 100644 --- a/drivers/gpu/drm/nouveau/core/engine/dmaobj/nvc0.c +++ b/drivers/gpu/drm/nouveau/core/engine/dmaobj/nvc0.c @@ -23,13 +23,35 @@ */ #include +#include +#include +#include #include struct nvc0_dmaeng_priv { struct nouveau_dmaeng base; }; +static int +nvc0_dmaobj_bind(struct nouveau_dmaeng *dmaeng, + struct nouveau_object *parent, + struct nouveau_dmaobj *dmaobj, + struct nouveau_gpuobj **pgpuobj) +{ + int ret = 0; + + if (!nv_iclass(parent, NV_ENGCTX_CLASS)) { + switch (nv_mclass(parent->parent)) { + default: + return -EINVAL; + } + } else + return 0; + + return ret; +} + static int nvc0_dmaeng_ctor(struct nouveau_object *parent, struct nouveau_object *engine, struct nouveau_oclass *oclass, void *data, u32 size, @@ -44,6 +66,7 @@ nvc0_dmaeng_ctor(struct nouveau_object *parent, struct nouveau_object *engine, return ret; nv_engine(priv)->sclass = nouveau_dmaobj_sclass; + priv->base.bind = nvc0_dmaobj_bind; return 0; } diff --git a/drivers/gpu/drm/nouveau/core/engine/fifo/base.c b/drivers/gpu/drm/nouveau/core/engine/fifo/base.c index ca4050c6ea5f..a7f41f8725cd 100644 --- a/drivers/gpu/drm/nouveau/core/engine/fifo/base.c +++ b/drivers/gpu/drm/nouveau/core/engine/fifo/base.c @@ -64,12 +64,9 @@ nouveau_fifo_channel_create_(struct nouveau_object *parent, return -EINVAL; } - if (dmaeng->bind) { - ret = dmaeng->bind(dmaeng, parent, chan->pushdma, - &chan->pushgpu); - if (ret) - return ret; - } + ret = dmaeng->bind(dmaeng, parent, chan->pushdma, &chan->pushgpu); + if (ret) + return ret; /* find a free fifo channel */ spin_lock_irqsave(&priv->lock, flags); -- 2.20.1