With all of dram code under display, also move dram_info to struct
intel_display.

This further cleans up struct xe_device from display related members.

Signed-off-by: Jani Nikula <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_display_core.h | 4 ++++
 drivers/gpu/drm/i915/display/intel_dram.c         | 7 ++-----
 drivers/gpu/drm/i915/i915_drv.h                   | 3 ---
 drivers/gpu/drm/xe/xe_device_types.h              | 2 --
 4 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display_core.h 
b/drivers/gpu/drm/i915/display/intel_display_core.h
index 9b8414b77c15..9b36654b593d 100644
--- a/drivers/gpu/drm/i915/display/intel_display_core.h
+++ b/drivers/gpu/drm/i915/display/intel_display_core.h
@@ -394,6 +394,10 @@ struct intel_display {
                u32 mmio_base;
        } dsi;
 
+       struct {
+               const struct dram_info *info;
+       } dram;
+
        struct {
                /* list of fbdev register on this device */
                struct intel_fbdev *fbdev;
diff --git a/drivers/gpu/drm/i915/display/intel_dram.c 
b/drivers/gpu/drm/i915/display/intel_dram.c
index 5816434cd563..f3acd623a204 100644
--- a/drivers/gpu/drm/i915/display/intel_dram.c
+++ b/drivers/gpu/drm/i915/display/intel_dram.c
@@ -741,7 +741,6 @@ static int xelpdp_get_dram_info(struct intel_display 
*display, struct dram_info
 
 int intel_dram_detect(struct intel_display *display)
 {
-       struct drm_i915_private *i915 = to_i915(display->drm);
        struct dram_info *dram_info;
        int ret;
 
@@ -752,7 +751,7 @@ int intel_dram_detect(struct intel_display *display)
        if (!dram_info)
                return -ENOMEM;
 
-       i915->dram_info = dram_info;
+       display->dram.info = dram_info;
 
        if (DISPLAY_VER(display) >= 14)
                ret = xelpdp_get_dram_info(display, dram_info);
@@ -789,7 +788,5 @@ int intel_dram_detect(struct intel_display *display)
  */
 const struct dram_info *intel_dram_info(struct intel_display *display)
 {
-       struct drm_i915_private *i915 = to_i915(display->drm);
-
-       return i915->dram_info;
+       return display->dram.info;
 }
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 5381a934a671..96af7776bee5 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -60,7 +60,6 @@
 #include "intel_step.h"
 #include "intel_uncore.h"
 
-struct dram_info;
 struct drm_i915_clock_gating_funcs;
 struct intel_display;
 struct intel_pxp;
@@ -279,8 +278,6 @@ struct drm_i915_private {
        u32 suspend_count;
        struct vlv_s0ix_state *vlv_s0ix_state;
 
-       const struct dram_info *dram_info;
-
        struct intel_runtime_pm runtime_pm;
 
        struct i915_perf perf;
diff --git a/drivers/gpu/drm/xe/xe_device_types.h 
b/drivers/gpu/drm/xe/xe_device_types.h
index a072c020b84b..6ce3247d1bd8 100644
--- a/drivers/gpu/drm/xe/xe_device_types.h
+++ b/drivers/gpu/drm/xe/xe_device_types.h
@@ -35,7 +35,6 @@
 #define TEST_VM_OPS_ERROR
 #endif
 
-struct dram_info;
 struct intel_display;
 struct intel_dg_nvm_dev;
 struct xe_ggtt;
@@ -648,7 +647,6 @@ struct xe_device {
         * drm_i915_private during build. After cleanup these should go away,
         * migrating to the right sub-structs
         */
-       const struct dram_info *dram_info;
 
        struct intel_uncore {
                spinlock_t lock;
-- 
2.47.3

Reply via email to