Esempio n. 1
0
int
nouveau_fifo_create_(struct nouveau_object *parent,
		     struct nouveau_object *engine,
		     struct nouveau_oclass *oclass,
		     int min, int max, int length, void **pobject)
{
	struct nouveau_fifo *priv;
	int ret;

	ret = nouveau_engine_create_(parent, engine, oclass, true, "PFIFO",
				     "fifo", length, pobject);
	priv = *pobject;
	if (ret)
		return ret;

	priv->min = min;
	priv->max = max;
	priv->channel = kzalloc(sizeof(*priv->channel) * (max + 1), GFP_KERNEL);
	if (!priv->channel)
		return -ENOMEM;

	ret = nouveau_event_create(1, &priv->cevent);
	if (ret)
		return ret;

	ret = nouveau_event_create(1, &priv->uevent);
	if (ret)
		return ret;

	priv->chid = nouveau_fifo_chid;
	spin_lock_init(&priv->lock);
	return 0;
}
Esempio n. 2
0
int
nouveau_disp_create_(struct nouveau_object *parent,
                     struct nouveau_object *engine,
                     struct nouveau_oclass *oclass, int heads,
                     const char *intname, const char *extname,
                     int length, void **pobject)
{
    struct nouveau_disp *disp;
    int ret;

    ret = nouveau_engine_create_(parent, engine, oclass, true,
                                 intname, extname, length, pobject);
    disp = *pobject;
    if (ret)
        return ret;

    return nouveau_event_create(heads, &disp->vblank);
}
Esempio n. 3
0
int
nouveau_xtensa_create_(struct nouveau_object *parent,
		       struct nouveau_object *engine,
		       struct nouveau_oclass *oclass, u32 addr, bool enable,
		       const char *iname, const char *fname,
		       int length, void **pobject)
{
	struct nouveau_xtensa *xtensa;
	int ret;

	ret = nouveau_engine_create_(parent, engine, oclass, enable, iname,
				     fname, length, pobject);
	xtensa = *pobject;
	if (ret)
		return ret;

	nv_subdev(xtensa)->intr = _nouveau_xtensa_intr;

	xtensa->addr = addr;

	return 0;
}