summaryrefslogtreecommitdiff
path: root/tests/kms_async_flips.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2022-02-16 20:11:19 +0200
committerVille Syrjälä <ville.syrjala@linux.intel.com>2022-02-18 14:28:15 +0200
commit9cb64a757d2ff1e180b1648e611439d94afd697d (patch)
tree375cdf954ee1dfb3a3eec400903fd3e053210ac3 /tests/kms_async_flips.c
parent601d84c7621133e0c4f56c296c4dc45d537c5348 (diff)
tests/kms_async_flips: Make the crc test faster
Use a smaler mode for the crc test so we don't have to draw so many pixels. Gives me 50% more flips on a tgl with 4k screen. Hopefully this help out those poor shard-skls a bit. Reviewed-by: Karthik B S <karthik.b.s@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'tests/kms_async_flips.c')
-rw-r--r--tests/kms_async_flips.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/tests/kms_async_flips.c b/tests/kms_async_flips.c
index 5e11cd43..c658630c 100644
--- a/tests/kms_async_flips.c
+++ b/tests/kms_async_flips.c
@@ -472,19 +472,28 @@ static unsigned int clock_ms(void)
return ts.tv_sec * 1000 + ts.tv_nsec / 1000000;
}
-static void paint_fb(int fd, struct igt_fb *fb, uint32_t color)
+static void paint_fb(int fd, struct igt_fb *fb, uint32_t color, int height)
{
igt_draw_rect_fb(fd, NULL, 0, fb,
gem_has_mappable_ggtt(fd) ?
IGT_DRAW_MMAP_GTT : IGT_DRAW_MMAP_WC,
- 0, 0, 1, fb->height, color);
+ 0, 0, 1, height, color);
}
static void test_crc(data_t *data)
{
unsigned int frame = 0;
unsigned int start;
- int ret;
+ int ret, height;
+ drmModeModeInfoPtr mode;
+
+ /* make things faster by using a smallish mode */
+ mode = &data->connector->modes[0];
+ if (mode->hdisplay > 1024 && mode->vdisplay > 786)
+ mode = igt_std_1024_mode_get(data->refresh_rate);
+ else
+ mode = igt_memdup(mode, sizeof(*mode));
+ height = mode->vdisplay;
data->flip_count = 0;
data->frame_count = 0;
@@ -494,7 +503,8 @@ static void test_crc(data_t *data)
igt_draw_fill_fb(data->drm_fd, &data->bufs[!frame], 0xff0000ff);
ret = drmModeSetCrtc(data->drm_fd, data->crtc_id, data->bufs[frame].fb_id, 0, 0,
- &data->connector->connector_id, 1, &data->connector->modes[0]);
+ &data->connector->connector_id, 1, mode);
+ free(mode);
igt_assert_eq(ret, 0);
data->pipe_crc = igt_pipe_crc_new(data->drm_fd,
@@ -510,7 +520,7 @@ static void test_crc(data_t *data)
while (clock_ms() - start < 2000) {
/* fill the next fb with the expected color */
- paint_fb(data->drm_fd, &data->bufs[frame], 0xff0000ff);
+ paint_fb(data->drm_fd, &data->bufs[frame], 0xff0000ff, height);
data->flip_pending = true;
ret = drmModePageFlip(data->drm_fd, data->crtc_id, data->bufs[frame].fb_id,
@@ -521,7 +531,7 @@ static void test_crc(data_t *data)
/* clobber the previous fb which should no longer be scanned out */
frame = !frame;
- paint_fb(data->drm_fd, &data->bufs[frame], rand());
+ paint_fb(data->drm_fd, &data->bufs[frame], rand(), height);
}
igt_pipe_crc_stop(data->pipe_crc);