aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-02-18 21:23:48 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-02-18 21:23:48 +0000
commitcb3381988ec1617f3d794162410c54bc5521a8ed (patch)
tree23e4915f3b1237a3fe92b38d30b88256aa19d6d6
parent568026fe4b41450fa83b1775795211faf7afc3fd (diff)
parent0fc49f27d0d1aa7dfb81c8f1c0b085ce7810d515 (diff)
downloadplatform_external_igt-gpu-tools-cb3381988ec1617f3d794162410c54bc5521a8ed.tar.gz
platform_external_igt-gpu-tools-cb3381988ec1617f3d794162410c54bc5521a8ed.tar.bz2
platform_external_igt-gpu-tools-cb3381988ec1617f3d794162410c54bc5521a8ed.zip
igt-gpu-tools: build kms_vblank test am: d711f57018 am: 423d2e3ba4 am: 0fc49f27d0android-mainline-11.0.0_r9android-mainline-11.0.0_r8android-mainline-11.0.0_r7android-mainline-11.0.0_r6android-mainline-11.0.0_r5android-mainline-11.0.0_r44android-mainline-11.0.0_r43android-mainline-11.0.0_r42android-mainline-11.0.0_r41android-mainline-11.0.0_r40android-mainline-11.0.0_r4android-mainline-11.0.0_r39android-mainline-11.0.0_r38android-mainline-11.0.0_r37android-mainline-11.0.0_r36android-mainline-11.0.0_r35android-mainline-11.0.0_r34android-mainline-11.0.0_r33android-mainline-11.0.0_r32android-mainline-11.0.0_r31android-mainline-11.0.0_r30android-mainline-11.0.0_r3android-mainline-11.0.0_r29android-mainline-11.0.0_r28android-mainline-11.0.0_r27android-mainline-11.0.0_r26android-mainline-11.0.0_r25android-mainline-11.0.0_r24android-mainline-11.0.0_r23android-mainline-11.0.0_r22android-mainline-11.0.0_r21android-mainline-11.0.0_r20android-mainline-11.0.0_r2android-mainline-11.0.0_r19android-mainline-11.0.0_r18android-mainline-11.0.0_r17android-mainline-11.0.0_r16android-mainline-11.0.0_r15android-mainline-11.0.0_r14android-mainline-11.0.0_r13android-mainline-11.0.0_r12android-mainline-11.0.0_r10android-mainline-11.0.0_r1android-11.0.0_r45android-11.0.0_r44android-11.0.0_r43android-11.0.0_r42android-11.0.0_r41android-11.0.0_r40android-11.0.0_r39android-11.0.0_r38android-11.0.0_r37android-11.0.0_r36android-11.0.0_r35android-11.0.0_r34android-11.0.0_r33android-11.0.0_r32android-11.0.0_r31android-11.0.0_r30android-11.0.0_r29android-11.0.0_r28android-11.0.0_r27android-11.0.0_r26android-11.0.0_r24android-11.0.0_r23android-11.0.0_r22android-11.0.0_r21android-11.0.0_r20android-11.0.0_r19android-11.0.0_r18android-11.0.0_r16android11-qpr3-s1-releaseandroid11-qpr3-releaseandroid11-qpr2-releaseandroid11-qpr1-s2-releaseandroid11-qpr1-s1-releaseandroid11-qpr1-releaseandroid11-qpr1-d-s1-releaseandroid11-qpr1-d-releaseandroid11-qpr1-c-releaseandroid11-mainline-tethering-releaseandroid11-mainline-sparse-2021-jan-releaseandroid11-mainline-sparse-2020-dec-releaseandroid11-mainline-releaseandroid11-mainline-permission-releaseandroid11-mainline-os-statsd-releaseandroid11-mainline-networkstack-releaseandroid11-mainline-media-swcodec-releaseandroid11-mainline-media-releaseandroid11-mainline-extservices-releaseandroid11-mainline-documentsui-releaseandroid11-mainline-conscrypt-releaseandroid11-mainline-cellbroadcast-releaseandroid11-mainline-captiveportallogin-releaseandroid11-devandroid11-d2-releaseandroid11-d1-b-release
Change-Id: Iea522cf85f5841c8c63ed48205dc4e635e9209ba
-rw-r--r--Android.bp8
-rw-r--r--lib/igt_dummy.c49
-rw-r--r--tests/kms_vblank.c20
3 files changed, 67 insertions, 10 deletions
diff --git a/Android.bp b/Android.bp
index 8247b849..477efe2e 100644
--- a/Android.bp
+++ b/Android.bp
@@ -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 |