From: Ville Syrjälä <ville.syrj...@linux.intel.com>

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.syrj...@linux.intel.com>
---
 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@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to