int
nouveau_channel_idle(struct nouveau_channel *chan)
{
- struct nouveau_drm *drm = chan->drm;
+ struct nouveau_cli *cli = chan->cli;
struct nouveau_fence *fence = NULL;
int ret;
}
if (ret)
- NV_ERROR(drm, "failed to idle channel 0x%08x\n", chan->handle);
+ NV_ERROR(cli, "failed to idle channel 0x%08x\n", chan->handle);
return ret;
}
return 0;
}
-int
+static int
nouveau_channel_ind(struct nouveau_drm *drm, struct nouveau_cli *cli,
u32 parent, u32 handle, u32 engine,
struct nouveau_channel **pchan)
{
- static const u16 oclasses[] = { 0xa06f, 0x906f, 0x826f, 0x506f, 0 };
+ static const u16 oclasses[] = { NVE0_CHANNEL_IND_CLASS,
+ NVC0_CHANNEL_IND_CLASS,
+ NV84_CHANNEL_IND_CLASS,
+ NV50_CHANNEL_IND_CLASS,
+ 0 };
const u16 *oclass = oclasses;
struct nve0_channel_ind_class args;
struct nouveau_channel *chan;
nouveau_channel_dma(struct nouveau_drm *drm, struct nouveau_cli *cli,
u32 parent, u32 handle, struct nouveau_channel **pchan)
{
- static const u16 oclasses[] = { 0x406e, 0x176e, 0x006e, 0x006b, 0 };
+ static const u16 oclasses[] = { NV40_CHANNEL_DMA_CLASS,
+ NV17_CHANNEL_DMA_CLASS,
+ NV10_CHANNEL_DMA_CLASS,
+ NV03_CHANNEL_DMA_CLASS,
+ 0 };
const u16 *oclass = oclasses;
- struct nv_channel_dma_class args;
+ struct nv03_channel_dma_class args;
struct nouveau_channel *chan;
int ret;
ret = nouveau_channel_ind(drm, cli, parent, handle, arg0, pchan);
if (ret) {
- NV_DEBUG(drm, "ib channel create, %d\n", ret);
+ NV_DEBUG(cli, "ib channel create, %d\n", ret);
ret = nouveau_channel_dma(drm, cli, parent, handle, pchan);
if (ret) {
- NV_DEBUG(drm, "dma channel create, %d\n", ret);
+ NV_DEBUG(cli, "dma channel create, %d\n", ret);
return ret;
}
}
ret = nouveau_channel_init(*pchan, arg0, arg1);
if (ret) {
- NV_ERROR(drm, "channel failed to initialise, %d\n", ret);
+ NV_ERROR(cli, "channel failed to initialise, %d\n", ret);
nouveau_channel_del(pchan);
return ret;
}