drivers/gpu/drm/nouveau/nvif/client.c

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nvif/client.c

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/nouveau/nvif/client.c
Extension
.c
Size
2161 bytes
Lines
70
Domain
Driver Families
Bucket
drivers/gpu
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

#include <nvif/client.h>
#include <nvif/driver.h>
#include <nvif/ioctl.h>

#include <nvif/class.h>
#include <nvif/if0000.h>

int
nvif_client_suspend(struct nvif_client *client, bool runtime)
{
	return client->driver->suspend(client->object.priv, runtime);
}

int
nvif_client_resume(struct nvif_client *client)
{
	return client->driver->resume(client->object.priv);
}

void
nvif_client_dtor(struct nvif_client *client)
{
	nvif_object_dtor(&client->object);
	client->driver = NULL;
}

int
nvif_client_ctor(struct nvif_client *parent, const char *name, struct nvif_client *client)
{
	struct nvif_client_v0 args = {};
	int ret;

	strscpy_pad(args.name, name, sizeof(args.name));
	ret = nvif_object_ctor(parent != client ? &parent->object : NULL,
			       name ? name : "nvifClient", 0,
			       NVIF_CLASS_CLIENT, &args, sizeof(args),
			       &client->object);
	if (ret)
		return ret;

	client->object.client = client;
	client->object.handle = ~0;
	client->driver = parent->driver;
	return 0;
}

Annotation

Implementation Notes