[igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: Limit cursor size based platform capability.

Karthik B S
2019-04-30T09:51:59Z

Limiting the cursor size of subtests to the maximum size listed as per
the platform capability, so that we can avoid skipping of subtests.

Also moving the platform capability fetch outside igt_fixture,
so that all the valid subtests are listed during --list-subtests.

Signed-off-by: Karthik B S <karthik.b.s@intel.com>
---
tests/kms_cursor_crc.c | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index fd74fda..6fb33a1 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -642,7 +642,8 @@ static void test_rapid_movement(data_t *data)
static void run_test_generic(data_t *data)
{
int cursor_size;
- for (cursor_size = 64; cursor_size <= 512; cursor_size *= 2) {
+ for (cursor_size = 64; cursor_size <= data->cursor_max_w;
+ cursor_size *= 2) {
int w = cursor_size;
int h = cursor_size;

@@ -719,18 +720,19 @@ igt_main

igt_skip_on_simulation();

- igt_fixture {
- data.drm_fd = drm_open_driver_master(DRIVER_ANY);
+ data.drm_fd = drm_open_driver_master(DRIVER_ANY);
+
+ ret = drmGetCap(data.drm_fd, DRM_CAP_CURSOR_WIDTH, &cursor_width);
+ igt_assert(ret == 0 || errno == EINVAL);

- ret = drmGetCap(data.drm_fd, DRM_CAP_CURSOR_WIDTH, &cursor_width);
- igt_assert(ret == 0 || errno == EINVAL);
- /* Not making use of cursor_height since it is same as width, still reading */
- ret = drmGetCap(data.drm_fd, DRM_CAP_CURSOR_HEIGHT, &cursor_height);
- igt_assert(ret == 0 || errno == EINVAL);
+ /* Not making use of cursor_height since it is same as width, still reading */
+ ret = drmGetCap(data.drm_fd, DRM_CAP_CURSOR_HEIGHT, &cursor_height);
+ igt_assert(ret == 0 || errno == EINVAL);

- /* We assume width and height are same so max is assigned width */
- igt_assert_eq(cursor_width, cursor_height);
+ /* We assume width and height are same so max is assigned width */
+ igt_assert_eq(cursor_width, cursor_height);

+ igt_fixture {
kmstest_set_vt_graphics_mode();

igt_require_pipe_crc(data.drm_fd);
--
2.7.4