Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 345395
b: refs/heads/master
c: 6c1689a
h: refs/heads/master
i:
  345393: 76aca83
  345391: 03fe6fb
v: v3
  • Loading branch information
Ben Skeggs committed Nov 28, 2012
1 parent 2a538e7 commit 11b6b11
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f86770aaaa9a4d9cc68c8a9adc351ab7f47e6345
refs/heads/master: 6c1689a08cf54e58c19eb565528a293f36f731be
18 changes: 6 additions & 12 deletions trunk/drivers/gpu/drm/nouveau/core/engine/dmaobj/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,21 +88,15 @@ nouveau_dmaobj_ctor(struct nouveau_object *parent,

switch (nv_mclass(parent)) {
case NV_DEVICE_CLASS:
/* delayed, or no, binding */
break;
case NV03_CHANNEL_DMA_CLASS:
case NV10_CHANNEL_DMA_CLASS:
case NV17_CHANNEL_DMA_CLASS:
case NV40_CHANNEL_DMA_CLASS:
case NV50_CHANNEL_DMA_CLASS:
case NV84_CHANNEL_DMA_CLASS:
case NV50_CHANNEL_IND_CLASS:
case NV84_CHANNEL_IND_CLASS:
default:
ret = dmaeng->bind(dmaeng, *pobject, dmaobj, &gpuobj);
nouveau_object_ref(NULL, pobject);
*pobject = nv_object(gpuobj);
if (ret == 0) {
nouveau_object_ref(NULL, pobject);
*pobject = nv_object(gpuobj);
}
break;
default:
return -EINVAL;
}

return ret;
Expand Down
12 changes: 12 additions & 0 deletions trunk/drivers/gpu/drm/nouveau/core/engine/dmaobj/nv04.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@ nv04_dmaobj_bind(struct nouveau_dmaeng *dmaeng,
u32 length = dmaobj->limit - dmaobj->start;
int ret;

if (!nv_iclass(parent, NV_ENGCTX_CLASS)) {
switch (nv_mclass(parent->parent)) {
case NV03_CHANNEL_DMA_CLASS:
case NV10_CHANNEL_DMA_CLASS:
case NV17_CHANNEL_DMA_CLASS:
case NV40_CHANNEL_DMA_CLASS:
break;
default:
return -EINVAL;
}
}

if (dmaobj->target == NV_MEM_TARGET_VM) {
if (nv_object(vmm)->oclass == &nv04_vmmgr_oclass) {
struct nouveau_gpuobj *pgt = vmm->vm->pgt[0].obj[0];
Expand Down
12 changes: 12 additions & 0 deletions trunk/drivers/gpu/drm/nouveau/core/engine/dmaobj/nv50.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ nv50_dmaobj_bind(struct nouveau_dmaeng *dmaeng,
u32 flags = nv_mclass(dmaobj);
int ret;

if (!nv_iclass(parent, NV_ENGCTX_CLASS)) {
switch (nv_mclass(parent->parent)) {
case NV50_CHANNEL_DMA_CLASS:
case NV84_CHANNEL_DMA_CLASS:
case NV50_CHANNEL_IND_CLASS:
case NV84_CHANNEL_IND_CLASS:
break;
default:
return -EINVAL;
}
}

switch (dmaobj->target) {
case NV_MEM_TARGET_VM:
flags |= 0x00000000;
Expand Down
8 changes: 5 additions & 3 deletions trunk/drivers/gpu/drm/nouveau/core/engine/fifo/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include <core/object.h>
#include <core/handle.h>
#include <core/class.h>

#include <engine/dmaobj.h>
#include <engine/fifo.h>
Expand Down Expand Up @@ -56,15 +57,16 @@ nouveau_fifo_channel_create_(struct nouveau_object *parent,

dmaeng = (void *)chan->pushdma->base.engine;
switch (chan->pushdma->base.oclass->handle) {
case 0x0002:
case 0x003d:
case NV_DMA_FROM_MEMORY_CLASS:
case NV_DMA_IN_MEMORY_CLASS:
break;
default:
return -EINVAL;
}

if (dmaeng->bind) {
ret = dmaeng->bind(dmaeng, parent, chan->pushdma, &chan->pushgpu);
ret = dmaeng->bind(dmaeng, parent, chan->pushdma,
&chan->pushgpu);
if (ret)
return ret;
}
Expand Down
8 changes: 6 additions & 2 deletions trunk/drivers/gpu/drm/nouveau/core/include/engine/dmaobj.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ struct nouveau_dmaobj {

struct nouveau_dmaeng {
struct nouveau_engine base;
int (*bind)(struct nouveau_dmaeng *, struct nouveau_object *parent,
struct nouveau_dmaobj *, struct nouveau_gpuobj **);

/* creates a "physical" dma object from a struct nouveau_dmaobj */
int (*bind)(struct nouveau_dmaeng *dmaeng,
struct nouveau_object *parent,
struct nouveau_dmaobj *dmaobj,
struct nouveau_gpuobj **);
};

#define nouveau_dmaeng_create(p,e,c,d) \
Expand Down

0 comments on commit 11b6b11

Please sign in to comment.