diff options
| author | Imre Deak <imre.deak@intel.com> | 2020-05-12 16:04:15 +0530 |
|---|---|---|
| committer | Swati Sharma <swati2.sharma@intel.com> | 2020-05-18 17:28:17 +0530 |
| commit | 32498f12ab0496ad18d7055d42be02a15c978b3b (patch) | |
| tree | a37f2699c98dd05aa49ef780383a1dbd1d1832a1 /tests | |
| parent | 4824980a9f374ce97c9781d11a3f47da85e28b39 (diff) | |
tests/i915_pm_rpm: Fix the universal-plane cap setting in plane tests
The current value of the universal-plane capability is 1 if
igt_display_require() has been called, so make sure we always set the
value expected by the test and restore the correct original value.
Cc: Anshuman Gupta <anshuman.gupta@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Anshuman Gupta <anshuman.gupta@intel.com>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/i915/i915_pm_rpm.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/tests/i915/i915_pm_rpm.c b/tests/i915/i915_pm_rpm.c index 650de7b0..0a641640 100644 --- a/tests/i915/i915_pm_rpm.c +++ b/tests/i915/i915_pm_rpm.c @@ -1786,18 +1786,15 @@ static void test_one_plane(bool dpms, uint32_t plane_id, /* This one also triggered WARNs on our driver at some point in time. */ static void planes_subtest(bool universal, bool dpms) { - int i, rc, crtc_idx; + int i, planes_tested = 0, crtc_idx; drmModePlaneResPtr planes; igt_require(default_mode_params); crtc_idx = kmstest_get_crtc_idx(ms_data.res, default_mode_params->crtc_id); - if (universal) { - rc = drmSetClientCap(drm_fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, - 1); - igt_require(rc == 0); - } + igt_assert_eq(drmSetClientCap(drm_fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, + universal), 0); planes = drmModeGetPlaneResources(drm_fd); for (i = 0; i < planes->count_planes; i++) { @@ -1818,10 +1815,9 @@ static void planes_subtest(bool universal, bool dpms) } drmModeFreePlaneResources(planes); - if (universal) { - rc = drmSetClientCap(drm_fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 0); - igt_assert_eq(rc, 0); - } + igt_assert_eq(drmSetClientCap(drm_fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, + 1), 0); + igt_assert_lte(universal ? 3 : 1, planes_tested); } static void pm_test_tiling(void) |
