drm/i915/uncore: add to_intel_uncore() and use it
authorJani Nikula <jani.nikula@intel.com>
Wed, 20 Nov 2024 12:03:35 +0000 (14:03 +0200)
committerJani Nikula <jani.nikula@intel.com>
Mon, 16 Dec 2024 16:09:38 +0000 (18:09 +0200)
Add to_intel_uncore() function to avoid the inclusion of i915_drv.h from
intel_de.h. This reveals a number of implicit dependencies on i915_drv.h
that need to be added.

For now, to_intel_uncore() can be an inline function, with all the
includes in compat intel_uncore.h, as long as i915_drv.h isn't
included. The implicit dependencies on i915_drv.h is a problem in
display code, but the same is not true for xe_device.h etc.

Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/377e2b400d126776224fc49874ed9cb03ac3123c.1732104170.git.jani.nikula@intel.com
29 files changed:
drivers/gpu/drm/i915/display/g4x_dp.c
drivers/gpu/drm/i915/display/g4x_hdmi.c
drivers/gpu/drm/i915/display/i9xx_plane.c
drivers/gpu/drm/i915/display/icl_dsi.c
drivers/gpu/drm/i915/display/intel_alpm.c
drivers/gpu/drm/i915/display/intel_backlight.c
drivers/gpu/drm/i915/display/intel_cdclk.c
drivers/gpu/drm/i915/display/intel_color.c
drivers/gpu/drm/i915/display/intel_combo_phy.c
drivers/gpu/drm/i915/display/intel_cursor.c
drivers/gpu/drm/i915/display/intel_cx0_phy.c
drivers/gpu/drm/i915/display/intel_de.h
drivers/gpu/drm/i915/display/intel_display_debugfs.c
drivers/gpu/drm/i915/display/intel_dmc_wl.c
drivers/gpu/drm/i915/display/intel_dp_hdcp.c
drivers/gpu/drm/i915/display/intel_dpio_phy.c
drivers/gpu/drm/i915/display/intel_dpll.c
drivers/gpu/drm/i915/display/intel_dpll_mgr.c
drivers/gpu/drm/i915/display/intel_dpt_common.c
drivers/gpu/drm/i915/display/intel_fdi.c
drivers/gpu/drm/i915/display/intel_lspcon.c
drivers/gpu/drm/i915/display/intel_pch_display.c
drivers/gpu/drm/i915/display/intel_pch_refclk.c
drivers/gpu/drm/i915/display/intel_pipe_crc.c
drivers/gpu/drm/i915/display/intel_snps_phy.c
drivers/gpu/drm/i915/display/skl_scaler.c
drivers/gpu/drm/i915/intel_uncore.c
drivers/gpu/drm/i915/intel_uncore.h
drivers/gpu/drm/xe/compat-i915-headers/intel_uncore.h

index e06405a3b82db1f61dceb57f93a33cbb2a8a9746..56353377466c774fa387489757fce48809a0ac00 100644 (file)
@@ -8,6 +8,7 @@
 #include <linux/string_helpers.h>
 
 #include "g4x_dp.h"
+#include "i915_drv.h"
 #include "i915_reg.h"
 #include "intel_audio.h"
 #include "intel_backlight.h"
index d1a7d0d57c6b47dc871769c23ae88d51ad910c14..503f4b9030982fd456881967bd5d822ffd25a261 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "g4x_hdmi.h"
+#include "i915_drv.h"
 #include "i915_reg.h"
 #include "intel_atomic.h"
 #include "intel_audio.h"
index 17a1e3801a85c0af5162fa26adfd22391112b08d..48e657a80a16d90738345106ec8af10c8b3c6884 100644 (file)
@@ -8,6 +8,7 @@
 #include <drm/drm_blend.h>
 #include <drm/drm_fourcc.h>
 
+#include "i915_drv.h"
 #include "i915_reg.h"
 #include "i9xx_plane.h"
 #include "i9xx_plane_regs.h"
index 74ab3d1a16227a5a46dd2df1b19a0abba7baa7c4..c977b74f82f0bdbdca1e907a79d60ca1edb7e55b 100644 (file)
@@ -31,6 +31,7 @@
 #include <drm/drm_mipi_dsi.h>
 #include <drm/drm_probe_helper.h>
 
+#include "i915_drv.h"
 #include "i915_reg.h"
 #include "icl_dsi.h"
 #include "icl_dsi_regs.h"
index 55f3ae1e68c90ad86fb657698b72de63c46fbb42..c7ccd5a10012e6adc98ff42d99c70728446f5cf2 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <linux/debugfs.h>
 
+#include "i915_drv.h"
 #include "intel_alpm.h"
 #include "intel_crtc.h"
 #include "intel_de.h"
index 3f81a726cc7d91d7450aea90c34632d8df53b699..fc1e517e074a30295707809debde0b124437a7e8 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <acpi/video.h>
 
+#include "i915_drv.h"
 #include "i915_reg.h"
 #include "intel_backlight.h"
 #include "intel_backlight_regs.h"
index 5a4c8c2410ae6e661cbc2ebf6519649d3c46f35a..3506e576bf6b77d1a7657a5c88144ed1cce240ae 100644 (file)
@@ -29,6 +29,7 @@
 #include "soc/intel_dram.h"
 
 #include "hsw_ips.h"
+#include "i915_drv.h"
 #include "i915_reg.h"
 #include "intel_atomic.h"
 #include "intel_atomic_plane.h"
index 7cd902bbd244ef1ce64d18ea67669b618f2b1e80..2f51eccdb27aa436eebde984d65684d752d269d7 100644 (file)
@@ -22,6 +22,7 @@
  *
  */
 
+#include "i915_drv.h"
 #include "i9xx_plane_regs.h"
 #include "intel_color.h"
 #include "intel_color_regs.h"
index 3252dab564309726d955d91dae46ac9eeeaf1a86..4fbe2e3542ca86522bbffbc8d9df1857174e2bb2 100644 (file)
@@ -3,6 +3,7 @@
  * Copyright © 2018 Intel Corporation
  */
 
+#include "i915_drv.h"
 #include "i915_reg.h"
 #include "intel_combo_phy.h"
 #include "intel_combo_phy_regs.h"
index ed88a28a3afaebb25c6e66ef5cd30f8370d2c752..57cf8f46a4589f981c530f8c0cce80ab1f5884dd 100644 (file)
@@ -11,6 +11,7 @@
 #include <drm/drm_fourcc.h>
 #include <drm/drm_vblank.h>
 
+#include "i915_drv.h"
 #include "i915_reg.h"
 #include "intel_atomic.h"
 #include "intel_atomic_plane.h"
index cc734079c3b8947969c1d122fd99861d8db85228..142de06818a7c5bdc9583ef83f2cbcb72e029625 100644 (file)
@@ -5,6 +5,8 @@
 
 #include <linux/log2.h>
 #include <linux/math64.h>
+
+#include "i915_drv.h"
 #include "i915_reg.h"
 #include "intel_cx0_phy.h"
 #include "intel_cx0_phy_regs.h"
index e5f1c6f3d2d3f2b8857e2417218e9566736ed1eb..b7399e9d11ccd6761671c36c0885e64e64cc33f5 100644 (file)
@@ -6,14 +6,16 @@
 #ifndef __INTEL_DE_H__
 #define __INTEL_DE_H__
 
-#include "i915_drv.h"
+#include "intel_display_conversion.h"
+#include "intel_display_core.h"
+#include "intel_dmc_wl.h"
 #include "intel_dsb.h"
 #include "intel_uncore.h"
 #include "intel_uncore_trace.h"
 
 static inline struct intel_uncore *__to_uncore(struct intel_display *display)
 {
-       return &to_i915(display->drm)->uncore;
+       return to_intel_uncore(display->drm);
 }
 
 static inline u32
index 9f4562b0dad20492b43f1635178c5330c97e0e91..6df80f4da852ee9d154a0e83def325816e453bd3 100644 (file)
@@ -11,6 +11,7 @@
 #include <drm/drm_fourcc.h>
 
 #include "hsw_ips.h"
+#include "i915_drv.h"
 #include "i915_irq.h"
 #include "i915_reg.h"
 #include "i9xx_wm_regs.h"
index 09075830c12ff74cd92fd766663fc3da983b4e58..3ac44151aab5a985fe2a9929767826f160e1d74e 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <drm/drm_print.h>
 
+#include "i915_drv.h"
 #include "i915_reg.h"
 #include "intel_de.h"
 #include "intel_dmc.h"
index 00c493cc8a4b9fad0c84e87ea722ca49ed895312..6cea66069abdaacc02541788befd270b125df984 100644 (file)
@@ -11,6 +11,7 @@
 #include <drm/display/drm_hdcp_helper.h>
 #include <drm/drm_print.h>
 
+#include "i915_drv.h"
 #include "i915_reg.h"
 #include "intel_ddi.h"
 #include "intel_de.h"
index eb3053ff9afaba5098463022e6a1ab5f662ff817..52a36a2281e602d908b2cf0df108682dba1c9aad 100644 (file)
@@ -22,6 +22,7 @@
  */
 
 #include "bxt_dpio_phy_regs.h"
+#include "i915_drv.h"
 #include "i915_reg.h"
 #include "intel_ddi.h"
 #include "intel_ddi_buf_trans.h"
index 198ceda790d2661b551c95a648f74131992ea6c9..3256b1293f7fc20107ac7dc254a71c8fc46c6d80 100644 (file)
@@ -6,6 +6,7 @@
 #include <linux/kernel.h>
 #include <linux/string_helpers.h>
 
+#include "i915_drv.h"
 #include "i915_reg.h"
 #include "intel_atomic.h"
 #include "intel_crtc.h"
index e60497bb8a94510b4b1de1b6e1d3ed919ec54418..d86cc9ffd4acd0a83747cd0df94b30daeaa7e708 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/string_helpers.h>
 
 #include "bxt_dpio_phy_regs.h"
+#include "i915_drv.h"
 #include "i915_reg.h"
 #include "intel_de.h"
 #include "intel_display_types.h"
index 573f72068899efb7c301826e6127c59754afc161..d2dede0a5229c106910ca504550e41f480e35a11 100644 (file)
@@ -3,6 +3,7 @@
  * Copyright © 2023 Intel Corporation
  */
 
+#include "i915_drv.h"
 #include "i915_reg.h"
 #include "intel_de.h"
 #include "intel_display_types.h"
index 98e1a36062273f69a9ccadb85f6be6f3c7841a15..37cdfa9c692a02937d9902ea2f105fcad1105a7f 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <drm/drm_fixed.h>
 
+#include "i915_drv.h"
 #include "i915_reg.h"
 #include "intel_atomic.h"
 #include "intel_crtc.h"
index f9db867fae891894bb09a0cc81ddafb48d713f56..16a7d888f1ee289a0806312397f6583023de5969 100644 (file)
@@ -28,6 +28,7 @@
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_edid.h>
 
+#include "i915_drv.h"
 #include "i915_reg.h"
 #include "intel_de.h"
 #include "intel_display_types.h"
index cd48d3e6cf42abdac6d689b8bad75dd450fa5533..8fa5a6334d10b49cb3bcbd2b6104304adcb24926 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include "g4x_dp.h"
+#include "i915_drv.h"
 #include "i915_reg.h"
 #include "intel_crt.h"
 #include "intel_crt_regs.h"
index d29b9adcbed15efbfd83e0ae94efa13ef1743955..71471c1d7dc9310a5a6fcac232248c37554e29bb 100644 (file)
@@ -3,6 +3,7 @@
  * Copyright © 2021 Intel Corporation
  */
 
+#include "i915_drv.h"
 #include "i915_reg.h"
 #include "intel_de.h"
 #include "intel_display_types.h"
index 304da826dee15dd079e989cf0ba5411b7f4cae04..90efc6f64e525e4b3759cb9c904e9fb8db0ee75a 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/debugfs.h>
 #include <linux/seq_file.h>
 
+#include "i915_drv.h"
 #include "i915_irq.h"
 #include "i915_reg.h"
 #include "intel_atomic.h"
index 4b3a32736fd69ce58f27b20243bccb1e22dfcced..41fe26dc200b330db0490892763d6ec3fba84759 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <linux/math.h>
 
+#include "i915_drv.h"
 #include "i915_reg.h"
 #include "intel_ddi.h"
 #include "intel_ddi_buf_trans.h"
index 11f73659c1b656873528530ea836fa5821b937df..ae21fce534dcf2702d2a56fbeeb606d8b0b855be 100644 (file)
@@ -3,6 +3,7 @@
  * Copyright © 2020 Intel Corporation
  */
 
+#include "i915_drv.h"
 #include "i915_reg.h"
 #include "intel_de.h"
 #include "intel_display_types.h"
index 04b4a3b6d5d6d3fe40ce3811171169451c7532ca..eed4937c3ff30974fd3205ed6125e66e311e0f99 100644 (file)
 #define FORCEWAKE_ACK_TIMEOUT_MS 50
 #define GT_FIFO_TIMEOUT_MS      10
 
+struct intel_uncore *to_intel_uncore(struct drm_device *drm)
+{
+       return &to_i915(drm)->uncore;
+}
+
 #define __raw_posting_read(...) ((void)__raw_uncore_read32(__VA_ARGS__))
 
 static void
index f419c311a0dea4d439c615d20e1e1308b7b77df6..e3958295062745a3c21ed169e21aa7caaf9dbdf7 100644 (file)
@@ -501,6 +501,8 @@ static inline void __iomem *intel_uncore_regs(struct intel_uncore *uncore)
        return uncore->regs;
 }
 
+struct intel_uncore *to_intel_uncore(struct drm_device *drm);
+
 /*
  * The raw_reg_{read,write} macros are intended as a micro-optimization for
  * interrupt handlers so that the pointer indirection on uncore->regs can
index 686c39f320e40724fd8e675f4e3d6645733c114e..4fc3e535de913bdaa5d4f22a44f91e2a82502bc1 100644 (file)
 #include "xe_device_types.h"
 #include "xe_mmio.h"
 
+static inline struct intel_uncore *to_intel_uncore(struct drm_device *drm)
+{
+       return &to_xe_device(drm)->uncore;
+}
+
 static inline struct xe_mmio *__compat_uncore_to_mmio(struct intel_uncore *uncore)
 {
        struct xe_device *xe = container_of(uncore, struct xe_device, uncore);