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

drm/i915/pmdemand: make struct intel_pmdemand_state opaque

Only intel_pmdemand.c should look inside the struct
intel_pmdemand_state. Indeed, this is already the case. Finish the job
and make struct intel_pmdemand_state opaque, preventing any direct pokes
at the guts of it in the future.

Cc: Gustavo Sousa <gustavo.sousa@intel.com>
Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/bc5f418785ecd51454761e9a55f21340470a92e3.1735662324.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>

+32 -30
+28
drivers/gpu/drm/i915/display/intel_pmdemand.c
··· 15 15 #include "intel_pmdemand.h" 16 16 #include "skl_watermark.h" 17 17 18 + struct pmdemand_params { 19 + u16 qclk_gv_bw; 20 + u8 voltage_index; 21 + u8 qclk_gv_index; 22 + u8 active_pipes; 23 + u8 active_dbufs; /* pre-Xe3 only */ 24 + /* Total number of non type C active phys from active_phys_mask */ 25 + u8 active_phys; 26 + u8 plls; 27 + u16 cdclk_freq_mhz; 28 + /* max from ddi_clocks[] */ 29 + u16 ddiclk_max; 30 + u8 scalers; /* pre-Xe3 only */ 31 + }; 32 + 33 + struct intel_pmdemand_state { 34 + struct intel_global_state base; 35 + 36 + /* Maintain a persistent list of port clocks across all crtcs */ 37 + int ddi_clocks[I915_MAX_PIPES]; 38 + 39 + /* Maintain a persistent list of non type C phys mask */ 40 + u16 active_combo_phys_mask; 41 + 42 + /* Parameters to be configured in the pmdemand registers */ 43 + struct pmdemand_params params; 44 + }; 45 + 18 46 struct intel_pmdemand_state *to_intel_pmdemand_state(struct intel_global_state *obj_state) 19 47 { 20 48 return container_of(obj_state, struct intel_pmdemand_state, base);
+4 -30
drivers/gpu/drm/i915/display/intel_pmdemand.h
··· 6 6 #ifndef __INTEL_PMDEMAND_H__ 7 7 #define __INTEL_PMDEMAND_H__ 8 8 9 - #include "intel_display_limits.h" 10 - #include "intel_global_state.h" 9 + #include <linux/types.h> 11 10 11 + enum pipe; 12 12 struct drm_i915_private; 13 13 struct intel_atomic_state; 14 14 struct intel_crtc_state; 15 15 struct intel_encoder; 16 + struct intel_global_state; 16 17 struct intel_plane_state; 17 - 18 - struct pmdemand_params { 19 - u16 qclk_gv_bw; 20 - u8 voltage_index; 21 - u8 qclk_gv_index; 22 - u8 active_pipes; 23 - u8 active_dbufs; /* pre-Xe3 only */ 24 - /* Total number of non type C active phys from active_phys_mask */ 25 - u8 active_phys; 26 - u8 plls; 27 - u16 cdclk_freq_mhz; 28 - /* max from ddi_clocks[] */ 29 - u16 ddiclk_max; 30 - u8 scalers; /* pre-Xe3 only */ 31 - }; 32 - 33 - struct intel_pmdemand_state { 34 - struct intel_global_state base; 35 - 36 - /* Maintain a persistent list of port clocks across all crtcs */ 37 - int ddi_clocks[I915_MAX_PIPES]; 38 - 39 - /* Maintain a persistent list of non type C phys mask */ 40 - u16 active_combo_phys_mask; 41 - 42 - /* Parameters to be configured in the pmdemand registers */ 43 - struct pmdemand_params params; 44 - }; 18 + struct intel_pmdemand_state; 45 19 46 20 struct intel_pmdemand_state *to_intel_pmdemand_state(struct intel_global_state *obj_state); 47 21