drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/client.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/client.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/client.c- Extension
.c- Size
- 1046 bytes
- Lines
- 50
- 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.
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
rm.h
Detected Declarations
function Copyrightfunction nvkm_gsp_client_ctor
Annotated Snippet
#include "rm.h"
void
nvkm_gsp_client_dtor(struct nvkm_gsp_client *client)
{
const unsigned int id = client->object.handle - NVKM_RM_CLIENT(0);
struct nvkm_gsp *gsp = client->gsp;
if (!gsp)
return;
if (client->object.client)
nvkm_gsp_rm_free(&client->object);
mutex_lock(&gsp->client_id.mutex);
idr_remove(&gsp->client_id.idr, id);
mutex_unlock(&gsp->client_id.mutex);
client->gsp = NULL;
}
int
nvkm_gsp_client_ctor(struct nvkm_gsp *gsp, struct nvkm_gsp_client *client)
{
int id, ret;
if (WARN_ON(!gsp->rm))
return -ENOSYS;
mutex_lock(&gsp->client_id.mutex);
id = idr_alloc(&gsp->client_id.idr, client, 0, NVKM_RM_CLIENT_MASK + 1, GFP_KERNEL);
mutex_unlock(&gsp->client_id.mutex);
if (id < 0)
return id;
client->gsp = gsp;
client->object.client = client;
INIT_LIST_HEAD(&client->events);
ret = gsp->rm->api->client->ctor(client, NVKM_RM_CLIENT(id));
if (ret)
nvkm_gsp_client_dtor(client);
return ret;
}
Annotation
- Immediate include surface: `rm.h`.
- Detected declarations: `function Copyright`, `function nvkm_gsp_client_ctor`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.