[PATCH] drm/i915: Make sure the base lives at offset 0 of all kms objects

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>

We occasionally depend on eg. to_intel_crtc(NULL) being NULL as
well. Sprinkle in some BUILD_BUG_ON()s to make sure we don't
accidentally change things in a way that would violate this
assumption.

Signed-off-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
---
 drivers/gpu/drm/i915/intel_display.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index e4bdd3a6a6e3..724a982bbb05 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -16331,6 +16331,15 @@ void intel_modeset_init(struct drm_device *dev)
 	enum pipe pipe;
 	struct intel_crtc *crtc;
 
+	BUILD_BUG_ON(to_intel_plane(NULL) != NULL);
+	BUILD_BUG_ON(to_intel_crtc(NULL) != NULL);
+	BUILD_BUG_ON(to_intel_encoder(NULL) != NULL);
+	BUILD_BUG_ON(to_intel_connector(NULL) != NULL);
+
+	BUILD_BUG_ON(to_intel_plane_state(NULL) != NULL);
+	BUILD_BUG_ON(to_intel_crtc_state(NULL) != NULL);
+	BUILD_BUG_ON(to_intel_atomic_state(NULL) != NULL);
+
 	drm_mode_config_init(dev);
 
 	dev->mode_config.min_width = 0;
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux