drivers/gpu/drm/amd/display/dc/core/dc_surface.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/core/dc_surface.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/core/dc_surface.c- Extension
.c- Size
- 8252 bytes
- Lines
- 323
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
dm_services.hdc.hcore_types.htransform.hdpp.hdc_plane_priv.h
Detected Declarations
function filesfunction dc_plane_destructfunction dc_plane_get_pipe_maskfunction dc_plane_state_retainfunction dc_plane_state_freefunction dc_plane_state_releasefunction dc_gamma_retainfunction dc_gamma_freefunction dc_gamma_releasefunction dc_transfer_func_retainfunction dc_transfer_func_freefunction dc_transfer_func_releasefunction dc_3dlut_func_freefunction dc_3dlut_func_releasefunction dc_3dlut_func_retainfunction dc_plane_force_dcc_and_tiling_disablefunction dc_plane_copy_config
Annotated Snippet
if (flags.bits.histogram) {
struct dpp *dpp = pipe_ctx->plane_res.dpp;
if (dpp && dpp->funcs->dpp_cm_hist_read)
dpp->funcs->dpp_cm_hist_read(dpp, &pipe_ctx->plane_state->status.cm_hist);
}
}
return plane_status;
}
void dc_plane_state_retain(struct dc_plane_state *plane_state)
{
kref_get(&plane_state->refcount);
}
static void dc_plane_state_free(struct kref *kref)
{
struct dc_plane_state *plane_state = container_of(kref, struct dc_plane_state, refcount);
dc_plane_destruct(plane_state);
kvfree(plane_state);
}
void dc_plane_state_release(struct dc_plane_state *plane_state)
{
kref_put(&plane_state->refcount, dc_plane_state_free);
}
void dc_gamma_retain(struct dc_gamma *gamma)
{
kref_get(&gamma->refcount);
}
static void dc_gamma_free(struct kref *kref)
{
struct dc_gamma *gamma = container_of(kref, struct dc_gamma, refcount);
kvfree(gamma);
}
void dc_gamma_release(struct dc_gamma **gamma)
{
kref_put(&(*gamma)->refcount, dc_gamma_free);
*gamma = NULL;
}
struct dc_gamma *dc_create_gamma(void)
{
struct dc_gamma *gamma = kvzalloc_obj(*gamma);
if (gamma == NULL)
goto alloc_fail;
kref_init(&gamma->refcount);
return gamma;
alloc_fail:
return NULL;
}
void dc_transfer_func_retain(struct dc_transfer_func *tf)
{
kref_get(&tf->refcount);
}
static void dc_transfer_func_free(struct kref *kref)
{
struct dc_transfer_func *tf = container_of(kref, struct dc_transfer_func, refcount);
kvfree(tf);
}
void dc_transfer_func_release(struct dc_transfer_func *tf)
{
kref_put(&tf->refcount, dc_transfer_func_free);
}
struct dc_transfer_func *dc_create_transfer_func(void)
{
struct dc_transfer_func *tf = kvzalloc_obj(*tf);
if (tf == NULL)
goto alloc_fail;
kref_init(&tf->refcount);
return tf;
alloc_fail:
return NULL;
}
Annotation
- Immediate include surface: `dm_services.h`, `dc.h`, `core_types.h`, `transform.h`, `dpp.h`, `dc_plane_priv.h`.
- Detected declarations: `function files`, `function dc_plane_destruct`, `function dc_plane_get_pipe_mask`, `function dc_plane_state_retain`, `function dc_plane_state_free`, `function dc_plane_state_release`, `function dc_gamma_retain`, `function dc_gamma_free`, `function dc_gamma_release`, `function dc_transfer_func_retain`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
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.