[Intel-gfx] [PATCH 4/5] drm/i915/display: move IPC under display sub-struct

Jani Nikula jani.nikula at intel.com
Mon Sep 5 18:01:07 UTC 2022


Move display IPC related members under drm_i915_private display
sub-struct.

Prefer adding anonymous sub-structs even for single members that aren't
our own structs.

Signed-off-by: Jani Nikula <jani.nikula at intel.com>
---
 drivers/gpu/drm/i915/display/intel_display_core.h | 4 ++++
 drivers/gpu/drm/i915/display/intel_ipc.c          | 6 +++---
 drivers/gpu/drm/i915/i915_drv.h                   | 2 --
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display_core.h b/drivers/gpu/drm/i915/display/intel_display_core.h
index 9086a612365e..4c9a6b9c5512 100644
--- a/drivers/gpu/drm/i915/display/intel_display_core.h
+++ b/drivers/gpu/drm/i915/display/intel_display_core.h
@@ -355,6 +355,10 @@ struct intel_display {
 		struct mutex comp_mutex;
 	} hdcp;
 
+	struct {
+		bool enabled;
+	} ipc;
+
 	struct {
 		struct i915_power_domains domains;
 
diff --git a/drivers/gpu/drm/i915/display/intel_ipc.c b/drivers/gpu/drm/i915/display/intel_ipc.c
index 1285d88b5d25..8fd1251c40bd 100644
--- a/drivers/gpu/drm/i915/display/intel_ipc.c
+++ b/drivers/gpu/drm/i915/display/intel_ipc.c
@@ -10,7 +10,7 @@
 
 bool intel_ipc_is_enabled(struct drm_i915_private *i915)
 {
-	return i915->ipc_enabled;
+	return i915->display.ipc.enabled;
 }
 
 void intel_ipc_enable(struct drm_i915_private *i915)
@@ -50,7 +50,7 @@ void intel_ipc_init(struct drm_i915_private *i915)
 	if (!HAS_IPC(i915))
 		return;
 
-	i915->ipc_enabled = intel_ipc_can_enable(i915);
+	i915->display.ipc.enabled = intel_ipc_can_enable(i915);
 
 	intel_ipc_enable(i915);
 }
@@ -88,7 +88,7 @@ static ssize_t intel_ipc_status_write(struct file *file, const char __user *ubuf
 		if (!intel_ipc_is_enabled(i915) && enable)
 			drm_info(&i915->drm,
 				 "Enabling IPC: WM will be proper only after next commit\n");
-		i915->ipc_enabled = enable;
+		i915->display.ipc.enabled = enable;
 		intel_ipc_enable(i915);
 	}
 
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index c9cca165bf5d..1c95c75714da 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -395,8 +395,6 @@ struct drm_i915_private {
 	 */
 	u8 snps_phy_failed_calibration;
 
-	bool ipc_enabled;
-
 	struct i915_pmu pmu;
 
 	struct i915_drm_clients clients;
-- 
2.34.1



More information about the Intel-gfx mailing list