[i-g-t,3/7] kms_flip: Fix warning related to i915 gem dependence
diff mbox series

Message ID 127b743d899c62b62921dffa629cfcd469390adf.1551712108.git.rodrigosiqueiramelo@gmail.com
State New
Headers show
Series
  • kms_flip: cleanups
Related show

Commit Message

Rodrigo Siqueira March 4, 2019, 3:30 p.m. UTC
In the kms_flip tests has an igt_fixture that allocates memory for i915
driver with “drm_intel_bufmgr_gem_init()”, which produces the following
warning:

 IGT-Version: 1.23-g8d81c2c2 (x86_64) (Linux: 5.0.0-rc7-VKMS-RULES+ x86_64)
 Using monotonic timestamps
 DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
 Assuming 131072kB available aperture size.
 May lead to reduced performance or incorrect rendering.
 get chip id failed: -1 [22]

This commit handles this specific dependence with the i915 driver which
make the kms_flip logs better.

Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
---
 tests/kms_flip.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Patch
diff mbox series

diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index 0d261b77..57138ec1 100755
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -1528,10 +1528,12 @@  int main(int argc, char **argv)
 		igt_install_exit_handler(kms_flip_exit_handler);
 		get_timestamp_format();
 
-		bufmgr = drm_intel_bufmgr_gem_init(drm_fd, 4096);
-		if (bufmgr) {
-			devid = intel_get_drm_devid(drm_fd);
-			batch = intel_batchbuffer_alloc(bufmgr, devid);
+		if (is_i915_device(drm_fd)) {
+			bufmgr = drm_intel_bufmgr_gem_init(drm_fd, 4096);
+			if (bufmgr) {
+				devid = intel_get_drm_devid(drm_fd);
+				batch = intel_batchbuffer_alloc(bufmgr, devid);
+			}
 		}
 	}