@@ -415,6 +415,18 @@ void gem_sync(int fd, uint32_t handle)
errno = 0;
}
+/* Is the Intel RST device present */
+#define RST_PATH "/sys/bus/acpi/devices/INT3392:00"
+
+static bool is_rst_present(void)
+{
+ struct stat st;
+
+ if (stat(RST_PATH, &st) == 0)
+ return true;
+
+ return false;
+}
bool gem_create__has_stolen_support(int fd)
{
@@ -429,7 +441,7 @@ bool gem_create__has_stolen_support(int fd)
/* Do we have the extended gem_create_ioctl? */
ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp);
- has_stolen_support = val >= 2;
+ has_stolen_support = val >= 2 && !is_rst_present();
}
return has_stolen_support;
@@ -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,
@@ -206,6 +206,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;
@@ -222,6 +223,7 @@ int main(int argc, char **argv)
}
for (c = cache; c->level != -1; c++) {
+ gem_require_stolen_support(fd);
igt_subtest_f("stolen-%s", c->name) {
gem_set_caching(fd, dst, c->level);
for (count = 1; count <= 1<<17; count <<= 1) {