]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/i915/pmdemand: make struct intel_pmdemand_state opaque
authorJani Nikula <jani.nikula@intel.com>
Tue, 31 Dec 2024 16:27:38 +0000 (18:27 +0200)
committerJani Nikula <jani.nikula@intel.com>
Tue, 7 Jan 2025 17:31:39 +0000 (19:31 +0200)
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>
drivers/gpu/drm/i915/display/intel_pmdemand.c
drivers/gpu/drm/i915/display/intel_pmdemand.h

index 69b40b3735b3da4c51c0f185ccda0b6dd8306742..500faf639290e5234e7120942695298aaca44be4 100644 (file)
 #include "intel_pmdemand.h"
 #include "skl_watermark.h"
 
+struct pmdemand_params {
+       u16 qclk_gv_bw;
+       u8 voltage_index;
+       u8 qclk_gv_index;
+       u8 active_pipes;
+       u8 active_dbufs;        /* pre-Xe3 only */
+       /* Total number of non type C active phys from active_phys_mask */
+       u8 active_phys;
+       u8 plls;
+       u16 cdclk_freq_mhz;
+       /* max from ddi_clocks[] */
+       u16 ddiclk_max;
+       u8 scalers;             /* pre-Xe3 only */
+};
+
+struct intel_pmdemand_state {
+       struct intel_global_state base;
+
+       /* Maintain a persistent list of port clocks across all crtcs */
+       int ddi_clocks[I915_MAX_PIPES];
+
+       /* Maintain a persistent list of non type C phys mask */
+       u16 active_combo_phys_mask;
+
+       /* Parameters to be configured in the pmdemand registers */
+       struct pmdemand_params params;
+};
+
 struct intel_pmdemand_state *to_intel_pmdemand_state(struct intel_global_state *obj_state)
 {
        return container_of(obj_state, struct intel_pmdemand_state, base);
index 89296364ec3bd1164ab80e0badf40b6ad0cc7dff..34f68912fe04a869bd5e9950723c309911a8485b 100644 (file)
@@ -6,42 +6,16 @@
 #ifndef __INTEL_PMDEMAND_H__
 #define __INTEL_PMDEMAND_H__
 
-#include "intel_display_limits.h"
-#include "intel_global_state.h"
+#include <linux/types.h>
 
+enum pipe;
 struct drm_i915_private;
 struct intel_atomic_state;
 struct intel_crtc_state;
 struct intel_encoder;
+struct intel_global_state;
 struct intel_plane_state;
-
-struct pmdemand_params {
-       u16 qclk_gv_bw;
-       u8 voltage_index;
-       u8 qclk_gv_index;
-       u8 active_pipes;
-       u8 active_dbufs;        /* pre-Xe3 only */
-       /* Total number of non type C active phys from active_phys_mask */
-       u8 active_phys;
-       u8 plls;
-       u16 cdclk_freq_mhz;
-       /* max from ddi_clocks[] */
-       u16 ddiclk_max;
-       u8 scalers;             /* pre-Xe3 only */
-};
-
-struct intel_pmdemand_state {
-       struct intel_global_state base;
-
-       /* Maintain a persistent list of port clocks across all crtcs */
-       int ddi_clocks[I915_MAX_PIPES];
-
-       /* Maintain a persistent list of non type C phys mask */
-       u16 active_combo_phys_mask;
-
-       /* Parameters to be configured in the pmdemand registers */
-       struct pmdemand_params params;
-};
+struct intel_pmdemand_state;
 
 struct intel_pmdemand_state *to_intel_pmdemand_state(struct intel_global_state *obj_state);