From: Damien Lespiau Subject: [PATCH i-g-t 27/43] kms_rotation_crc: Use igt_plane_set_rotation() Date: Thu, 10 Jul 2014 19:00:28 +0100 Message-ID: <1405015244-11370-28-git-send-email-damien.lespiau@intel.com> References: <1405015244-11370-1-git-send-email-damien.lespiau@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by gabe.freedesktop.org (Postfix) with ESMTP id F23336E77D for ; Thu, 10 Jul 2014 11:01:38 -0700 (PDT) In-Reply-To: <1405015244-11370-1-git-send-email-damien.lespiau@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org More code we can remove from the test. Signed-off-by: Damien Lespiau --- tests/kms_rotation_crc.c | 52 +++++------------------------------------------- 1 file changed, 5 insertions(+), 47 deletions(-) diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c index 308e884..15529c7 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); -- 1.8.3.1