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
+3 -5
View File
@@ -259,8 +259,6 @@ static void paint_output_info(struct connector *c, struct igt_fb *fb)
double max_width;
int i;
igt_paint_test_pattern(cr, l_width, l_height);
cairo_move_to(cr, l_width / 2, l_height / 2);
/* Print connector and mode name */
@@ -353,9 +351,9 @@ set_mode(struct connector *c)
width = c->mode.hdisplay;
height = c->mode.vdisplay;
fb_id = igt_create_fb(drm_fd, width, height,
igt_bpp_depth_to_drm_format(bpp, depth),
tiling, &fb_info[current_fb]);
fb_id = igt_create_pattern_fb(drm_fd, width, height,
igt_bpp_depth_to_drm_format(bpp, depth),
tiling, &fb_info[current_fb]);
paint_output_info(c, &fb_info[current_fb]);
paint_color_key(&fb_info[current_fb]);