summaryrefslogtreecommitdiff
path: root/tests/kms_rotation_crc.c
diff options
context:
space:
mode:
authorDamien Lespiau <damien.lespiau@intel.com>2014-07-08 18:36:32 +0100
committerDamien Lespiau <damien.lespiau@intel.com>2014-07-11 15:12:22 +0100
commit39abe7790f675a7d46cab2e04043b278615c0b0a (patch)
treeb5cac631f97fd2b830135e4df7914357ce2fe15a /tests/kms_rotation_crc.c
parent8facccfae4c05275ae2fb31bb1948b1fea9a7687 (diff)
kms_rotation_crc: Use igt_plane_set_rotation()
More code we can remove from the test. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Diffstat (limited to 'tests/kms_rotation_crc.c')
-rw-r--r--tests/kms_rotation_crc.c52
1 files changed, 5 insertions, 47 deletions
diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index 308e8846..15529c72 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -138,42 +138,6 @@ static bool prepare_crtc(data_t *data, enum pipe pipe)
return true;
}
-static int set_plane_property(data_t *data, int plane_id, const char *prop_name, int
- val, igt_crc_t *crc_output)
-{
- int i = 0, ret = 0;
- int drm_fd = data->gfx_fd;
- uint64_t value;
- drmModeObjectPropertiesPtr props = NULL;
-
- value = (uint64_t)val;
- props = drmModeObjectGetProperties(drm_fd, plane_id, DRM_MODE_OBJECT_PLANE);
-
- for (i = 0; i < props->count_props; i++) {
- drmModePropertyPtr prop = drmModeGetProperty(drm_fd, props->props[i]);
- igt_info("\nProp->name=%s: plane_id:%d\n ", prop->name, plane_id);
-
- if (strcmp(prop->name, prop_name) == 0) {
- ret = drmModeObjectSetProperty(drm_fd, plane_id, DRM_MODE_OBJECT_PLANE,
- (uint32_t)prop->prop_id, value);
- if (ret) {
- igt_info("set_property \"%s\" to %d for plane %d is failed, err:%d\n", prop_name, val, plane_id, ret);
- drmModeFreeProperty(prop);
- drmModeFreeObjectProperties(props);
- return ret;
- } else {
- /* Collect crc after rotation */
- igt_pipe_crc_collect_crc(data->pipe_crc, crc_output);
- drmModeFreeProperty(prop);
- break;
- }
- }
- drmModeFreeProperty(prop);
- }
- drmModeFreeObjectProperties(props);
- return 0;
-}
-
static void cleanup_crtc(data_t *data, igt_output_t *output)
{
igt_display_t *display = &data->display;
@@ -193,8 +157,6 @@ static void test_plane_rotation(data_t *data, enum igt_plane plane)
igt_display_t *display = &data->display;
igt_output_t *output;
int p;
- int plane_id;
- int ret;
int valid_tests = 0;
igt_crc_t crc_output;
@@ -212,16 +174,12 @@ static void test_plane_rotation(data_t *data, enum igt_plane plane)
igt_require(igt_plane_supports_rotation(data->plane));
- plane_id = data->plane->drm_plane->plane_id;
- if (plane_id != 0) {
- igt_info("Setting rotation property for plane:%d\n", plane_id);
- ret = set_plane_property(data, plane_id, "rotation", BIT(DRM_ROTATE_180), &crc_output);
- if (ret < 0) {
- igt_info("Setting rotation failed!");
- return;
- }
- }
+ igt_plane_set_rotation(data->plane, IGT_ROTATION_180);
+ igt_display_commit2(display, COMMIT_UNIVERSAL);
+
+ igt_pipe_crc_collect_crc(data->pipe_crc, &crc_output);
igt_assert(igt_crc_equal(&data->ref_crc, &crc_output));
+
sleep(2);
valid_tests++;
cleanup_crtc(data, output);