Example #1
0
static int
nouveau_cli_init(struct nouveau_drm *drm, const char *sname,
		 struct nouveau_cli *cli)
{
	u64 device = nouveau_name(drm->dev);
	int ret;

	snprintf(cli->name, sizeof(cli->name), "%s", sname);
	cli->dev = drm->dev;
	mutex_init(&cli->mutex);
	usif_client_init(cli);

	if (cli == &drm->client) {
		ret = nvif_driver_init(NULL, nouveau_config, nouveau_debug,
				       cli->name, device, &cli->base);
	} else {
		ret = nvif_client_init(&drm->client.base, cli->name, device,
				       &cli->base);
	}
	if (ret) {
		NV_ERROR(drm, "Client allocation failed: %d\n", ret);
		goto done;
	}

	ret = nvif_device_init(&cli->base.object, 0, NV_DEVICE,
			       &(struct nv_device_v0) {
					.device = ~0,
			       }, sizeof(struct nv_device_v0),
Example #2
0
static int
nouveau_cli_create(u64 name, const char *sname,
                   int size, void **pcli)
{
    struct nouveau_cli *cli = *pcli = kzalloc(size, GFP_KERNEL);
    if (cli) {
        int ret = nvif_client_init(NULL, NULL, sname, name,
                                   nouveau_config, nouveau_debug,
                                   &cli->base);
        if (ret == 0) {
            mutex_init(&cli->mutex);
            usif_client_init(cli);
        }
        return ret;
    }
    return -ENOMEM;
}
Example #3
0
int
nvif_client_new(const char *driver, const char *name, u64 device,
		const char *cfg, const char *dbg,
		struct nvif_client **pclient)
{
	struct nvif_client *client = kzalloc(sizeof(*client), GFP_KERNEL);
	if (client) {
		int ret = nvif_client_init(nvif_client_del, driver, name,
					   device, cfg, dbg, client);
		if (ret) {
			kfree(client);
			client = NULL;
		}
		*pclient = client;
		return ret;
	}
	return -ENOMEM;
}
Example #4
0
static int
nouveau_cli_create(struct drm_device *dev, const char *sname,
		   int size, void **pcli)
{
	struct nouveau_cli *cli = *pcli = kzalloc(size, GFP_KERNEL);
	int ret;
	if (cli) {
		snprintf(cli->name, sizeof(cli->name), "%s", sname);
		cli->dev = dev;

		ret = nvif_client_init(NULL, cli->name, nouveau_name(dev),
				       nouveau_config, nouveau_debug,
				       &cli->base);
		if (ret == 0) {
			mutex_init(&cli->mutex);
			usif_client_init(cli);
		}
		return ret;
	}
	return -ENOMEM;
}