[Intel-xe] [PATCH v2 1/6] fixup! drm/xe/display: Implement display support
Jani Nikula
jani.nikula at intel.com
Fri Oct 6 10:37:57 UTC 2023
We have an abstraction for "has display", and it's
HAS_DISPLAY(). Unfortunately, it requires access to
DISPLAY_RUNTIME_INFO(), so include compat-i915-headers/i915_drv.h too,
although it's a bit meh.
v2: define local has_display() to make this a bit cleaner
Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
Acked-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
Signed-off-by: Jani Nikula <jani.nikula at intel.com>
---
drivers/gpu/drm/xe/xe_display.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_display.c b/drivers/gpu/drm/xe/xe_display.c
index 07898e0e175e..68729997e1fe 100644
--- a/drivers/gpu/drm/xe/xe_display.c
+++ b/drivers/gpu/drm/xe/xe_display.c
@@ -15,6 +15,7 @@
#include <drm/xe_drm.h>
#include "soc/intel_dram.h"
+#include "i915_drv.h" /* FIXME: HAS_DISPLAY() depends on this */
#include "intel_acpi.h"
#include "intel_audio.h"
#include "intel_bw.h"
@@ -32,6 +33,11 @@
/* Xe device functions */
+static bool has_display(struct xe_device *xe)
+{
+ return HAS_DISPLAY(xe);
+}
+
/**
* xe_display_driver_probe_defer - Detect if we need to wait for other drivers
* early on
@@ -316,7 +322,7 @@ static void intel_suspend_encoders(struct xe_device *xe)
struct drm_device *dev = &xe->drm;
struct intel_encoder *encoder;
- if (xe->info.display_runtime.pipe_mask)
+ if (has_display(xe))
return;
drm_modeset_lock_all(dev);
@@ -346,7 +352,7 @@ void xe_display_pm_suspend(struct xe_device *xe)
* properly.
*/
intel_power_domains_disable(xe);
- if (xe->info.display_runtime.pipe_mask)
+ if (has_display(xe))
drm_kms_helper_poll_disable(&xe->drm);
intel_display_driver_suspend(xe);
@@ -392,7 +398,7 @@ void xe_display_pm_resume(struct xe_device *xe)
intel_dmc_resume(xe);
- if (xe->info.display_runtime.pipe_mask)
+ if (has_display(xe))
drm_mode_config_reset(&xe->drm);
intel_display_driver_init_hw(xe);
@@ -403,7 +409,7 @@ void xe_display_pm_resume(struct xe_device *xe)
intel_display_driver_resume(xe);
intel_hpd_poll_disable(xe);
- if (xe->info.display_runtime.pipe_mask)
+ if (has_display(xe))
drm_kms_helper_poll_enable(&xe->drm);
intel_opregion_resume(xe);
@@ -424,7 +430,7 @@ void xe_display_probe(struct xe_device *xe)
intel_display_device_probe(xe);
- if (xe->info.display_runtime.pipe_mask)
+ if (has_display(xe))
return;
no_display:
--
2.39.2
More information about the Intel-xe
mailing list