summaryrefslogtreecommitdiff
path: root/tests/pm_rpm.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/pm_rpm.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/pm_rpm.c')
-rw-r--r--tests/pm_rpm.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/tests/pm_rpm.c b/tests/pm_rpm.c
index 55fdb31c..3a5e8baf 100644
--- a/tests/pm_rpm.c
+++ b/tests/pm_rpm.c
@@ -233,7 +233,6 @@ static bool init_modeset_params_for_type(struct mode_set_data *data,
int i;
uint32_t connector_id = 0;
drmModeModeInfoPtr mode = NULL;
- cairo_t *cr;
for (i = 0; i < data->res->count_connectors; i++) {
drmModeConnectorPtr c = data->connectors[i];
@@ -256,12 +255,9 @@ static bool init_modeset_params_for_type(struct mode_set_data *data,
if (!connector_id)
return false;
- igt_create_fb(drm_fd, mode->hdisplay, mode->vdisplay,
- DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE,
- &params->fb);
- cr = igt_get_cairo_ctx(drm_fd, &params->fb);
- igt_paint_test_pattern(cr, mode->hdisplay, mode->vdisplay);
- cairo_destroy(cr);
+ igt_create_pattern_fb(drm_fd, mode->hdisplay, mode->vdisplay,
+ DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE,
+ &params->fb);
params->crtc_id = data->res->crtcs[0];
params->connector_id = connector_id;