drm/amd/display: Refactor PSR functionality into dedicated power_psr module
authorLohita Mudimela <lohita.mudimela@amd.com>
Wed, 22 Apr 2026 08:19:55 +0000 (13:49 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 19 May 2026 15:45:40 +0000 (11:45 -0400)
commitb11107cb63e40a69676081870ba5305c6c089ac3
treebe7f44ed005ca886463ba8de051ee7ded5c4425b
parentab5c6213cfd5fdc1c023002b5b7226adc65d91c4
drm/amd/display: Refactor PSR functionality into dedicated power_psr module

[Why]
Extract all PSR (Panel Self Refresh) related functions from power.c
into a new power_psr.c module for better code organization and
maintainability.

[How]
Create new power_psr.c file containing all PSR-related functions
moved from power.c. Remove static qualifier from shared functions
to enable cross-file access:
- psr_context_to_mod_power_psr_context: Convert PSR context to
  module power PSR context
- map_index_from_stream: Map stream to power entity index
- delay_two_frames: Wait for two frame periods

Add function declarations to header. Maintain forward declaration of struct
core_power for type compatibility.

Reviewed-by: Anthony Koo <anthony.koo@amd.com>
Signed-off-by: Lohita Mudimela <lohita.mudimela@amd.com>
Signed-off-by: Ivan Lipski <ivan.lipski@amd.com>
Tested-by: Dan 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
drivers/gpu/drm/amd/display/modules/power/power_helpers.c
drivers/gpu/drm/amd/display/modules/power/power_helpers.h
drivers/gpu/drm/amd/display/modules/power/power_psr.c [new file with mode: 0644]