summaryrefslogtreecommitdiff
path: root/tests/kms_cursor_crc.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2014-04-25 13:50:59 +0300
committerVille Syrjälä <ville.syrjala@linux.intel.com>2014-04-25 16:18:19 +0300
commitfb2ccb1ade605e7c55da2ee82c9cd41d98270fa5 (patch)
tree49d25ea0a84ee2dafda16e11a972dd63125af2b5 /tests/kms_cursor_crc.c
parentf8e5a3fc7e92f67cea7c1832e786cbb344aefd5e (diff)
kms_cursor_crc: Allow the test to run without cursor cap support
Assume that only 64x64 cursor size is supported if the cursor size caps aren't supported by the kernel. This allows the test to run on older kernels. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'tests/kms_cursor_crc.c')
-rw-r--r--tests/kms_cursor_crc.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index ddcdb7d7..d2cb7e37 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -349,7 +349,7 @@ static void run_test_generic(data_t *data, int cursor_max_size)
{
int cursor_size;
char c_size[5];
- for (cursor_size = 64; cursor_size <= cursor_max_size; cursor_size *= 2)
+ for (cursor_size = 64; cursor_size <= 256; cursor_size *= 2)
{
igt_require(cursor_max_size >= cursor_size);
sprintf(c_size, "%d", cursor_size);
@@ -372,10 +372,9 @@ static void run_test_generic(data_t *data, int cursor_max_size)
}
}
-uint64_t cursor_width, cursor_height;
-
igt_main
{
+ uint64_t cursor_width = 64, cursor_height = 64;
data_t data = {};
int ret;
@@ -385,10 +384,10 @@ igt_main
data.drm_fd = drm_open_any();
ret = drmGetCap(data.drm_fd, DRM_CAP_CURSOR_WIDTH, &cursor_width);
- igt_assert(ret == 0);
+ 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);
+ igt_assert(ret == 0 || errno == EINVAL);
/* We assume width and height are same so max is assigned width */
igt_assert_cmpint(cursor_width, ==, cursor_height);