From dd42af7565a7505f7fcf55af45b2d0c00f20d7a3 Mon Sep 17 00:00:00 2001 From: Paulo Zanoni Date: Thu, 18 Jun 2015 14:57:37 -0300 Subject: [PATCH igt] tests/kms_frontbuffer_tracking: not all eDP panels support sink CRC So require sink CRC support for PSR, since the pipe CRC is not exactly useful there. Signed-off-by: Paulo Zanoni --- tests/kms_frontbuffer_tracking.c | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c index 3239779..984eee6 100644 --- a/tests/kms_frontbuffer_tracking.c +++ b/tests/kms_frontbuffer_tracking.c @@ -174,7 +174,11 @@ struct both_crcs *wanted_crc; struct { int fd; -} sink_crc; + bool supported; +} sink_crc = { + .fd = -1, + .supported = false, +}; /* The goal of this structure is to easily allow us to deal with cases where we * have a big framebuffer and the CRTC is just displaying a subregion of this @@ -887,7 +891,8 @@ static void collect_crcs(struct both_crcs *crcs) igt_pipe_crc_collect_crc(pipe_crc, &crcs->pipe); c = get_connector(prim_mode_params.connector_id); - if (c->connector_type == DRM_MODE_CONNECTOR_eDP) + if (c->connector_type == DRM_MODE_CONNECTOR_eDP && + sink_crc.supported) get_sink_crc(&crcs->sink); else memcpy(&crcs->sink, "unsupported!", SINK_CRC_SIZE); @@ -1029,13 +1034,25 @@ static void teardown_modeset(void) igt_remove_fb(drm.fd, &fbs.big); } -static void setup_crcs(void) +static void setup_sink_crc(void) { - pipe_crc = igt_pipe_crc_new(0, INTEL_PIPE_CRC_SOURCE_AUTO); + sink_crc_t crc; sink_crc.fd = igt_debugfs_open("i915_sink_crc_eDP1", O_RDONLY); igt_assert(sink_crc.fd >= 0); + if (read(sink_crc.fd, crc.data, SINK_CRC_SIZE) == SINK_CRC_SIZE) + sink_crc.supported = true; + else + igt_info("Sink CRC not supported\n"); +} + +static void setup_crcs(void) +{ + pipe_crc = igt_pipe_crc_new(0, INTEL_PIPE_CRC_SOURCE_AUTO); + + setup_sink_crc(); + init_blue_crc(); pattern1.initialized = false; @@ -1383,9 +1400,12 @@ static void check_test_requirements(const struct test_mode *t) igt_require_f(fbc.can_test, "Can't test FBC with this chipset\n"); - if (t->feature & FEATURE_PSR) + if (t->feature & FEATURE_PSR) { igt_require_f(psr.can_test, "Can't test PSR with the current outputs\n"); + igt_require_f(sink_crc.supported, + "Can't test PSR without sink CRCs\n"); + } if (opt.only_feature != FEATURE_COUNT) igt_require(t->feature == opt.only_feature); -- 2.1.4