[Intel-gfx] [RFC 3/3] drm/i915: draft what feature test macros would look like
Jani Nikula
jani.nikula at intel.com
Tue Sep 26 17:15:43 UTC 2023
Obviously they'd be without underscore prefix.
Signed-off-by: Jani Nikula <jani.nikula at 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 --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);
--
2.39.2
More information about the Intel-gfx
mailing list