Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/display: Add BLNDGAM memory shutdown support

[Why]
The BLNDGAM memory blocks should be powered down when they're not in
use. This will reduce power consumption.

[How]
1. Write to BLNDGAM_MEM_PWR_FORCE to put memory to shutdown when BLNDGAM
is not used.
2. Added a debug option to allow this behaviour to be turned off

Signed-off-by: Jacky Liao <ziyu.liao@amd.com>
Reviewed-by: Eric Yang <eric.yang2@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Jacky Liao and committed by
Alex Deucher
49d067dc 63c954a1

+13 -4
+10 -3
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dpp.c
··· 500 500 { 501 501 struct dcn3_dpp *dpp = TO_DCN30_DPP(dpp_base); 502 502 503 - REG_SET(CM_MEM_PWR_CTRL, 0, 504 - BLNDGAM_MEM_PWR_FORCE, power_on == true ? 0:1); 505 - 503 + if (dpp_base->ctx->dc->debug.enable_mem_low_power.bits.cm) { 504 + REG_UPDATE(CM_MEM_PWR_CTRL, BLNDGAM_MEM_PWR_FORCE, power_on ? 0 : 3); 505 + if (power_on) 506 + REG_WAIT(CM_MEM_PWR_STATUS, BLNDGAM_MEM_PWR_STATE, 0, 1, 5); 507 + } else { 508 + REG_SET(CM_MEM_PWR_CTRL, 0, 509 + BLNDGAM_MEM_PWR_FORCE, power_on == true ? 0 : 1); 510 + } 506 511 } 507 512 508 513 static void dpp3_configure_blnd_lut( ··· 680 675 681 676 if (params == NULL) { 682 677 REG_SET(CM_BLNDGAM_CONTROL, 0, CM_BLNDGAM_MODE, 0); 678 + if (dpp_base->ctx->dc->debug.enable_mem_low_power.bits.cm) 679 + dpp3_power_on_blnd_lut(dpp_base, false); 683 680 return false; 684 681 } 685 682
+3 -1
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dpp.h
··· 343 343 TF_SF(DSCL0_DSCL_MEM_PWR_CTRL, LUT_MEM_PWR_FORCE, mask_sh) 344 344 345 345 #define DPP_REG_LIST_SH_MASK_DCN30_UPDATED(mask_sh)\ 346 + TF_SF(CM0_CM_MEM_PWR_STATUS, BLNDGAM_MEM_PWR_STATE, mask_sh), \ 346 347 TF_SF(CM0_CM_BLNDGAM_CONTROL, CM_BLNDGAM_MODE, mask_sh), \ 347 348 TF_SF(CM0_CM_BLNDGAM_CONTROL, CM_BLNDGAM_MODE_CURRENT, mask_sh), \ 348 349 TF_SF(CM0_CM_BLNDGAM_CONTROL, CM_BLNDGAM_SELECT_CURRENT, mask_sh), \ ··· 447 446 type CM_BLNDGAM_MODE_CURRENT; \ 448 447 type CM_BLNDGAM_SELECT_CURRENT; \ 449 448 type CM_BLNDGAM_SELECT; \ 450 - type GAMCOR_MEM_PWR_STATE 449 + type GAMCOR_MEM_PWR_STATE; \ 450 + type BLNDGAM_MEM_PWR_STATE 451 451 452 452 struct dcn3_dpp_shift { 453 453 DPP_REG_FIELD_LIST_DCN3(uint8_t);