diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2020-02-19 03:14:39 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2020-02-19 03:14:39 +0000 |
commit | e64bfd84a7b4a2969ef09bf6741412c276274aa7 (patch) | |
tree | 23e4915f3b1237a3fe92b38d30b88256aa19d6d6 | |
parent | 7dccb24edb6a861b665739b6ce4bf5c127d56adc (diff) | |
parent | cb3381988ec1617f3d794162410c54bc5521a8ed (diff) | |
download | platform_external_igt-gpu-tools-android-vts-11.0_r3.tar.gz platform_external_igt-gpu-tools-android-vts-11.0_r3.tar.bz2 platform_external_igt-gpu-tools-android-vts-11.0_r3.zip |
Snap for 6216739 from cb3381988ec1617f3d794162410c54bc5521a8ed to rvc-releaseandroid-vts-11.0_r5android-vts-11.0_r4android-vts-11.0_r3android-vts-11.0_r2android-vts-11.0_r1android-security-11.0.0_r1android-platform-11.0.0_r9android-platform-11.0.0_r8android-platform-11.0.0_r7android-platform-11.0.0_r6android-platform-11.0.0_r5android-platform-11.0.0_r4android-platform-11.0.0_r3android-platform-11.0.0_r2android-platform-11.0.0_r10android-platform-11.0.0_r1android-cts-11.0_r5android-cts-11.0_r4android-cts-11.0_r3android-cts-11.0_r2android-cts-11.0_r1android-11.0.0_r5android-11.0.0_r4android-11.0.0_r3android-11.0.0_r25android-11.0.0_r2android-11.0.0_r17android-11.0.0_r1android11-tests-releaseandroid11-security-releaseandroid11-s1-releaseandroid11-releaseandroid11-platform-releaseandroid11-gsi
Change-Id: I9e7790bd4dd4f3ccd25a296d8677deeed1b7f12b
-rw-r--r-- | Android.bp | 8 | ||||
-rw-r--r-- | lib/igt_dummy.c | 49 | ||||
-rw-r--r-- | tests/kms_vblank.c | 20 |
3 files changed, 67 insertions, 10 deletions
@@ -26,10 +26,12 @@ cc_library_static { "lib/igt_core.c", "lib/igt_debugfs.c", "lib/igt_device.c", + "lib/igt_dummy.c", "lib/igt_dummyload.c", "lib/igt_fb.c", "lib/igt_kmod.c", "lib/igt_kms.c", + "lib/igt_pm.c", "lib/igt_stats.c", "lib/igt_sysfs.c", "lib/ion.c", @@ -75,3 +77,9 @@ cc_test { defaults: ["igt-gpu-tools-test-defaults"], srcs: ["tests/ion_fb.c"], } + +cc_test { + name: "kms_vblank", + defaults: ["igt-gpu-tools-test-defaults"], + srcs: ["tests/kms_vblank.c"], +} diff --git a/lib/igt_dummy.c b/lib/igt_dummy.c new file mode 100644 index 00000000..8f4df67f --- /dev/null +++ b/lib/igt_dummy.c @@ -0,0 +1,49 @@ +/* + * Copyright © 2020 Google LLC. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/** + * SECTION:igt_dummy + * @short_description: GT support library for non-GT devices + * @title: GT + * @include: igt.h + * + * This library provides various auxiliary helper functions to stub out general + * interactions like forcewake handling, injecting hangs or stopping engines + * that some tests rely on, but which a non-GT device does not support. + */ + +#include "igt_gt.h" + +igt_hang_t igt_hang_ring(int fd, int ring) { + return (igt_hang_t) { NULL, 0, 0, 0 }; +} + +void igt_post_hang_ring(int fd, igt_hang_t arg) { +} + +igt_hang_t igt_allow_hang(int fd, unsigned ctx, unsigned flags) { + return (igt_hang_t) { NULL, 0, 0, 0 }; +} + +void igt_disallow_hang(int fd, igt_hang_t arg) { +} diff --git a/tests/kms_vblank.c b/tests/kms_vblank.c index 79ff97b2..babef39d 100644 --- a/tests/kms_vblank.c +++ b/tests/kms_vblank.c @@ -231,24 +231,24 @@ static void accuracy(data_t *data, int fd, int nchildren) int n; memset(&vbl, 0, sizeof(vbl)); - vbl.request.type = DRM_VBLANK_RELATIVE; + vbl.request.type = _DRM_VBLANK_RELATIVE; vbl.request.type |= pipe_id_flag; vbl.request.sequence = 1; igt_assert_eq(wait_vblank(fd, &vbl), 0); target = vbl.reply.sequence + total; for (n = 0; n < total; n++) { - vbl.request.type = DRM_VBLANK_RELATIVE; + vbl.request.type = _DRM_VBLANK_RELATIVE; vbl.request.type |= pipe_id_flag; vbl.request.sequence = 1; igt_assert_eq(wait_vblank(fd, &vbl), 0); - vbl.request.type = DRM_VBLANK_ABSOLUTE | DRM_VBLANK_EVENT; + vbl.request.type = _DRM_VBLANK_ABSOLUTE | _DRM_VBLANK_EVENT; vbl.request.type |= pipe_id_flag; vbl.request.sequence = target; igt_assert_eq(wait_vblank(fd, &vbl), 0); } - vbl.request.type = DRM_VBLANK_RELATIVE; + vbl.request.type = _DRM_VBLANK_RELATIVE; vbl.request.type |= pipe_id_flag; vbl.request.sequence = 0; igt_assert_eq(wait_vblank(fd, &vbl), 0); @@ -269,7 +269,7 @@ static void vblank_query(data_t *data, int fd, int nchildren) unsigned long sq, count = 0; memset(&vbl, 0, sizeof(vbl)); - vbl.request.type = DRM_VBLANK_RELATIVE; + vbl.request.type = _DRM_VBLANK_RELATIVE; vbl.request.type |= pipe_id_flag; vbl.request.sequence = 0; igt_assert_eq(wait_vblank(fd, &vbl), 0); @@ -278,7 +278,7 @@ static void vblank_query(data_t *data, int fd, int nchildren) clock_gettime(CLOCK_MONOTONIC, &start); do { - vbl.request.type = DRM_VBLANK_RELATIVE; + vbl.request.type = _DRM_VBLANK_RELATIVE; vbl.request.type |= pipe_id_flag; vbl.request.sequence = 0; igt_assert_eq(wait_vblank(fd, &vbl), 0); @@ -298,7 +298,7 @@ static void vblank_wait(data_t *data, int fd, int nchildren) unsigned long sq, count = 0; memset(&vbl, 0, sizeof(vbl)); - vbl.request.type = DRM_VBLANK_RELATIVE; + vbl.request.type = _DRM_VBLANK_RELATIVE; vbl.request.type |= pipe_id_flag; vbl.request.sequence = 0; igt_assert_eq(wait_vblank(fd, &vbl), 0); @@ -307,7 +307,7 @@ static void vblank_wait(data_t *data, int fd, int nchildren) clock_gettime(CLOCK_MONOTONIC, &start); do { - vbl.request.type = DRM_VBLANK_RELATIVE; + vbl.request.type = _DRM_VBLANK_RELATIVE; vbl.request.type |= pipe_id_flag; vbl.request.sequence = 1; igt_assert_eq(wait_vblank(fd, &vbl), 0); @@ -368,7 +368,7 @@ static void vblank_ts_cont(data_t *data, int fd, int nchildren) if (data->flags & (MODESET | DPMS)) { /* Attempting to do a vblank while disabled should return -EINVAL */ memset(&vbl, 0, sizeof(vbl)); - vbl.request.type = DRM_VBLANK_RELATIVE; + vbl.request.type = _DRM_VBLANK_RELATIVE; vbl.request.type |= kmstest_get_vbl_flag(data->pipe); igt_assert_eq(wait_vblank(fd, &vbl), -EINVAL); } @@ -477,7 +477,7 @@ static void invalid_subtest(data_t *data, int fd) /* First check all is well with a simple query */ memset(&vbl, 0, sizeof(vbl)); - vbl.request.type = DRM_VBLANK_RELATIVE; + vbl.request.type = _DRM_VBLANK_RELATIVE; igt_assert_eq(wait_vblank(fd, &vbl), 0); valid_flags = (_DRM_VBLANK_TYPES_MASK | |