[Intel-gfx] [PATCH 37/39] drm/i915: move quirks under display sub-struct

Jani Nikula jani.nikula at intel.com
Thu Aug 11 15:07:48 UTC 2022


Move display 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_quirks.c       | 4 ++--
 drivers/gpu/drm/i915/i915_drv.h                   | 1 -
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display_core.h b/drivers/gpu/drm/i915/display/intel_display_core.h
index da76b3eecbf5..252da61f2c6a 100644
--- a/drivers/gpu/drm/i915/display/intel_display_core.h
+++ b/drivers/gpu/drm/i915/display/intel_display_core.h
@@ -367,6 +367,10 @@ struct intel_display {
 		struct mutex mutex;
 	} pps;
 
+	struct {
+		unsigned long mask;
+	} quirks;
+
 	struct {
 		enum {
 			I915_SAGV_UNKNOWN = 0,
diff --git a/drivers/gpu/drm/i915/display/intel_quirks.c b/drivers/gpu/drm/i915/display/intel_quirks.c
index 22e0df9d9dba..e74ff042a9da 100644
--- a/drivers/gpu/drm/i915/display/intel_quirks.c
+++ b/drivers/gpu/drm/i915/display/intel_quirks.c
@@ -11,7 +11,7 @@
 
 static void intel_set_quirk(struct drm_i915_private *i915, enum intel_quirk_id quirk)
 {
-	i915->quirks |= BIT(quirk);
+	i915->display.quirks.mask |= BIT(quirk);
 }
 
 /*
@@ -221,5 +221,5 @@ void intel_init_quirks(struct drm_i915_private *i915)
 
 bool intel_has_quirk(struct drm_i915_private *i915, enum intel_quirk_id quirk)
 {
-	return i915->quirks & BIT(quirk);
+	return i915->display.quirks.mask & BIT(quirk);
 }
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 60f654db7819..e529a9575a66 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -287,7 +287,6 @@ struct drm_i915_private {
 	unsigned short pch_id;
 
 	unsigned long gem_quirks;
-	unsigned long quirks;
 
 	struct drm_atomic_state *modeset_restore_state;
 	struct drm_modeset_acquire_ctx reset_ctx;
-- 
2.34.1



More information about the Intel-gfx mailing list