[igt-dev] [PATCH i-g-t 08/11] tests/kms_addfb_basic: Add invalid buffer object test for discrete

Ruhl, Michael J michael.j.ruhl at intel.com
Thu Jun 10 12:30:46 UTC 2021


>-----Original Message-----
>From: Patnana, Venkata Sai <venkata.sai.patnana at intel.com>
>Sent: Wednesday, June 9, 2021 8:18 AM
>To: igt-dev at lists.freedesktop.org
>Cc: Patnana, Venkata Sai <venkata.sai.patnana at intel.com>; Mohammed
>Khajapasha <mohammed.khajapasha at intel.com>; Latvala; Latvala, Petri
><petri.latvala at intel.com>; Ruhl, Michael J <michael.j.ruhl at intel.com>
>Subject: [PATCH i-g-t 08/11] tests/kms_addfb_basic: Add invalid buffer object
>test for discrete
>
>From: Mohammed Khajapasha <mohammed.khajapasha at intel.com>
>
>Add invalid buffer object test case for discrete, to validate
>IOCTL_MODE_ADDFB2 ioctl for LMEM, the framebuffer backing
>gem objects should be from local memory for discrete.
>
>Cc: Latvala, Petri <petri.latvala at intel.com>
>Cc: Michael J. Ruhl <michael.j.ruhl at intel.com>
>Signed-off-by: Mohammed Khajapasha
><mohammed.khajapasha at intel.com>
>---
> tests/kms_addfb_basic.c | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
>diff --git a/tests/kms_addfb_basic.c b/tests/kms_addfb_basic.c
>index 1fb18d668f..aac74a7568 100644
>--- a/tests/kms_addfb_basic.c
>+++ b/tests/kms_addfb_basic.c
>@@ -40,6 +40,7 @@
>
> #include "igt_rand.h"
> #include "igt_device.h"
>+#include "i915/intel_memory_region.h"
>
> uint32_t gem_bo;
> uint32_t gem_bo_small;
>@@ -146,6 +147,21 @@ static void invalid_tests(int fd)
> 		igt_assert(f.modifier[0] == 0);
> 	}
>
>+	igt_subtest("invalid-smem-bo-on-discrete") {
>+		int devid;
>+		uint32_t handle, stride;
>+		uint64_t size;
>+
>+		igt_require_intel(fd);
>+		devid = intel_get_drm_devid(fd);

This will only work on if the discrete card is the only card on the system.

Is there a better way to:

1) identify discrete cards and/or
2) specifically select a discrete card for testing?

Otherwise this test might never get past the next requirement.

Mike

>+		igt_require(gem_has_lmem(devid));
>+		igt_calc_fb_size(fd, f.width, f.height,
>+				DRM_FORMAT_XRGB8888, 0, &size, &stride);
>+		handle = gem_create_in_memory_regions(fd, size,
>REGION_SMEM);
>+		f.handles[0] = handle;
>+		do_ioctl_err(fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f,
>EREMOTE);
>+	}
>+
> 	igt_describe("Check if addfb2 call works for legacy formats");
> 	igt_subtest("legacy-format") {
> 		struct {
>--
>2.25.1



More information about the igt-dev mailing list