From 7eeb13d7b27d87afdc8dd8bdec770811eac47c8d Mon Sep 17 00:00:00 2001 From: Paul Kocialkowski Date: Thu, 27 Dec 2018 15:57:38 +0100 Subject: chamelium: Pass dimensions instead of mode to pattern generation helper In order to reuse the pattern generation helper for overlay planes, let's provide the pattern generation helper with the explicit dimensions instead of the mode (that only applies to the primary plane). Signed-off-by: Paul Kocialkowski Reviewed-by: Lyude Paul --- tests/kms_chamelium.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'tests/kms_chamelium.c') diff --git a/tests/kms_chamelium.c b/tests/kms_chamelium.c index ebca5eef..42ea490c 100644 --- a/tests/kms_chamelium.c +++ b/tests/kms_chamelium.c @@ -504,7 +504,7 @@ static void chamelium_paint_xr24_pattern(uint32_t *data, *(data + i * stride / 4 + j) = colors[((j / 64) + (i / 64)) % 5]; } -static int chamelium_get_pattern_fb(data_t *data, drmModeModeInfo *mode, +static int chamelium_get_pattern_fb(data_t *data, size_t width, size_t height, uint32_t fourcc, struct igt_fb *fb) { int fb_id; @@ -512,15 +512,14 @@ static int chamelium_get_pattern_fb(data_t *data, drmModeModeInfo *mode, igt_assert(fourcc == DRM_FORMAT_XRGB8888); - fb_id = igt_create_fb(data->drm_fd, mode->hdisplay, mode->vdisplay, - fourcc, LOCAL_DRM_FORMAT_MOD_NONE, fb); + fb_id = igt_create_fb(data->drm_fd, width, height, fourcc, + LOCAL_DRM_FORMAT_MOD_NONE, fb); igt_assert(fb_id > 0); ptr = igt_fb_map_buffer(fb->fd, fb); igt_assert(ptr); - chamelium_paint_xr24_pattern(ptr, mode->hdisplay, mode->vdisplay, - fb->strides[0]); + chamelium_paint_xr24_pattern(ptr, width, height, fb->strides[0]); igt_fb_unmap_buffer(fb, ptr); return fb_id; @@ -537,7 +536,7 @@ static void do_test_display_crc(data_t *data, struct chamelium_port *port, int i, fb_id, captured_frame_count; int frame_id; - fb_id = chamelium_get_pattern_fb(data, mode, + fb_id = chamelium_get_pattern_fb(data, mode->hdisplay, mode->vdisplay, DRM_FORMAT_XRGB8888, &fb); igt_assert(fb_id > 0); -- cgit v1.2.3