summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAnkitprasad Sharma <ankitprasad.r.sharma@intel.com>2016-06-06 14:52:42 +0530
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>2016-06-07 15:03:37 +0100
commitbeef31a02679a914e2c101e60308511d396201fc (patch)
tree53ea7a853465404bf92545a349027f938d72797a /tests
parent293aa16a12f9e553c0dd767addd27d34c4739b39 (diff)
igt/gem_stolen: Check for available stolen memory size
Check for available stolen memory size before attempting to run the stolen memory tests. This way we make sure that we do not create objects from stolen memory without knowing the available size. This checks if the kernel supports creation of stolen backed objects before doing any operation on stolen backed objects. Also correcting the CREATE_VERSION ioctl number in getparam ioctl, due to kernel changes added in between. v2: Removed size argument for checking stolen memory availability (Tvrtko) Signed-off-by: Ankitprasad Sharma <ankitprasad.r.sharma@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/gem_pread.c3
-rw-r--r--tests/gem_pwrite.c2
2 files changed, 5 insertions, 0 deletions
diff --git a/tests/gem_pread.c b/tests/gem_pread.c
index afa072d3..f4cf472c 100644
--- a/tests/gem_pread.c
+++ b/tests/gem_pread.c
@@ -152,6 +152,7 @@ int main(int argc, char **argv)
}
igt_subtest("stolen-normal") {
+ gem_require_stolen_support(fd);
for (count = 1; count <= 1<<17; count <<= 1) {
struct timeval start, end;
@@ -167,6 +168,7 @@ int main(int argc, char **argv)
}
for (c = cache; c->level != -1; c++) {
igt_subtest_f("stolen-%s", c->name) {
+ gem_require_stolen_support(fd);
gem_set_caching(fd, src_stolen, c->level);
for (count = 1; count <= 1<<17; count <<= 1) {
@@ -190,6 +192,7 @@ int main(int argc, char **argv)
* user space buffer
*/
igt_subtest("pagefault-pread") {
+ gem_require_stolen_support(fd);
large_stolen = gem_create_stolen(fd, LARGE_OBJECT_SIZE);
stolen_nopf_user = (uint32_t *) mmap(NULL, LARGE_OBJECT_SIZE,
PROT_WRITE,
diff --git a/tests/gem_pwrite.c b/tests/gem_pwrite.c
index a322f918..8db5454c 100644
--- a/tests/gem_pwrite.c
+++ b/tests/gem_pwrite.c
@@ -280,6 +280,7 @@ int main(int argc, char **argv)
}
igt_subtest("stolen-normal") {
+ gem_require_stolen_support(fd);
for (count = 1; count <= 1<<17; count <<= 1) {
struct timeval start, end;
@@ -297,6 +298,7 @@ int main(int argc, char **argv)
for (c = cache; c->level != -1; c++) {
igt_subtest_f("stolen-%s", c->name) {
+ gem_require_stolen_support(fd);
gem_set_caching(fd, dst, c->level);
for (count = 1; count <= 1<<17; count <<= 1) {
struct timeval start, end;