Skip to contentSkip to conversation

drm/i915: introduce INTEL_DISPLAY_ENABLED()

PATCH RESEND Superseded Jani Nikula 2 participants 3 messages Sep 12, 2019

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 drm/i915: introduce INTEL_DISPLAY_ENABLED()

Prepare for making a distinction between not having display and having disabled display. Add INTEL_DISPLAY_ENABLED() and use it where HAS_DISPLAY() is used. This is initially duplication, as disabling display still leads to ->pipe_mask = 0 and HAS_DISPLAY() being false.

Since INTEL_DISPLAY_ENABLED() will not make sense unless HAS_DISPLAY() is true, include a warning for catching misuses making decisions on INTEL_DISPLAY_ENABLED() when HAS_DISPLAY() is false.

---
 drivers/gpu/drm/i915/display/intel_bios.c    | 2 +-
 drivers/gpu/drm/i915/display/intel_display.c | 4 ++--
 drivers/gpu/drm/i915/display/intel_fbdev.c   | 2 +-
 drivers/gpu/drm/i915/display/intel_gmbus.c   | 2 +-
 drivers/gpu/drm/i915/i915_drv.c              | 8 ++++----
 drivers/gpu/drm/i915/i915_drv.h              | 3 +++
 drivers/gpu/drm/i915/intel_pch.c             | 2 +-
 7 files changed, 13 insertions(+), 10 deletions(-)
drivers/gpu/drm/i915/display/intel_bios.c +1 -1
index efb39f350b19..1def550c68c8 100644
@@ -1833,7 +1833,7 @@ void intel_bios_init(struct drm_i915_private *dev_priv)
 	const struct bdb_header *bdb;
 	u8 __iomem *bios = NULL;
 
-	if (!HAS_DISPLAY(dev_priv)) {
+	if (!HAS_DISPLAY(dev_priv) || !INTEL_DISPLAY_ENABLED(dev_priv)) {
 		DRM_DEBUG_KMS("Skipping VBT init due to disabled display.\n");
 		return;
 	}
drivers/gpu/drm/i915/display/intel_display.c +2 -2
index a19f8c73f2e0..2c0cb32235c0 100644
@@ -15366,7 +15366,7 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv)
 
 	intel_pps_init(dev_priv);
 
-	if (!HAS_DISPLAY(dev_priv))
+	if (!HAS_DISPLAY(dev_priv) || !INTEL_DISPLAY_ENABLED(dev_priv))
 		return;
 
 	if (INTEL_GEN(dev_priv) >= 12) {
@@ -17273,7 +17273,7 @@ intel_display_capture_error_state(struct drm_i915_private *dev_priv)
 
 	BUILD_BUG_ON(ARRAY_SIZE(transcoders) != ARRAY_SIZE(error->transcoder));
 
-	if (!HAS_DISPLAY(dev_priv))
+	if (!HAS_DISPLAY(dev_priv) || !INTEL_DISPLAY_ENABLED(dev_priv))
 		return NULL;
 
 	error = kzalloc(sizeof(*error), GFP_ATOMIC);
drivers/gpu/drm/i915/display/intel_fbdev.c +1 -1
index d59eee5c5d9c..68338669f054 100644
@@ -444,7 +444,7 @@ int intel_fbdev_init(struct drm_device *dev)
 	struct intel_fbdev *ifbdev;
 	int ret;
 
-	if (WARN_ON(!HAS_DISPLAY(dev_priv)))
+	if (WARN_ON(!HAS_DISPLAY(dev_priv) || !INTEL_DISPLAY_ENABLED(dev_priv)))
 		return -ENODEV;
 
 	ifbdev = kzalloc(sizeof(struct intel_fbdev), GFP_KERNEL);
drivers/gpu/drm/i915/display/intel_gmbus.c +1 -1
index d6775a005726..3d4d19ac1d14 100644
@@ -836,7 +836,7 @@ int intel_gmbus_setup(struct drm_i915_private *dev_priv)
 	unsigned int pin;
 	int ret;
 
-	if (!HAS_DISPLAY(dev_priv))
+	if (!HAS_DISPLAY(dev_priv) || !INTEL_DISPLAY_ENABLED(dev_priv))
 		return 0;
 
 	if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
drivers/gpu/drm/i915/i915_drv.c +4 -4
index 0dfcb40f3162..9904f762f4bb 100644
@@ -338,7 +338,7 @@ static int i915_driver_modeset_probe(struct drm_device *dev)
 	if (i915_inject_probe_failure(dev_priv))
 		return -ENODEV;
 
-	if (HAS_DISPLAY(dev_priv)) {
+	if (HAS_DISPLAY(dev_priv) && INTEL_DISPLAY_ENABLED(dev_priv)) {
 		ret = drm_vblank_init(&dev_priv->drm,
 				      INTEL_NUM_PIPES(dev_priv));
 		if (ret)
@@ -389,7 +389,7 @@ static int i915_driver_modeset_probe(struct drm_device *dev)
 
 	intel_overlay_setup(dev_priv);
 
-	if (!HAS_DISPLAY(dev_priv))
+	if (!HAS_DISPLAY(dev_priv) || !INTEL_DISPLAY_ENABLED(dev_priv))
 		return 0;
 
 	ret = intel_fbdev_init(dev);
@@ -1378,7 +1378,7 @@ static void i915_driver_register(struct drm_i915_private *dev_priv)
 	} else
 		DRM_ERROR("Failed to register driver for userspace access!\n");
 
-	if (HAS_DISPLAY(dev_priv)) {
+	if (HAS_DISPLAY(dev_priv) && INTEL_DISPLAY_ENABLED(dev_priv)) {
 		/* Must be done after probing outputs */
 		intel_opregion_register(dev_priv);
 		acpi_video_register();
@@ -1401,7 +1401,7 @@ static void i915_driver_register(struct drm_i915_private *dev_priv)
 	 * We need to coordinate the hotplugs with the asynchronous fbdev
 	 * configuration, for which we use the fbdev->async_cookie.
 	 */
-	if (HAS_DISPLAY(dev_priv))
+	if (HAS_DISPLAY(dev_priv) && INTEL_DISPLAY_ENABLED(dev_priv))
 		drm_kms_helper_poll_init(dev);
 
 	intel_power_domains_enable(dev_priv);
drivers/gpu/drm/i915/i915_drv.h +3 -0
index bf600888b3f1..4faec2f94e19 100644
@@ -2192,6 +2192,9 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915,
 
 #define HAS_DISPLAY(dev_priv) (INTEL_INFO(dev_priv)->pipe_mask != 0)
 
+/* Only valid when HAS_DISPLAY() is true */
+#define INTEL_DISPLAY_ENABLED(dev_priv) (WARN_ON(!HAS_DISPLAY(dev_priv)), !i915_modparams.disable_display)
+
 static inline bool intel_vtd_active(void)
 {
 #ifdef CONFIG_INTEL_IOMMU
drivers/gpu/drm/i915/intel_pch.c +1 -1
index fa864d8f2b73..111867569efd 100644
@@ -188,7 +188,7 @@ void intel_detect_pch(struct drm_i915_private *dev_priv)
 	 * Use PCH_NOP (PCH but no South Display) for PCH platforms without
 	 * display.
 	 */
-	if (pch && !HAS_DISPLAY(dev_priv)) {
+	if (pch && (!HAS_DISPLAY(dev_priv) || !INTEL_DISPLAY_ENABLED(dev_priv))) {
 		DRM_DEBUG_KMS("Display disabled, reverting to NOP PCH\n");
 		dev_priv->pch_type = PCH_NOP;
 		dev_priv->pch_id = 0;
Signature · 6 lines
2.20.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

✗ Fi.CI.CHECKPATCH: warning for drm/i915: introduce INTEL_DISPLAY_ENABLED()

== Series Details ==

== Series Details ==

Series: drm/i915: introduce INTEL_DISPLAY_ENABLED()
URL : https://patchwork.freedesktop.org/series/66610/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
427d67464aa8 drm/i915: introduce INTEL_DISPLAY_ENABLED()
-:135: WARNING:LONG_LINE: line over 100 characters
#135: FILE: drivers/gpu/drm/i915/i915_drv.h:2196:
+#define INTEL_DISPLAY_ENABLED(dev_priv) (WARN_ON(!HAS_DISPLAY(dev_priv)), !i915_modparams.disable_display)

total: 0 errors, 1 warnings, 0 checks, 89 lines checked

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw

✗ Fi.CI.BAT: failure for drm/i915: introduce INTEL_DISPLAY_ENABLED()

In reply to Jani Nikula
== Series Details ==

== Series Details ==

Series: drm/i915: introduce INTEL_DISPLAY_ENABLED()
URL : https://patchwork.freedesktop.org/series/66610/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_6883 -> Patchwork_14385
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with Patchwork_14385 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_14385, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14385/

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in Patchwork_14385:

### IGT changes ###

#### Possible regressions ####

* igt@i915_pm_rpm@module-reload:
- fi-cfl-8700k: [PASS][1] -> [DMESG-WARN][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-cfl-8700k/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14385/fi-cfl-8700k/igt@[email protected]
- fi-kbl-x1275: [PASS][3] -> [DMESG-WARN][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-kbl-x1275/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14385/fi-kbl-x1275/igt@[email protected]
- fi-skl-guc: [PASS][5] -> [DMESG-WARN][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-skl-guc/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14385/fi-skl-guc/igt@[email protected]
- fi-cfl-guc: [PASS][7] -> [DMESG-WARN][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-cfl-guc/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14385/fi-cfl-guc/igt@[email protected]
- fi-skl-iommu: [PASS][9] -> [DMESG-WARN][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-skl-iommu/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14385/fi-skl-iommu/igt@[email protected]
- fi-whl-u: [PASS][11] -> [DMESG-WARN][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-whl-u/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14385/fi-whl-u/igt@[email protected]
- fi-skl-6260u: [PASS][13] -> [DMESG-WARN][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-skl-6260u/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14385/fi-skl-6260u/igt@[email protected]
- fi-skl-6770hq: [PASS][15] -> [DMESG-WARN][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-skl-6770hq/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14385/fi-skl-6770hq/igt@[email protected]
- fi-bdw-5557u: [PASS][17] -> [DMESG-WARN][18]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-bdw-5557u/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14385/fi-bdw-5557u/igt@[email protected]
- fi-kbl-r: [PASS][19] -> [DMESG-WARN][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-kbl-r/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14385/fi-kbl-r/igt@[email protected]
- fi-skl-lmem: [PASS][21] -> [DMESG-WARN][22]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-skl-lmem/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14385/fi-skl-lmem/igt@[email protected]
- fi-hsw-peppy: [PASS][23] -> [DMESG-WARN][24]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-hsw-peppy/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14385/fi-hsw-peppy/igt@[email protected]
- fi-cfl-8109u: [PASS][25] -> [DMESG-WARN][26]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-cfl-8109u/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14385/fi-cfl-8109u/igt@[email protected]
- fi-skl-6600u: [PASS][27] -> [DMESG-WARN][28]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-skl-6600u/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14385/fi-skl-6600u/igt@[email protected]
- fi-skl-6700k2: [PASS][29] -> [DMESG-WARN][30]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-skl-6700k2/igt@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14385/fi-skl-6700k2/igt@[email protected]
- fi-cml-u2: [PASS][31] -> [DMESG-WARN][32]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-cml-u2/igt@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14385/fi-cml-u2/igt@[email protected]
- fi-kbl-guc: [PASS][33] -> [DMESG-WARN][34]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-kbl-guc/igt@[email protected]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14385/fi-kbl-guc/igt@[email protected]
- fi-kbl-7500u: [PASS][35] -> [DMESG-WARN][36]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-kbl-7500u/igt@[email protected]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14385/fi-kbl-7500u/igt@[email protected]
- fi-kbl-8809g: [PASS][37] -> [DMESG-WARN][38]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-kbl-8809g/igt@[email protected]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14385/fi-kbl-8809g/igt@[email protected]

* igt@runner@aborted:
- fi-cfl-8109u: NOTRUN -> [FAIL][39]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14385/fi-cfl-8109u/igt@[email protected]
- fi-whl-u: NOTRUN -> [FAIL][40]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14385/fi-whl-u/igt@[email protected]
- fi-cml-u2: NOTRUN -> [FAIL][41]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14385/fi-cml-u2/igt@[email protected]
- fi-cfl-guc: NOTRUN -> [FAIL][42]
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14385/fi-cfl-guc/igt@[email protected]
- fi-cfl-8700k: NOTRUN -> [FAIL][43]
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14385/fi-cfl-8700k/igt@[email protected]

#### Suppressed ####

The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.

* igt@gem_close_race@basic-threads:
- {fi-tgl-u2}: [PASS][44] -> [INCOMPLETE][45]
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-tgl-u2/igt@[email protected]
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14385/fi-tgl-u2/igt@[email protected]

* igt@i915_pm_rpm@module-reload:
- {fi-kbl-soraka}: [PASS][46] -> [DMESG-WARN][47]
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-kbl-soraka/igt@[email protected]
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14385/fi-kbl-soraka/igt@[email protected]

Known issues
------------

Here are the changes found in Patchwork_14385 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_ctx_create@basic-files:
- fi-icl-u2: [PASS][48] -> [INCOMPLETE][49] ([fdo#107713] / [fdo#109100])
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-icl-u2/igt@[email protected]
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14385/fi-icl-u2/igt@[email protected]

* igt@i915_pm_rpm@basic-pci-d3-state:
- fi-icl-u3: [PASS][50] -> [DMESG-WARN][51] ([fdo#107724])
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-icl-u3/igt@[email protected]
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14385/fi-icl-u3/igt@[email protected]

* igt@kms_chamelium@dp-crc-fast:
- fi-kbl-7500u: [PASS][52] -> [FAIL][53] ([fdo#109635 ])
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-kbl-7500u/igt@[email protected]
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14385/fi-kbl-7500u/igt@[email protected]

#### Possible fixes ####

* igt@i915_module_load@reload:
- fi-icl-u3: [DMESG-WARN][54] ([fdo#107724] / [fdo#111214]) -> [PASS][55]
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-icl-u3/igt@[email protected]
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14385/fi-icl-u3/igt@[email protected]

* igt@i915_selftest@live_execlists:
- fi-skl-gvtdvm: [DMESG-FAIL][56] ([fdo#111108]) -> [PASS][57]
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-skl-gvtdvm/igt@i915_selftest@live_execlists.html
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14385/fi-skl-gvtdvm/igt@i915_selftest@live_execlists.html

* igt@kms_chamelium@hdmi-hpd-fast:
- fi-kbl-7500u: [FAIL][58] ([fdo#111096]) -> [PASS][59]
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-kbl-7500u/igt@[email protected]
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14385/fi-kbl-7500u/igt@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
[fdo#109100]: https://bugs.freedesktop.org/show_bug.cgi?id=109100
[fdo#109635 ]: https://bugs.freedesktop.org/show_bug.cgi?id=109635
[fdo#111096]: https://bugs.freedesktop.org/show_bug.cgi?id=111096
[fdo#111108]: https://bugs.freedesktop.org/show_bug.cgi?id=111108
[fdo#111214]: https://bugs.freedesktop.org/show_bug.cgi?id=111214
[fdo#111373]: https://bugs.freedesktop.org/show_bug.cgi?id=111373
[fdo#111593]: https://bugs.freedesktop.org/show_bug.cgi?id=111593

Participating hosts (55 -> 47)
------------------------------

Missing (8): fi-ilk-m540 fi-bxt-dsi fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-icl-y fi-byt-clapper fi-bdw-samus

Build changes
-------------

* CI: CI-20190529 -> None
* Linux: CI_DRM_6883 -> Patchwork_14385

CI-20190529: 20190529
CI_DRM_6883: 66ebb484c4bf16531678a935499adc17c1b3be0d @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5178: efb4539494d94f03374874d3b61bd04ef3802aaa @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_14385: 427d67464aa8e2bf53d90eeecce55e4a4343222d @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

427d67464aa8 drm/i915: introduce INTEL_DISPLAY_ENABLED()

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14385/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx