diff options
author | Paul Kocialkowski <paul.kocialkowski@bootlin.com> | 2018-12-27 15:57:38 +0100 |
---|---|---|
committer | Arkadiusz Hiler <arkadiusz.hiler@intel.com> | 2018-12-31 10:12:33 +0200 |
commit | 7eeb13d7b27d87afdc8dd8bdec770811eac47c8d (patch) | |
tree | 0ff7e9686d51b474628ec63368f7d063f9c465d5 /tests/kms_chamelium.c | |
parent | acaaa8eaf2d02357dd6e05a09ff5fd7cdc085daf (diff) |
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 <paul.kocialkowski@bootlin.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Diffstat (limited to 'tests/kms_chamelium.c')
-rw-r--r-- | tests/kms_chamelium.c | 11 |
1 files changed, 5 insertions, 6 deletions
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); |