tests/kms_fbc_crc: unify flip handling

Just a small simplification to make the code a little easier to
understand, and to help us when we further split drawing vs flipping
later.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
This commit is contained in:
Paulo Zanoni 2015-05-06 19:10:46 -03:00
parent 036401d42c
commit fceed3a585

View File

@ -216,19 +216,18 @@ static void test_crc(data_t *data, enum test_mode mode)
igt_assert(fbc_enabled(data));
if (mode >= TEST_PAGE_FLIP_AND_MMAP_CPU) {
if (mode == TEST_PAGE_FLIP || mode >= TEST_PAGE_FLIP_AND_MMAP_CPU) {
handle = data->fb[1].gem_handle;
igt_assert(drmModePageFlip(data->drm_fd, crtc_id,
data->fb[1].fb_id, 0, NULL) == 0);
igt_assert(wait_for_fbc_enabled(data));
if (mode != TEST_PAGE_FLIP)
igt_assert(wait_for_fbc_enabled(data));
}
switch (mode) {
void *ptr;
case TEST_PAGE_FLIP:
igt_assert(drmModePageFlip(data->drm_fd, crtc_id,
data->fb[1].fb_id, 0, NULL) == 0);
break;
case TEST_MMAP_CPU:
case TEST_PAGE_FLIP_AND_MMAP_CPU: