diff mbox series

[RFC,3/3] drm/i915: draft what feature test macros would look like

Message ID 10dccccf2afa8910049ea5a761f0e8e9ea58fbaf.1695747484.git.jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: split display from drm_i915_private and i915_drv.h | expand

Commit Message

Jani Nikula Sept. 26, 2023, 5:15 p.m. UTC
Obviously they'd be without underscore prefix.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/display/intel_display_device.h | 4 ++++
 drivers/gpu/drm/i915/display/intel_hdmi.c           | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_display_device.h b/drivers/gpu/drm/i915/display/intel_display_device.h
index 44733c9d5812..4738d7c59703 100644
--- a/drivers/gpu/drm/i915/display/intel_display_device.h
+++ b/drivers/gpu/drm/i915/display/intel_display_device.h
@@ -32,6 +32,10 @@  struct drm_printer;
 	func(overlay_needs_physical); \
 	func(supports_tv);
 
+#define _DISPLAY_INFO(display)		((display)->info.__device_info)
+#define _DISPLAY_RUNTIME_INFO(display)	(&(display)->info.__runtime_info)
+#define _HAS_DDI(display)		(_DISPLAY_INFO(display)->has_ddi)
+
 #define HAS_4TILE(i915)			(IS_DG2(i915) || DISPLAY_VER(i915) >= 14)
 #define HAS_ASYNC_FLIPS(i915)		(DISPLAY_VER(i915) >= 5)
 #define HAS_CDCLK_CRAWL(i915)		(DISPLAY_INFO(i915)->has_cdclk_crawl)
diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
index f06d57b386c0..efc398ad1b67 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
@@ -2583,9 +2583,9 @@  static const struct drm_connector_funcs intel_hdmi_connector_funcs = {
 static int intel_hdmi_connector_atomic_check(struct drm_connector *connector,
 					     struct drm_atomic_state *state)
 {
-	struct drm_i915_private *i915 = to_i915(state->dev);
+	struct intel_display *display = to_intel_display(state->dev);
 
-	if (HAS_DDI(i915))
+	if (_HAS_DDI(display))
 		return intel_digital_connector_atomic_check(connector, state);
 	else
 		return g4x_hdmi_connector_atomic_check(connector, state);