drm/i915/cdclk: turn around i915_drv.h and intel_cdclk.h dependency
authorJani Nikula <jani.nikula@intel.com>
Mon, 13 Dec 2021 11:41:05 +0000 (13:41 +0200)
committerJani Nikula <jani.nikula@intel.com>
Tue, 14 Dec 2021 18:41:21 +0000 (20:41 +0200)
intel_cdclk.h only needs i915_drv.h for struct intel_cdclk_config. Move
the definition to intel_cdclk.h and turn the includes around to avoid
including i915_drv.h from other headers.

The intel cdclk state macros in intel_cdclk.h still reference struct
drm_i915_private, but as macros they don't strictly require the
definition until they are used.

v2: Expand on the commit message wrt cdclk state macros

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211213114106.296017-1-jani.nikula@intel.com
drivers/gpu/drm/i915/display/intel_atomic.c
drivers/gpu/drm/i915/display/intel_cdclk.h
drivers/gpu/drm/i915/i915_drv.h

index a62550711e98cd6dda2d0384dd61ba753b2acd7b..1080741d15613a58dd9a2cd461914c9506f5a696 100644 (file)
@@ -34,6 +34,7 @@
 #include <drm/drm_fourcc.h>
 #include <drm/drm_plane_helper.h>
 
+#include "i915_drv.h"
 #include "intel_atomic.h"
 #include "intel_cdclk.h"
 #include "intel_display_types.h"
index fc638522e44541bb42d48389a5c69ff13612b1d7..71dd84740ae3152ba17ccb8c7d31c6bdb36828d8 100644 (file)
@@ -8,7 +8,6 @@
 
 #include <linux/types.h>
 
-#include "i915_drv.h"
 #include "intel_display.h"
 #include "intel_global_state.h"
 
@@ -16,6 +15,11 @@ struct drm_i915_private;
 struct intel_atomic_state;
 struct intel_crtc_state;
 
+struct intel_cdclk_config {
+       unsigned int cdclk, vco, ref, bypass;
+       u8 voltage_level;
+};
+
 struct intel_cdclk_state {
        struct intel_global_state base;
 
index e99996dfd43a121d8ba7e3758d18f27f3286ed8b..433c1387a13700ba1dfd313851323d2925cf37db 100644 (file)
@@ -65,6 +65,7 @@
 #include "i915_utils.h"
 
 #include "display/intel_bios.h"
+#include "display/intel_cdclk.h"
 #include "display/intel_display.h"
 #include "display/intel_display_power.h"
 #include "display/intel_dmc.h"
@@ -627,11 +628,6 @@ struct i915_virtual_gpu {
        u32 caps;
 };
 
-struct intel_cdclk_config {
-       unsigned int cdclk, vco, ref, bypass;
-       u8 voltage_level;
-};
-
 struct i915_selftest_stash {
        atomic_t counter;
        struct ida mock_region_instances;