[igt-dev] [PATCH i-g-t v4 1/4] test/psr: Skip PSR2 tests when panel resolution is bigger than PSR2 HW supports

José Roberto de Souza
2019-01-23T23:56:38Z

If resolution that will be used in PSR tests is bigger than the
resolution that PSR2 HW supports, PSR2 will not be enabled so those
tests should be skiped. Most of eDP panels only supports one
resolution that is why we don't even try to use other resolution.

BSpec: 7713

Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
---
tests/kms_psr.c | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/tests/kms_psr.c b/tests/kms_psr.c
index 3e16a6bf..4792e158 100644
--- a/tests/kms_psr.c
+++ b/tests/kms_psr.c
@@ -445,13 +445,30 @@ int main(int argc, char *argv[])
igt_require_f(sink_support(&data, PSR_MODE_1),
"Sink does not support PSR\n");

- data.supports_psr2 = sink_support(&data, PSR_MODE_2);
-
data.bufmgr = drm_intel_bufmgr_gem_init(data.drm_fd, 4096);
igt_assert(data.bufmgr);
drm_intel_bufmgr_gem_enable_reuse(data.bufmgr);

display_init(&data);
+
+ data.supports_psr2 = sink_support(&data, PSR_MODE_2);
+ if (data.supports_psr2) {
+ uint32_t devid = intel_get_drm_devid(data.drm_fd);
+ uint16_t max_h = 0, max_v = 0;
+ int gen = intel_gen(devid);
+
+ if (gen >= 10 || IS_GEMINILAKE(devid)) {
+ max_h = 4096;
+ max_v = 2304;
+ } else if (gen == 9) {
+ max_h = 3640;
+ max_v = 2304;
+ }
+
+ if (data.mode->hdisplay > max_h ||
+ data.mode->vdisplay > max_v)
+ data.supports_psr2 = false;
+ }
}

for (data.op_psr_mode = PSR_MODE_1; data.op_psr_mode <= PSR_MODE_2;
--
2.20.1