提交 30d81817 编写于 作者: B Ben Skeggs

drm/nv50-nvc0: disp channels have fixed purposes, don't "allocate" them

Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
上级 59c0f578
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
struct nv50_display { struct nv50_display {
struct nouveau_channel *master; struct nouveau_channel *master;
u32 evo_alloc;
struct { struct {
struct dcb_entry *dcb; struct dcb_entry *dcb;
......
...@@ -33,15 +33,11 @@ static void ...@@ -33,15 +33,11 @@ static void
nv50_evo_channel_del(struct nouveau_channel **pevo) nv50_evo_channel_del(struct nouveau_channel **pevo)
{ {
struct nouveau_channel *evo = *pevo; struct nouveau_channel *evo = *pevo;
struct nv50_display *disp;
if (!evo) if (!evo)
return; return;
*pevo = NULL; *pevo = NULL;
disp = nv50_display(evo->dev);
disp->evo_alloc &= ~(1 << evo->id);
nouveau_gpuobj_channel_takedown(evo); nouveau_gpuobj_channel_takedown(evo);
nouveau_bo_unmap(evo->pushbuf_bo); nouveau_bo_unmap(evo->pushbuf_bo);
nouveau_bo_ref(NULL, &evo->pushbuf_bo); nouveau_bo_ref(NULL, &evo->pushbuf_bo);
...@@ -85,7 +81,8 @@ nv50_evo_dmaobj_new(struct nouveau_channel *evo, u32 class, u32 name, ...@@ -85,7 +81,8 @@ nv50_evo_dmaobj_new(struct nouveau_channel *evo, u32 class, u32 name,
} }
static int static int
nv50_evo_channel_new(struct drm_device *dev, struct nouveau_channel **pevo) nv50_evo_channel_new(struct drm_device *dev, int chid,
struct nouveau_channel **pevo)
{ {
struct nv50_display *disp = nv50_display(dev); struct nv50_display *disp = nv50_display(dev);
struct nouveau_channel *evo; struct nouveau_channel *evo;
...@@ -96,19 +93,7 @@ nv50_evo_channel_new(struct drm_device *dev, struct nouveau_channel **pevo) ...@@ -96,19 +93,7 @@ nv50_evo_channel_new(struct drm_device *dev, struct nouveau_channel **pevo)
return -ENOMEM; return -ENOMEM;
*pevo = evo; *pevo = evo;
for (evo->id = 0; evo->id < 5; evo->id++) { evo->id = chid;
if (disp->evo_alloc & (1 << evo->id))
continue;
disp->evo_alloc |= (1 << evo->id);
break;
}
if (evo->id == 5) {
kfree(evo);
return -ENODEV;
}
evo->dev = dev; evo->dev = dev;
evo->user_get = 4; evo->user_get = 4;
evo->user_put = 0; evo->user_put = 0;
...@@ -225,7 +210,7 @@ nv50_evo_create(struct drm_device *dev) ...@@ -225,7 +210,7 @@ nv50_evo_create(struct drm_device *dev)
/* create primary evo channel, the one we use for modesetting /* create primary evo channel, the one we use for modesetting
* purporses * purporses
*/ */
ret = nv50_evo_channel_new(dev, &disp->master); ret = nv50_evo_channel_new(dev, 0, &disp->master);
if (ret) if (ret)
return ret; return ret;
evo = disp->master; evo = disp->master;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册