summaryrefslogtreecommitdiff
path: root/tests/kms_pwrite_crc.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2015-12-17 01:39:31 +0200
committerVille Syrjälä <ville.syrjala@linux.intel.com>2016-01-08 15:01:59 +0200
commit5b113d323dde18ef3bbae2f57d613be4ab7eb267 (patch)
treecd2bc3a7b496e985bd856f2c341e553c3315ec71 /tests/kms_pwrite_crc.c
parent7cb35109645e6495f67981b9930587c1ddfe4f90 (diff)
lib: Extract some common fb create+fill methods into helpers
Several tests do one or more of the following: * igt_create_fb() + igt_paint_test_pattern() * igt_create_color_fb() + igt_paint_test_pattern() * igt_create_fb() + igt_paint_image() Extract them into new helpers: igt_create_pattern_fb(), igt_create_color_pattern_fb(), igt_create_image_fb(). v2: Fix typos, and improve API docs (Thomas) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'tests/kms_pwrite_crc.c')
-rw-r--r--tests/kms_pwrite_crc.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/tests/kms_pwrite_crc.c b/tests/kms_pwrite_crc.c
index 983418f8..86292bda 100644
--- a/tests/kms_pwrite_crc.c
+++ b/tests/kms_pwrite_crc.c
@@ -50,7 +50,6 @@ static void test(data_t *data)
igt_output_t *output = data->output;
struct igt_fb *fb = &data->fb[1];
drmModeModeInfo *mode;
- cairo_t *cr;
uint32_t caching;
void *buf;
igt_crc_t crc;
@@ -58,12 +57,8 @@ static void test(data_t *data)
mode = igt_output_get_mode(output);
/* create a non-white fb where we can pwrite later */
- igt_create_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
- DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE, fb);
-
- cr = igt_get_cairo_ctx(data->drm_fd, fb);
- igt_paint_test_pattern(cr, fb->width, fb->height);
- cairo_destroy(cr);
+ igt_create_pattern_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
+ DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE, fb);
/* flip to it to make it UC/WC and fully flushed */
drmModeSetPlane(data->drm_fd,