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>
This commit is contained in:
Ville Syrjälä
2015-12-17 01:39:31 +02:00
parent 7cb3510964
commit 5b113d323d
11 changed files with 191 additions and 154 deletions
+2 -9
View File
@@ -78,16 +78,9 @@ static void screens_disabled_subtest(int drm_fd, drmModeResPtr drm_res)
static uint32_t create_fb(int drm_fd, int width, int height)
{
struct igt_fb fb;
cairo_t *cr;
uint32_t buffer_id;
buffer_id = igt_create_fb(drm_fd, width, height, DRM_FORMAT_XRGB8888,
LOCAL_DRM_FORMAT_MOD_NONE, &fb);
cr = igt_get_cairo_ctx(drm_fd, &fb);
igt_paint_test_pattern(cr, width, height);
cairo_destroy(cr);
return buffer_id;
return igt_create_pattern_fb(drm_fd, width, height, DRM_FORMAT_XRGB8888,
LOCAL_DRM_FORMAT_MOD_NONE, &fb);
}
static void edp_subtest(int drm_fd, drmModeResPtr drm_res,