Skip to content

Commit ca09800

Browse files
committed
drm/i915/power: relocate {SKL,ICL}_PW_CTL_IDX_TO_PG()
Move the {SKL,ICL}_PW_CTL_IDX_TO_PG() macros from intel_display_regs.h to intel_display_power_well.c. The mapping from index to PG can be hidden there. Reviewed-by: Rodrigo Vivi <[email protected]> Link: https://lore.kernel.org/r/18e40b77eeb3517a056f1e567672163ec568ec55.1750855148.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <[email protected]>
1 parent c7cefe4 commit ca09800

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

drivers/gpu/drm/i915/display/intel_display_power_well.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@
3434
#include "vlv_iosf_sb_reg.h"
3535
#include "vlv_sideband.h"
3636

37+
/*
38+
* PG0 is HW controlled, so doesn't have a corresponding power well control knob
39+
* SKL_DISP_PW1_IDX..SKL_DISP_PW2_IDX -> PG1..PG2
40+
*/
41+
#define SKL_PW_CTL_IDX_TO_PG(pw_idx) \
42+
((pw_idx) - SKL_PW_CTL_IDX_PW_1 + SKL_PG1)
43+
/*
44+
* PG0 is HW controlled, so doesn't have a corresponding power well control knob
45+
* ICL_DISP_PW1_IDX..ICL_DISP_PW4_IDX -> PG1..PG4
46+
*/
47+
#define ICL_PW_CTL_IDX_TO_PG(pw_idx) \
48+
((pw_idx) - ICL_PW_CTL_IDX_PW_1 + SKL_PG1)
49+
3750
struct i915_power_well_regs {
3851
i915_reg_t bios;
3952
i915_reg_t driver;

drivers/gpu/drm/i915/display/intel_display_regs.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2206,18 +2206,6 @@ enum skl_power_gate {
22062206

22072207
#define SKL_FUSE_STATUS _MMIO(0x42000)
22082208
#define SKL_FUSE_DOWNLOAD_STATUS (1 << 31)
2209-
/*
2210-
* PG0 is HW controlled, so doesn't have a corresponding power well control knob
2211-
* SKL_DISP_PW1_IDX..SKL_DISP_PW2_IDX -> PG1..PG2
2212-
*/
2213-
#define SKL_PW_CTL_IDX_TO_PG(pw_idx) \
2214-
((pw_idx) - SKL_PW_CTL_IDX_PW_1 + SKL_PG1)
2215-
/*
2216-
* PG0 is HW controlled, so doesn't have a corresponding power well control knob
2217-
* ICL_DISP_PW1_IDX..ICL_DISP_PW4_IDX -> PG1..PG4
2218-
*/
2219-
#define ICL_PW_CTL_IDX_TO_PG(pw_idx) \
2220-
((pw_idx) - ICL_PW_CTL_IDX_PW_1 + SKL_PG1)
22212209
#define SKL_FUSE_PG_DIST_STATUS(pg) (1 << (27 - (pg)))
22222210

22232211
/* Per-pipe DDI Function Control */

0 commit comments

Comments
 (0)