drivers/gpu/drm/amd/display/dc/dce/dce_ipp.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/dce/dce_ipp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/dce/dce_ipp.c- Extension
.c- Size
- 9020 bytes
- Lines
- 313
- 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
dce_ipp.hreg_helper.hdm_services.h
Detected Declarations
function filesfunction dce_ipp_cursor_set_attributesfunction dce_ipp_program_prescalefunction dce_ipp_program_input_lutfunction dce_ipp_set_degammafunction dce60_ipp_set_degammafunction dce_ipp_constructfunction dce60_ipp_constructfunction dce_ipp_destroy
Annotated Snippet
#include "dce_ipp.h"
#include "reg_helper.h"
#include "dm_services.h"
#define REG(reg) \
(ipp_dce->regs->reg)
#undef FN
#define FN(reg_name, field_name) \
ipp_dce->ipp_shift->field_name, ipp_dce->ipp_mask->field_name
#define CTX \
ipp_dce->base.ctx
static void dce_ipp_cursor_set_position(
struct input_pixel_processor *ipp,
const struct dc_cursor_position *position,
const struct dc_cursor_mi_param *param)
{
(void)param;
struct dce_ipp *ipp_dce = TO_DCE_IPP(ipp);
/* lock cursor registers */
REG_UPDATE(CUR_UPDATE, CURSOR_UPDATE_LOCK, true);
/* Flag passed in structure differentiates cursor enable/disable. */
/* Update if it differs from cached state. */
REG_UPDATE(CUR_CONTROL, CURSOR_EN, position->enable);
REG_SET_2(CUR_POSITION, 0,
CURSOR_X_POSITION, position->x,
CURSOR_Y_POSITION, position->y);
REG_SET_2(CUR_HOT_SPOT, 0,
CURSOR_HOT_SPOT_X, position->x_hotspot,
CURSOR_HOT_SPOT_Y, position->y_hotspot);
/* unlock cursor registers */
REG_UPDATE(CUR_UPDATE, CURSOR_UPDATE_LOCK, false);
}
static void dce_ipp_cursor_set_attributes(
struct input_pixel_processor *ipp,
const struct dc_cursor_attributes *attributes)
{
struct dce_ipp *ipp_dce = TO_DCE_IPP(ipp);
int mode;
/* Lock cursor registers */
REG_UPDATE(CUR_UPDATE, CURSOR_UPDATE_LOCK, true);
/* Program cursor control */
switch (attributes->color_format) {
case CURSOR_MODE_MONO:
mode = 0;
break;
case CURSOR_MODE_COLOR_1BIT_AND:
mode = 1;
break;
case CURSOR_MODE_COLOR_PRE_MULTIPLIED_ALPHA:
mode = 2;
break;
case CURSOR_MODE_COLOR_UN_PRE_MULTIPLIED_ALPHA:
mode = 3;
break;
default:
BREAK_TO_DEBUGGER(); /* unsupported */
mode = 0;
}
REG_UPDATE_3(CUR_CONTROL,
CURSOR_MODE, mode,
CURSOR_2X_MAGNIFY, attributes->attribute_flags.bits.ENABLE_MAGNIFICATION,
CUR_INV_TRANS_CLAMP, attributes->attribute_flags.bits.INVERSE_TRANSPARENT_CLAMPING);
if (attributes->color_format == CURSOR_MODE_MONO) {
REG_SET_3(CUR_COLOR1, 0,
CUR_COLOR1_BLUE, 0,
CUR_COLOR1_GREEN, 0,
CUR_COLOR1_RED, 0);
REG_SET_3(CUR_COLOR2, 0,
CUR_COLOR2_BLUE, 0xff,
CUR_COLOR2_GREEN, 0xff,
CUR_COLOR2_RED, 0xff);
}
/*
* Program cursor size -- NOTE: HW spec specifies that HW register
Annotation
- Immediate include surface: `dce_ipp.h`, `reg_helper.h`, `dm_services.h`.
- Detected declarations: `function files`, `function dce_ipp_cursor_set_attributes`, `function dce_ipp_program_prescale`, `function dce_ipp_program_input_lut`, `function dce_ipp_set_degamma`, `function dce60_ipp_set_degamma`, `function dce_ipp_construct`, `function dce60_ipp_construct`, `function dce_ipp_destroy`.
- 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.