summaryrefslogtreecommitdiff
path: root/lib/igt_pm.h
AgeCommit message (Collapse)Author
2022-05-18lib: Optional autosuspend_delay_ms configurationAnshuman Gupta
Add an option to configure autosuspend_delay_ms as i915 read autosuspend_delay_ms to all PCI devices under GFX root port. configuring autosuspend_delay_ms as optional. Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com> Reviewed-by: Badal Nilawar <badal.nilawar@intel.com>
2022-05-18lib/igt_pm: D3Cold runtime pm infrastructureAnshuman Gupta
Enable gfx card pci devices runtime pm for all pci devices and bridge under the topology of Gfx Card root port. Added a library function to get the PCI root port ACPI D state and to print the pci card devices runtime pm status. v2: - Save pci dev power attrs to dynamically allocated array. [Rodrigo] - Set autosuspend delay to 0 on supported devices. [Rodrigo] - %s/else if/else in igt_pm_get_acpi_real_d_state. [Kamil] v3: - Add comment for MAX_PCI_DEVICES. [Badal] - Use static global array __pci_dev_pwrattr[]. [Rodrigo] - Use pci_slot_match iter. [Badal] - Destroy the iter. [Badal] v4: - Added igt_pm_enable_pci_card_autosuspend() to avoid any control attr save/restore by exit handler. [Rodrigo] v5: - Code refactoring to avoid code duplication. - Few function name changed. [Rodrigo] %s/igt_pm_enable_pci_card_autosuspend/igt_pm_enable_runtime_pm. %s/__igt_pm_setup_pci_card_runtime_pm/igt_pm_setup_pci_dev_power_attrs. %s/igt_pm_setup_power_attr/igt_pm_write_power_attr. v5: - %s/igt_pm_save_power_attr/igt_pm_read_power_attr/ - Added len argument to igt_pm_write_power_attr(). Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2020-05-18lib/igt_pm: Add lib func to get lpsp capabilityAnshuman Gupta
This lib function evaluate the lpsp capability from the connector specific debugfs attribute i915_lpsp_info. v2: - changed the lib function prefix igt_output_is_lpsp_capable to i915_output_is_lpsp_capable. [Martin] v3: - early return for the connector which doesn't support lpsp on any platform. v4: - debugfs entry changed from i915_lpsp_info to i915_lpsp_capability. v5: - return lpsp capability false if i915_lpsp_capability debugfs is not present. [Animesh] Reviewed-by: Animesh Manna <animesh.manna@intel.com> Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
2020-01-31lib: Find the associated runtime-pm sysfs for the deviceChris Wilson
Remove the hardcoded path to the igfx (00:00:02.00) and instead pass in the fd of the DRM device we wish to control, and look up the associated device/power/ under sysfs. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Imre Deak <imre.deak@intel.com> Reviewed-by: Imre Deak <imre.deak@intel.com>
2019-09-20lib/igt_pm: igt lib helper routines to support DC5/6 testsJyoti Yadav
This patch does the following changes to lib/igt_pm.c -dmc_loaded() will be used by new test i915_pm_dc.c which will validate Display C States. So moving the same to igt_pm library. -Introduced igt_disable_runtime_pm() in order to disable runtime suspend for the function which support dc9. -Changed the igt_pm_enable_sata_link_power_management() and igt_pm_restore_sata_link_power_management() in order to save and restore the sata link power policy by an exit handler. v2: Simplify the comment section. v3: Remove . from the subject line. v4: Rebased, resolve conflicts in pm_rpm.c Included patch set version change log. v5: Listing actual change in patch set changelog to make review easier. v6: igt's lib added support for disabling runtime suspend, change in commit log. rebased due to test name pm_rpm changed to i915_pm_rpm. v7: Addressed review comment by saving POWER_DIR values in igt_disable_runtime_pm(). [Imre] v8: Addressed the review comment, igt_pm_enable_sata_link_power_management function to restore the original SATA link power policy if things fail by using an exit handler. [Imre] v9: IGT failure fixture in i915_pm_backlight and i915_pm_rpm. v10:Review comment fixup in sata_link_power_management lib functions. [Imre] v11:Add igt_assert_fd(pm_status_fd) in igt_disable_runtime_pm(). [Imre & Petri] v12: Refactor igt_pm_pc8_plus_residencies_enabled() from supports_pc8_plus_residencies(). Changed igt_disable_runtime_pm() return type. [Imre] Signed-off-by: Jyoti Yadav <jyoti.r.yadav@intel.com> Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com> Reviewed-by: Imre Deak <imre.deak@intel.com>
2018-08-02lib/igt_pm: Export function to restore runtime PM statusTvrtko Ursulin
In cases when runtime PM is enabled only from individual subtests and not whole tests it is usable to be able to restore the old runtime PM config and so avoid running subsequent subtests in an unexpected environment. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-07-27lib: update docs for igt_pmDaniel Vetter
- Move all the pm helpers into igt_pm.c. No idea why that wasn't done in the original commit that created igt_pm.c. - Add missing docs where needed. Cc: David Weinehall <david.weinehall@intel.com> Cc: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-02-19lib/igt_pm: Lib for power managementDavid Weinehall
Move power management related code to a separate library. Initially this is done only for workarounds that apply to external components. Modify the users of such workarounds accordingly. This currently involves HD audio and SATA link power management. For SATA link PM there's also code to save the previous settings, to allow for resetting the values after we've finished testing. Signed-off-by: David Weinehall <david.weinehall@intel.com> Reviewed-by: Marius Vlad <marius.c.vlad@intel.com> Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>