mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-12 10:26:12 +00:00
tests/pm_pc8: add pci-d3-state subtest
Currently the test suite just looks at the files provided by the runtime power management framework to check if the device is runtime suspended. Add a test that reads the PCI config space to check if the device is actually in PCI D3 state or not. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
This commit is contained in:
parent
31b20f7478
commit
37773d91d9
@ -1406,6 +1406,35 @@ static void reg_read_ioctl_subtest(void)
|
|||||||
igt_assert(wait_for_suspended());
|
igt_assert(wait_for_suspended());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool device_in_pci_d3(void)
|
||||||
|
{
|
||||||
|
struct pci_device *pci_dev;
|
||||||
|
int rc;
|
||||||
|
uint16_t val;
|
||||||
|
|
||||||
|
pci_dev = intel_get_pci_device();
|
||||||
|
|
||||||
|
rc = pci_device_cfg_read_u16(pci_dev, &val, 0xd4);
|
||||||
|
igt_assert(rc == 0);
|
||||||
|
|
||||||
|
return (val & 0x3) == 0x3;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void pci_d3_state_subtest(void)
|
||||||
|
{
|
||||||
|
igt_require(has_runtime_pm);
|
||||||
|
|
||||||
|
disable_all_screens(&ms_data);
|
||||||
|
igt_assert(wait_for_suspended());
|
||||||
|
|
||||||
|
igt_assert(device_in_pci_d3());
|
||||||
|
|
||||||
|
enable_one_screen(&ms_data);
|
||||||
|
igt_assert(wait_for_active());
|
||||||
|
|
||||||
|
igt_assert(!device_in_pci_d3());
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int rounds = 50;
|
int rounds = 50;
|
||||||
@ -1429,6 +1458,8 @@ int main(int argc, char *argv[])
|
|||||||
basic_subtest();
|
basic_subtest();
|
||||||
igt_subtest("drm-resources-equal")
|
igt_subtest("drm-resources-equal")
|
||||||
drm_resources_equal_subtest();
|
drm_resources_equal_subtest();
|
||||||
|
igt_subtest("pci-d3-state")
|
||||||
|
pci_d3_state_subtest();
|
||||||
|
|
||||||
/* Basic modeset */
|
/* Basic modeset */
|
||||||
igt_subtest("modeset-lpsp")
|
igt_subtest("modeset-lpsp")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user