Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'drm-intel-fixes-2023-08-24' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes

- Fix power consumption at s2idle on DG2 (Anshuman)
- Fix documentation build warning (Jani)
- Fix Display HPD (Imre)

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/ZOdPRFSJpo0ErPX/@intel.com

+69 -39
+46 -22
drivers/gpu/drm/drm_probe_helper.c
··· 262 262 } 263 263 264 264 #define DRM_OUTPUT_POLL_PERIOD (10*HZ) 265 + static void reschedule_output_poll_work(struct drm_device *dev) 266 + { 267 + unsigned long delay = DRM_OUTPUT_POLL_PERIOD; 268 + 269 + if (dev->mode_config.delayed_event) 270 + /* 271 + * FIXME: 272 + * 273 + * Use short (1s) delay to handle the initial delayed event. 274 + * This delay should not be needed, but Optimus/nouveau will 275 + * fail in a mysterious way if the delayed event is handled as 276 + * soon as possible like it is done in 277 + * drm_helper_probe_single_connector_modes() in case the poll 278 + * was enabled before. 279 + */ 280 + delay = HZ; 281 + 282 + schedule_delayed_work(&dev->mode_config.output_poll_work, delay); 283 + } 284 + 265 285 /** 266 286 * drm_kms_helper_poll_enable - re-enable output polling. 267 287 * @dev: drm_device ··· 299 279 */ 300 280 void drm_kms_helper_poll_enable(struct drm_device *dev) 301 281 { 302 - bool poll = false; 303 - unsigned long delay = DRM_OUTPUT_POLL_PERIOD; 304 - 305 282 if (!dev->mode_config.poll_enabled || !drm_kms_helper_poll || 306 283 dev->mode_config.poll_running) 307 284 return; 308 285 309 - poll = drm_kms_helper_enable_hpd(dev); 310 - 311 - if (dev->mode_config.delayed_event) { 312 - /* 313 - * FIXME: 314 - * 315 - * Use short (1s) delay to handle the initial delayed event. 316 - * This delay should not be needed, but Optimus/nouveau will 317 - * fail in a mysterious way if the delayed event is handled as 318 - * soon as possible like it is done in 319 - * drm_helper_probe_single_connector_modes() in case the poll 320 - * was enabled before. 321 - */ 322 - poll = true; 323 - delay = HZ; 324 - } 325 - 326 - if (poll) 327 - schedule_delayed_work(&dev->mode_config.output_poll_work, delay); 286 + if (drm_kms_helper_enable_hpd(dev) || 287 + dev->mode_config.delayed_event) 288 + reschedule_output_poll_work(dev); 328 289 329 290 dev->mode_config.poll_running = true; 330 291 } 331 292 EXPORT_SYMBOL(drm_kms_helper_poll_enable); 293 + 294 + /** 295 + * drm_kms_helper_poll_reschedule - reschedule the output polling work 296 + * @dev: drm_device 297 + * 298 + * This function reschedules the output polling work, after polling for a 299 + * connector has been enabled. 300 + * 301 + * Drivers must call this helper after enabling polling for a connector by 302 + * setting %DRM_CONNECTOR_POLL_CONNECT / %DRM_CONNECTOR_POLL_DISCONNECT flags 303 + * in drm_connector::polled. Note that after disabling polling by clearing these 304 + * flags for a connector will stop the output polling work automatically if 305 + * the polling is disabled for all other connectors as well. 306 + * 307 + * The function can be called only after polling has been enabled by calling 308 + * drm_kms_helper_poll_init() / drm_kms_helper_poll_enable(). 309 + */ 310 + void drm_kms_helper_poll_reschedule(struct drm_device *dev) 311 + { 312 + if (dev->mode_config.poll_running) 313 + reschedule_output_poll_work(dev); 314 + } 315 + EXPORT_SYMBOL(drm_kms_helper_poll_reschedule); 332 316 333 317 static enum drm_connector_status 334 318 drm_helper_probe_detect_ctx(struct drm_connector *connector, bool force)
+2 -2
drivers/gpu/drm/i915/display/intel_hotplug.c
··· 211 211 212 212 /* Enable polling and queue hotplug re-enabling. */ 213 213 if (hpd_disabled) { 214 - drm_kms_helper_poll_enable(&dev_priv->drm); 214 + drm_kms_helper_poll_reschedule(&dev_priv->drm); 215 215 mod_delayed_work(dev_priv->unordered_wq, 216 216 &dev_priv->display.hotplug.reenable_work, 217 217 msecs_to_jiffies(HPD_STORM_REENABLE_DELAY)); ··· 649 649 drm_connector_list_iter_end(&conn_iter); 650 650 651 651 if (enabled) 652 - drm_kms_helper_poll_enable(&dev_priv->drm); 652 + drm_kms_helper_poll_reschedule(&dev_priv->drm); 653 653 654 654 mutex_unlock(&dev_priv->drm.mode_config.mutex); 655 655
+2
drivers/gpu/drm/i915/gt/uc/intel_huc.c
··· 26 26 * The kernel driver is only responsible for loading the HuC firmware and 27 27 * triggering its security authentication. This is done differently depending 28 28 * on the platform: 29 + * 29 30 * - older platforms (from Gen9 to most Gen12s): the load is performed via DMA 30 31 * and the authentication via GuC 31 32 * - DG2: load and authentication are both performed via GSC. ··· 34 33 * not-DG2 older platforms), while the authentication is done in 2-steps, 35 34 * a first auth for clear-media workloads via GuC and a second one for all 36 35 * workloads via GSC. 36 + * 37 37 * On platforms where the GuC does the authentication, to correctly do so the 38 38 * HuC binary must be loaded before the GuC one. 39 39 * Loading the HuC is optional; however, not using the HuC might negatively
+18 -15
drivers/gpu/drm/i915/i915_driver.c
··· 443 443 static int i915_driver_hw_probe(struct drm_i915_private *dev_priv) 444 444 { 445 445 struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev); 446 - struct pci_dev *root_pdev; 447 446 int ret; 448 447 449 448 if (i915_inject_probe_failure(dev_priv)) ··· 556 557 557 558 intel_bw_init_hw(dev_priv); 558 559 559 - /* 560 - * FIXME: Temporary hammer to avoid freezing the machine on our DGFX 561 - * This should be totally removed when we handle the pci states properly 562 - * on runtime PM and on s2idle cases. 563 - */ 564 - root_pdev = pcie_find_root_port(pdev); 565 - if (root_pdev) 566 - pci_d3cold_disable(root_pdev); 567 - 568 560 return 0; 569 561 570 562 err_opregion: ··· 581 591 static void i915_driver_hw_remove(struct drm_i915_private *dev_priv) 582 592 { 583 593 struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev); 584 - struct pci_dev *root_pdev; 585 594 586 595 i915_perf_fini(dev_priv); 587 596 ··· 588 599 589 600 if (pdev->msi_enabled) 590 601 pci_disable_msi(pdev); 591 - 592 - root_pdev = pcie_find_root_port(pdev); 593 - if (root_pdev) 594 - pci_d3cold_enable(root_pdev); 595 602 } 596 603 597 604 /** ··· 1502 1517 { 1503 1518 struct drm_i915_private *dev_priv = kdev_to_i915(kdev); 1504 1519 struct intel_runtime_pm *rpm = &dev_priv->runtime_pm; 1520 + struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev); 1521 + struct pci_dev *root_pdev; 1505 1522 struct intel_gt *gt; 1506 1523 int ret, i; 1507 1524 ··· 1555 1568 drm_err(&dev_priv->drm, 1556 1569 "Unclaimed access detected prior to suspending\n"); 1557 1570 1571 + /* 1572 + * FIXME: Temporary hammer to avoid freezing the machine on our DGFX 1573 + * This should be totally removed when we handle the pci states properly 1574 + * on runtime PM. 1575 + */ 1576 + root_pdev = pcie_find_root_port(pdev); 1577 + if (root_pdev) 1578 + pci_d3cold_disable(root_pdev); 1579 + 1558 1580 rpm->suspended = true; 1559 1581 1560 1582 /* ··· 1602 1606 { 1603 1607 struct drm_i915_private *dev_priv = kdev_to_i915(kdev); 1604 1608 struct intel_runtime_pm *rpm = &dev_priv->runtime_pm; 1609 + struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev); 1610 + struct pci_dev *root_pdev; 1605 1611 struct intel_gt *gt; 1606 1612 int ret, i; 1607 1613 ··· 1617 1619 1618 1620 intel_opregion_notify_adapter(dev_priv, PCI_D0); 1619 1621 rpm->suspended = false; 1622 + 1623 + root_pdev = pcie_find_root_port(pdev); 1624 + if (root_pdev) 1625 + pci_d3cold_enable(root_pdev); 1626 + 1620 1627 if (intel_uncore_unclaimed_mmio(&dev_priv->uncore)) 1621 1628 drm_dbg(&dev_priv->drm, 1622 1629 "Unclaimed access during suspend, bios?\n");
+1
include/drm/drm_probe_helper.h
··· 25 25 26 26 void drm_kms_helper_poll_disable(struct drm_device *dev); 27 27 void drm_kms_helper_poll_enable(struct drm_device *dev); 28 + void drm_kms_helper_poll_reschedule(struct drm_device *dev); 28 29 bool drm_kms_helper_is_poll_worker(void); 29 30 30 31 enum drm_mode_status drm_crtc_helper_mode_valid_fixed(struct drm_crtc *crtc,