Lines Matching +full:rpm +full:- +full:requests

1 /* i915_drv.c -- i830,i845,i855,i865,i915 driver -*- linux-c -*-
22 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
121 * requests (and thus managing bo) once the task has been completed in i915_workqueues_init()
123 * need high-priority retirement, such as waiting for an explicit in i915_workqueues_init()
126 * It is also used for periodic low-priority events, such as in i915_workqueues_init()
127 * idle-timers and recording error state. in i915_workqueues_init()
133 dev_priv->wq = alloc_ordered_workqueue("i915", 0); in i915_workqueues_init()
134 if (dev_priv->wq == NULL) in i915_workqueues_init()
137 dev_priv->display.hotplug.dp_wq = alloc_ordered_workqueue("i915-dp", 0); in i915_workqueues_init()
138 if (dev_priv->display.hotplug.dp_wq == NULL) in i915_workqueues_init()
147 dev_priv->unordered_wq = alloc_workqueue("i915-unordered", 0, 0); in i915_workqueues_init()
148 if (dev_priv->unordered_wq == NULL) in i915_workqueues_init()
154 destroy_workqueue(dev_priv->display.hotplug.dp_wq); in i915_workqueues_init()
156 destroy_workqueue(dev_priv->wq); in i915_workqueues_init()
158 drm_err(&dev_priv->drm, "Failed to allocate workqueues.\n"); in i915_workqueues_init()
160 return -ENOMEM; in i915_workqueues_init()
165 destroy_workqueue(dev_priv->unordered_wq); in i915_workqueues_cleanup()
166 destroy_workqueue(dev_priv->display.hotplug.dp_wq); in i915_workqueues_cleanup()
167 destroy_workqueue(dev_priv->wq); in i915_workqueues_cleanup()
171 * We don't keep the workarounds for pre-production hardware, so we expect our
175 * Our policy for removing pre-production workarounds is to keep the
176 * current gen workarounds as a guide to the bring-up of the next gen
197 drm_err(&dev_priv->drm, "This is a pre-production stepping. " in intel_detect_preproduction_hw()
215 * i915_driver_early_probe - setup state not requiring device access
218 * Initialize everything that is a "SW-only" state, that is state not
226 struct intel_display *display = &dev_priv->display; in i915_driver_early_probe()
230 return -ENODEV; in i915_driver_early_probe()
238 spin_lock_init(&dev_priv->irq_lock); in i915_driver_early_probe()
239 spin_lock_init(&dev_priv->gpu_error.lock); in i915_driver_early_probe()
243 mutex_init(&dev_priv->sb_lock); in i915_driver_early_probe()
246 intel_runtime_pm_init_early(&dev_priv->runtime_pm); in i915_driver_early_probe()
287 * i915_driver_late_release - cleanup the setup done in
293 struct intel_display *display = &dev_priv->display; in i915_driver_late_release()
303 mutex_destroy(&dev_priv->sb_lock); in i915_driver_late_release()
307 i915_params_free(&dev_priv->params); in i915_driver_late_release()
311 * i915_driver_mmio_probe - setup device MMIO
315 * initialization sequence. The setup here should avoid any other device-wide
321 struct intel_display *display = &dev_priv->display; in i915_driver_mmio_probe()
326 return -ENODEV; in i915_driver_mmio_probe()
333 ret = intel_uncore_init_mmio(gt->uncore); in i915_driver_mmio_probe()
337 ret = drmm_add_action_or_reset(&dev_priv->drm, in i915_driver_mmio_probe()
339 gt->uncore); in i915_driver_mmio_probe()
367 * i915_driver_mmio_release - cleanup the setup done in i915_driver_mmio_probe()
376 * i915_set_dma_info - set all relevant PCI dma info as configured for the
388 unsigned int mask_size = INTEL_INFO(i915)->dma_mask_size; in i915_set_dma_info()
397 dma_set_max_seg_size(i915->drm.dev, UINT_MAX); in i915_set_dma_info()
399 ret = dma_set_mask(i915->drm.dev, DMA_BIT_MASK(mask_size)); in i915_set_dma_info()
419 ret = dma_set_coherent_mask(i915->drm.dev, DMA_BIT_MASK(mask_size)); in i915_set_dma_info()
426 drm_err(&i915->drm, "Can't set DMA mask/consistent mask (%d)\n", ret); in i915_set_dma_info()
437 snb_pcode_write_p(&i915->uncore, PCODE_POWER_SETUP, in i915_enable_g8()
448 ret = intel_pcode_init(gt->uncore); in i915_pcode_init()
460 * i915_driver_hw_probe - setup state requiring device access
468 struct intel_display *display = &dev_priv->display; in i915_driver_hw_probe()
469 struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev); in i915_driver_hw_probe()
473 return -ENODEV; in i915_driver_hw_probe()
478 drm_err(&dev_priv->drm, in i915_driver_hw_probe()
480 return -ENXIO; in i915_driver_hw_probe()
492 drm_err(&dev_priv->drm, in i915_driver_hw_probe()
494 return -ENXIO; in i915_driver_hw_probe()
513 ret = aperture_remove_conflicting_pci_devices(pdev, dev_priv->drm.driver->name); in i915_driver_hw_probe()
522 * Make sure we probe lmem before we probe stolen-lmem. The BAR size in i915_driver_hw_probe()
535 drm_err(&dev_priv->drm, "failed to enable GGTT\n"); in i915_driver_hw_probe()
552 * pre-gen5 chipsets. in i915_driver_hw_probe()
562 drm_dbg(&dev_priv->drm, "can't enable MSI"); in i915_driver_hw_probe()
588 if (pdev->msi_enabled) in i915_driver_hw_probe()
602 * i915_driver_hw_remove - cleanup the setup done in i915_driver_hw_probe()
607 struct intel_display *display = &dev_priv->display; in i915_driver_hw_remove()
608 struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev); in i915_driver_hw_remove()
614 if (pdev->msi_enabled) in i915_driver_hw_remove()
619 * i915_driver_register - register the driver with the rest of the system
627 struct intel_display *display = &dev_priv->display; in i915_driver_register()
637 if (drm_dev_register(&dev_priv->drm, 0)) { in i915_driver_register()
638 drm_err(&dev_priv->drm, in i915_driver_register()
652 intel_pxp_debugfs_register(dev_priv->pxp); in i915_driver_register()
659 intel_runtime_pm_enable(&dev_priv->runtime_pm); in i915_driver_register()
662 drm_err(&dev_priv->drm, "Failed to register vga switcheroo!\n"); in i915_driver_register()
666 * i915_driver_unregister - cleanup the registration done in i915_driver_regiser()
671 struct intel_display *display = &dev_priv->display; in i915_driver_unregister()
677 intel_runtime_pm_disable(&dev_priv->runtime_pm); in i915_driver_unregister()
693 drm_dev_unplug(&dev_priv->drm); in i915_driver_unregister()
708 struct drm_printer p = drm_dbg_printer(&dev_priv->drm, DRM_UT_DRIVER, in i915_welcome_messages()
716 intel_platform_name(INTEL_INFO(dev_priv)->platform), in i915_welcome_messages()
718 INTEL_INFO(dev_priv)->platform), in i915_welcome_messages()
725 intel_gt_info_print(&gt->info, &p); in i915_welcome_messages()
729 drm_info(&dev_priv->drm, "DRM_I915_DEBUG enabled\n"); in i915_welcome_messages()
731 drm_info(&dev_priv->drm, "DRM_I915_DEBUG_GEM enabled\n"); in i915_welcome_messages()
733 drm_info(&dev_priv->drm, in i915_welcome_messages()
741 (struct intel_device_info *)ent->driver_data; in i915_driver_create()
744 i915 = devm_drm_dev_alloc(&pdev->dev, &i915_drm_driver, in i915_driver_create()
749 pci_set_drvdata(pdev, &i915->drm); in i915_driver_create()
752 i915_params_copy(&i915->params, &i915_modparams); in i915_driver_create()
755 intel_device_info_driver_create(i915, pdev->device, match_info); in i915_driver_create()
763 * i915_driver_probe - setup chip and create an initial config
768 * - drive output discovery via intel_display_driver_probe()
769 * - initialize the memory manager
770 * - allocate initial config memory
771 * - setup the DRM framebuffer with the allocated memory
791 display = &i915->display; in i915_driver_probe()
797 disable_rpm_wakeref_asserts(&i915->runtime_pm); in i915_driver_probe()
830 if (ret && ret != -ENODEV) in i915_driver_probe()
831 drm_dbg(&i915->drm, "pxp init failed with %d\n", ret); in i915_driver_probe()
839 enable_rpm_wakeref_asserts(&i915->runtime_pm); in i915_driver_probe()
843 i915->do_release = true; in i915_driver_probe()
870 enable_rpm_wakeref_asserts(&i915->runtime_pm); in i915_driver_probe()
880 struct intel_display *display = &i915->display; in i915_driver_remove()
883 wakeref = intel_runtime_pm_get(&i915->runtime_pm); in i915_driver_remove()
907 intel_runtime_pm_put(&i915->runtime_pm, wakeref); in i915_driver_remove()
913 struct intel_display *display = &dev_priv->display; in i915_driver_release()
914 struct intel_runtime_pm *rpm = &dev_priv->runtime_pm; in i915_driver_release() local
917 if (!dev_priv->do_release) in i915_driver_release()
920 wakeref = intel_runtime_pm_get(rpm); in i915_driver_release()
931 intel_runtime_pm_put(rpm, wakeref); in i915_driver_release()
933 intel_runtime_pm_driver_release(rpm); in i915_driver_release()
954 struct drm_i915_file_private *file_priv = file->driver_priv; in i915_driver_postclose()
957 i915_drm_client_put(file_priv->client); in i915_driver_postclose()
967 struct intel_display *display = &i915->display; in i915_driver_shutdown()
969 disable_rpm_wakeref_asserts(&i915->runtime_pm); in i915_driver_shutdown()
970 intel_runtime_pm_disable(&i915->runtime_pm); in i915_driver_shutdown()
973 drm_client_dev_suspend(&i915->drm, false); in i915_driver_shutdown()
975 drm_kms_helper_poll_disable(&i915->drm); in i915_driver_shutdown()
978 drm_atomic_helper_shutdown(&i915->drm); in i915_driver_shutdown()
989 intel_encoder_suspend_all(&i915->display); in i915_driver_shutdown()
990 intel_encoder_shutdown_all(&i915->display); in i915_driver_shutdown()
992 intel_dmc_suspend(&i915->display); in i915_driver_shutdown()
1002 * - unify the pci_driver::shutdown sequence here with the in i915_driver_shutdown()
1004 * - unify the driver remove and system/runtime suspend sequences with in i915_driver_shutdown()
1008 enable_rpm_wakeref_asserts(&i915->runtime_pm); in i915_driver_shutdown()
1010 intel_runtime_pm_driver_last_release(&i915->runtime_pm); in i915_driver_shutdown()
1026 intel_pxp_resume_complete(i915->pxp); in i915_drm_complete()
1033 intel_pxp_suspend_prepare(i915->pxp); in i915_drm_prepare()
1036 * NB intel_display_driver_suspend() may issue new requests after we've in i915_drm_prepare()
1037 * ostensibly marked the GPU as ready-to-sleep here. We need to in i915_drm_prepare()
1047 struct intel_display *display = &dev_priv->display; in i915_drm_suspend()
1048 struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev); in i915_drm_suspend()
1051 disable_rpm_wakeref_asserts(&dev_priv->runtime_pm); in i915_drm_suspend()
1072 intel_encoder_suspend_all(&dev_priv->display); in i915_drm_suspend()
1076 i915_ggtt_suspend(to_gt(dev_priv)->ggtt); in i915_drm_suspend()
1083 dev_priv->suspend_count++; in i915_drm_suspend()
1087 enable_rpm_wakeref_asserts(&dev_priv->runtime_pm); in i915_drm_suspend()
1097 struct intel_display *display = &dev_priv->display; in i915_drm_suspend_late()
1098 struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev); in i915_drm_suspend_late()
1099 struct intel_runtime_pm *rpm = &dev_priv->runtime_pm; in i915_drm_suspend_late() local
1104 disable_rpm_wakeref_asserts(rpm); in i915_drm_suspend_late()
1106 intel_pxp_suspend(dev_priv->pxp); in i915_drm_suspend_late()
1111 intel_uncore_suspend(gt->uncore); in i915_drm_suspend_late()
1117 drm_err(&dev_priv->drm, "Suspend complete failed: %d\n", ret); in i915_drm_suspend_late()
1140 enable_rpm_wakeref_asserts(rpm); in i915_drm_suspend_late()
1141 if (!dev_priv->uncore.user_forcewake_count) in i915_drm_suspend_late()
1142 intel_runtime_pm_driver_release(rpm); in i915_drm_suspend_late()
1152 if (drm_WARN_ON_ONCE(&i915->drm, state.event != PM_EVENT_SUSPEND && in i915_driver_suspend_switcheroo()
1154 return -EINVAL; in i915_driver_suspend_switcheroo()
1156 if (i915->drm.switch_power_state == DRM_SWITCH_POWER_OFF) in i915_driver_suspend_switcheroo()
1159 error = i915_drm_suspend(&i915->drm); in i915_driver_suspend_switcheroo()
1163 return i915_drm_suspend_late(&i915->drm, false); in i915_driver_suspend_switcheroo()
1169 struct intel_display *display = &dev_priv->display; in i915_drm_resume()
1173 disable_rpm_wakeref_asserts(&dev_priv->runtime_pm); in i915_drm_resume()
1183 drm_err(&dev_priv->drm, "failed to re-enable GGTT\n"); in i915_drm_resume()
1185 i915_ggtt_resume(to_gt(dev_priv)->ggtt); in i915_drm_resume()
1188 if (GRAPHICS_VER(gt->i915) >= 8) in i915_drm_resume()
1248 enable_rpm_wakeref_asserts(&dev_priv->runtime_pm); in i915_drm_resume()
1256 struct intel_display *display = &dev_priv->display; in i915_drm_resume_early()
1257 struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev); in i915_drm_resume_early()
1262 * We have a resume ordering issue with the snd-hda driver also in i915_drm_resume_early()
1283 drm_err(&dev_priv->drm, in i915_drm_resume_early()
1302 return -EIO; in i915_drm_resume_early()
1306 disable_rpm_wakeref_asserts(&dev_priv->runtime_pm); in i915_drm_resume_early()
1310 drm_err(&dev_priv->drm, in i915_drm_resume_early()
1318 enable_rpm_wakeref_asserts(&dev_priv->runtime_pm); in i915_drm_resume_early()
1327 if (i915->drm.switch_power_state == DRM_SWITCH_POWER_OFF) in i915_driver_resume_switcheroo()
1330 ret = i915_drm_resume_early(&i915->drm); in i915_driver_resume_switcheroo()
1334 return i915_drm_resume(&i915->drm); in i915_driver_resume_switcheroo()
1343 return -ENODEV; in i915_pm_prepare()
1346 if (i915->drm.switch_power_state == DRM_SWITCH_POWER_OFF) in i915_pm_prepare()
1349 return i915_drm_prepare(&i915->drm); in i915_pm_prepare()
1358 return -ENODEV; in i915_pm_suspend()
1361 if (i915->drm.switch_power_state == DRM_SWITCH_POWER_OFF) in i915_pm_suspend()
1364 return i915_drm_suspend(&i915->drm); in i915_pm_suspend()
1372 * We have a suspend ordering issue with the snd-hda driver also in i915_pm_suspend_late()
1380 if (i915->drm.switch_power_state == DRM_SWITCH_POWER_OFF) in i915_pm_suspend_late()
1383 return i915_drm_suspend_late(&i915->drm, false); in i915_pm_suspend_late()
1390 if (i915->drm.switch_power_state == DRM_SWITCH_POWER_OFF) in i915_pm_poweroff_late()
1393 return i915_drm_suspend_late(&i915->drm, true); in i915_pm_poweroff_late()
1400 if (i915->drm.switch_power_state == DRM_SWITCH_POWER_OFF) in i915_pm_resume_early()
1403 return i915_drm_resume_early(&i915->drm); in i915_pm_resume_early()
1410 if (i915->drm.switch_power_state == DRM_SWITCH_POWER_OFF) in i915_pm_resume()
1413 return i915_drm_resume(&i915->drm); in i915_pm_resume()
1420 if (i915->drm.switch_power_state == DRM_SWITCH_POWER_OFF) in i915_pm_complete()
1423 i915_drm_complete(&i915->drm); in i915_pm_complete()
1432 if (i915->drm.switch_power_state != DRM_SWITCH_POWER_OFF) { in i915_pm_freeze()
1433 ret = i915_drm_suspend(&i915->drm); in i915_pm_freeze()
1450 if (i915->drm.switch_power_state != DRM_SWITCH_POWER_OFF) { in i915_pm_freeze_late()
1451 ret = i915_drm_suspend_late(&i915->drm, true); in i915_pm_freeze_late()
1488 struct intel_display *display = &dev_priv->display; in intel_runtime_suspend()
1489 struct intel_runtime_pm *rpm = &dev_priv->runtime_pm; in intel_runtime_suspend() local
1490 struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev); in intel_runtime_suspend()
1495 if (drm_WARN_ON_ONCE(&dev_priv->drm, !HAS_RUNTIME_PM(dev_priv))) in intel_runtime_suspend()
1496 return -ENODEV; in intel_runtime_suspend()
1498 drm_dbg(&dev_priv->drm, "Suspending device\n"); in intel_runtime_suspend()
1500 disable_rpm_wakeref_asserts(rpm); in intel_runtime_suspend()
1503 * We are safe here against re-faults, since the fault handler takes in intel_runtime_suspend()
1504 * an RPM reference. in intel_runtime_suspend()
1508 intel_pxp_runtime_suspend(dev_priv->pxp); in intel_runtime_suspend()
1516 intel_uncore_suspend(gt->uncore); in intel_runtime_suspend()
1522 drm_err(&dev_priv->drm, in intel_runtime_suspend()
1524 intel_uncore_runtime_resume(&dev_priv->uncore); in intel_runtime_suspend()
1531 enable_rpm_wakeref_asserts(rpm); in intel_runtime_suspend()
1536 enable_rpm_wakeref_asserts(rpm); in intel_runtime_suspend()
1537 intel_runtime_pm_driver_release(rpm); in intel_runtime_suspend()
1539 if (intel_uncore_arm_unclaimed_mmio_detection(&dev_priv->uncore)) in intel_runtime_suspend()
1540 drm_err(&dev_priv->drm, in intel_runtime_suspend()
1575 assert_forcewakes_inactive(&dev_priv->uncore); in intel_runtime_suspend()
1580 drm_dbg(&dev_priv->drm, "Device suspended\n"); in intel_runtime_suspend()
1587 struct intel_display *display = &dev_priv->display; in intel_runtime_resume()
1588 struct intel_runtime_pm *rpm = &dev_priv->runtime_pm; in intel_runtime_resume() local
1589 struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev); in intel_runtime_resume()
1594 if (drm_WARN_ON_ONCE(&dev_priv->drm, !HAS_RUNTIME_PM(dev_priv))) in intel_runtime_resume()
1595 return -ENODEV; in intel_runtime_resume()
1597 drm_dbg(&dev_priv->drm, "Resuming device\n"); in intel_runtime_resume()
1599 drm_WARN_ON_ONCE(&dev_priv->drm, atomic_read(&rpm->wakeref_count)); in intel_runtime_resume()
1600 disable_rpm_wakeref_asserts(rpm); in intel_runtime_resume()
1608 if (intel_uncore_unclaimed_mmio(&dev_priv->uncore)) in intel_runtime_resume()
1609 drm_dbg(&dev_priv->drm, in intel_runtime_resume()
1617 intel_uncore_runtime_resume(gt->uncore); in intel_runtime_resume()
1623 * we can do is to hope that things will still work (and disable RPM). in intel_runtime_resume()
1628 intel_pxp_runtime_resume(dev_priv->pxp); in intel_runtime_resume()
1642 enable_rpm_wakeref_asserts(rpm); in intel_runtime_resume()
1645 drm_err(&dev_priv->drm, in intel_runtime_resume()
1648 drm_dbg(&dev_priv->drm, "Device resumed\n"); in intel_runtime_resume()
1714 return -ENODEV; in i915_gem_reject_pin_ioctl()
1787 * 1.6: - New ioctl for scheduling buffer swaps on vertical blank
1788 * - Support vertical blank on secondary display pipe