]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/amd/display: Separate ABM functions into dedicated power_abm.c file
authorLohita Mudimela <lohita.mudimela@amd.com>
Tue, 10 Mar 2026 12:16:01 +0000 (17:46 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 11 May 2026 20:10:51 +0000 (16:10 -0400)
commit254a47ce0c8a52ff78a60f92a13b56db69f69096
tree9b8b9e4bf0ea2b5a9cfdc91cc640034138eb31b2
parenta349b97b88e26a88171b8672cee744cac2cff5ae
drm/amd/display: Separate ABM functions into dedicated power_abm.c file

[Why]
Improves code organization by separating Adaptive Backlight
Modulation functionality from general power management.
This modular approach enhances maintainability and makes the
codebase easier to navigate.

[How]
Create new power_abm.c file containing all ABM-related functions moved from power.c.
Remove static qualifier from shared functions to enable cross-file access:
- initialize_backlight_caps: Initialize backlight capabilities
- validate_ext_backlight_caps: Validate external backlight capabilities
- backlight_millipercent_to_pwm: Convert brightness percent to PWM
- backlight_millipercent_to_millinit: Convert brightness percent to nits
- fill_backlight_level_params: Populate backlight level parametersAdd function
declarations to mod_power.h header. Update CMakeLists.txt to include power_abm.c in build.
Maintain forward declaration of struct core_power for type compatibility.
Rename struct core_power field from 'public' to 'mod_public'.
Move internal structures (backlight_state, backlight_properties,
dmcu_varibright_cached_properties, core_power) to power_helpers.h to
ensure consistent memory layouts across compilation units.

Reviewed-by: Martin Leung <martin.leung@amd.com>
Signed-off-by: Lohita Mudimela <lohita.mudimela@amd.com>
Signed-off-by: James Lin <pinglei.lin@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/modules/inc/mod_power.h
drivers/gpu/drm/amd/display/modules/power/Makefile
drivers/gpu/drm/amd/display/modules/power/power.c
drivers/gpu/drm/amd/display/modules/power/power_abm.c [new file with mode: 0644]
drivers/gpu/drm/amd/display/modules/power/power_helpers.c
drivers/gpu/drm/amd/display/modules/power/power_helpers.h