summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaulo Zanoni <paulo.r.zanoni@intel.com>2016-12-22 18:42:05 -0200
committerPaulo Zanoni <paulo.r.zanoni@intel.com>2017-01-04 16:05:33 -0200
commitb97f5241139a29457d8fabd429b751e6a3247181 (patch)
treee95501e8146734d6cf95f81225434eda1bf0b879 /tests
parent90aed5f22e55a8f8652f2316900b19bf4f1bab77 (diff)
kms_frontbuffer_tracking: move more code to get_sink_crc()
Make it check for the supported flag and decide what to do. This change will make the next patches much easier, and it's probably better to move more sink CRC logic to the sink CRC function. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/kms_frontbuffer_tracking.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index a8c3cb0d..4b16c2c9 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -933,6 +933,11 @@ static void get_sink_crc(sink_crc_t *crc, bool mandatory)
{
int rc, errno_;
+ if (!sink_crc.supported) {
+ memcpy(crc, "unsupported!", SINK_CRC_SIZE);
+ return;
+ }
+
lseek(sink_crc.fd, 0, SEEK_SET);
rc = read(sink_crc.fd, crc->data, SINK_CRC_SIZE);
@@ -1220,11 +1225,7 @@ static void print_crc(const char *str, struct both_crcs *crc)
static void collect_crcs(struct both_crcs *crcs, bool mandatory_sink_crc)
{
igt_pipe_crc_collect_crc(pipe_crc, &crcs->pipe);
-
- if (sink_crc.supported)
- get_sink_crc(&crcs->sink, mandatory_sink_crc);
- else
- memcpy(&crcs->sink, "unsupported!", SINK_CRC_SIZE);
+ get_sink_crc(&crcs->sink, mandatory_sink_crc);
}
static void init_blue_crc(enum pixel_format format, bool mandatory_sink_crc)