drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c- Extension
.c- Size
- 28253 bytes
- Lines
- 762
- 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
drm/drm_print.hintel_backlight.hintel_display_core.hintel_display_types.hintel_dp.hintel_dp_aux_backlight.h
Detected Declarations
enum intel_dp_aux_backlight_modparamfunction is_intel_tcon_capfunction intel_dp_aux_supports_hdr_backlightfunction BITfunction intel_dp_aux_hdr_get_backlightfunction intel_dp_aux_hdr_set_aux_backlightfunction intel_dp_aux_hdr_set_backlightfunction intel_dp_aux_write_content_luminancefunction intel_dp_aux_fill_hdr_tcon_paramsfunction intel_dp_aux_hdr_enable_backlightfunction intel_dp_aux_hdr_disable_backlightfunction intel_dp_aux_write_panel_luminance_overridefunction intel_dp_aux_hdr_setup_backlightfunction intel_dp_aux_vesa_get_backlightfunction intel_dp_aux_vesa_set_backlightfunction intel_dp_aux_vesa_enable_backlightfunction intel_dp_aux_vesa_disable_backlightfunction intel_dp_aux_vesa_setup_backlightfunction check_if_vesa_backlight_possiblefunction intel_dp_aux_supports_vesa_backlightfunction intel_dp_aux_init_backlight_funcsfunction intel_dp_aux_supports_hdr_backlight
Annotated Snippet
BIT(HDMI_STATIC_METADATA_TYPE1))) {
drm_info(display->drm,
"[CONNECTOR:%d:%s] Panel is missing HDR static metadata. Possible support for Intel HDR backlight interface is not used. If your backlight controls don't work try booting with i915.enable_dpcd_backlight=%d.\n",
connector->base.base.id, connector->base.name,
INTEL_DP_AUX_BACKLIGHT_FORCE_INTEL);
return false;
}
panel->backlight.edp.intel_cap.sdr_uses_aux =
tcon_cap[2] & INTEL_EDP_SDR_TCON_BRIGHTNESS_AUX_CAP;
panel->backlight.edp.intel_cap.supports_2084_decode =
tcon_cap[1] & INTEL_EDP_HDR_TCON_2084_DECODE_CAP;
panel->backlight.edp.intel_cap.supports_2020_gamut =
tcon_cap[1] & INTEL_EDP_HDR_TCON_2020_GAMUT_CAP;
panel->backlight.edp.intel_cap.supports_segmented_backlight =
tcon_cap[1] & INTEL_EDP_HDR_TCON_SEGMENTED_BACKLIGHT_CAP;
panel->backlight.edp.intel_cap.supports_sdp_colorimetry =
tcon_cap[1] & INTEL_EDP_HDR_TCON_SDP_COLORIMETRY_CAP;
panel->backlight.edp.intel_cap.supports_tone_mapping =
tcon_cap[1] & INTEL_EDP_HDR_TCON_TONE_MAPPING_CAP;
return true;
}
static u32
intel_dp_aux_hdr_get_backlight(struct intel_connector *connector, enum pipe pipe)
{
struct intel_display *display = to_intel_display(connector);
struct intel_panel *panel = &connector->panel;
struct intel_dp *intel_dp = enc_to_intel_dp(connector->encoder);
u8 tmp;
u8 buf[2] = {};
if (drm_dp_dpcd_readb(&intel_dp->aux, INTEL_EDP_HDR_GETSET_CTRL_PARAMS, &tmp) != 1) {
drm_err(display->drm,
"[CONNECTOR:%d:%s] Failed to read current backlight mode from DPCD\n",
connector->base.base.id, connector->base.name);
return 0;
}
if (!(tmp & INTEL_EDP_HDR_TCON_BRIGHTNESS_AUX_ENABLE)) {
if (!panel->backlight.edp.intel_cap.sdr_uses_aux) {
u32 pwm_level = panel->backlight.pwm_funcs->get(connector, pipe);
return intel_backlight_level_from_pwm(connector, pwm_level);
}
/* Assume 100% brightness if backlight controls aren't enabled yet */
return panel->backlight.max;
}
if (drm_dp_dpcd_read(&intel_dp->aux, INTEL_EDP_BRIGHTNESS_NITS_LSB, buf,
sizeof(buf)) != sizeof(buf)) {
drm_err(display->drm,
"[CONNECTOR:%d:%s] Failed to read brightness from DPCD\n",
connector->base.base.id, connector->base.name);
return 0;
}
return (buf[1] << 8 | buf[0]);
}
static void
intel_dp_aux_hdr_set_aux_backlight(const struct drm_connector_state *conn_state, u32 level)
{
struct intel_connector *connector = to_intel_connector(conn_state->connector);
struct drm_device *dev = connector->base.dev;
struct intel_dp *intel_dp = enc_to_intel_dp(connector->encoder);
u8 buf[4] = {};
buf[0] = level & 0xFF;
buf[1] = (level & 0xFF00) >> 8;
if (drm_dp_dpcd_write(&intel_dp->aux, INTEL_EDP_BRIGHTNESS_NITS_LSB, buf,
sizeof(buf)) != sizeof(buf))
drm_err(dev, "[CONNECTOR:%d:%s] Failed to write brightness level to DPCD\n",
connector->base.base.id, connector->base.name);
}
static void
intel_dp_aux_hdr_set_backlight(const struct drm_connector_state *conn_state, u32 level)
{
struct intel_connector *connector = to_intel_connector(conn_state->connector);
struct intel_panel *panel = &connector->panel;
if (intel_dp_in_hdr_mode(conn_state) ||
panel->backlight.edp.intel_cap.sdr_uses_aux) {
intel_dp_aux_hdr_set_aux_backlight(conn_state, level);
} else {
const u32 pwm_level = intel_backlight_level_to_pwm(connector, level);
Annotation
- Immediate include surface: `drm/drm_print.h`, `intel_backlight.h`, `intel_display_core.h`, `intel_display_types.h`, `intel_dp.h`, `intel_dp_aux_backlight.h`.
- Detected declarations: `enum intel_dp_aux_backlight_modparam`, `function is_intel_tcon_cap`, `function intel_dp_aux_supports_hdr_backlight`, `function BIT`, `function intel_dp_aux_hdr_get_backlight`, `function intel_dp_aux_hdr_set_aux_backlight`, `function intel_dp_aux_hdr_set_backlight`, `function intel_dp_aux_write_content_luminance`, `function intel_dp_aux_fill_hdr_tcon_params`, `function intel_dp_aux_hdr_enable_backlight`.
- 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.