[PATCH libdrm 3/3] amdgpu: A new option to run tests on render node

Alex Xie AlexBin.Xie at amd.com
Thu Jan 19 22:53:11 UTC 2017


Tested:
1. As root, tests passed on primary.
2. As root, BO export/import failed on render node as expected.
3. As non-privileged user, tests failed on primary as expected.
4. As non-privileged user, only BO export/import
   failed on render node as expected.

Signed-off-by: Alex Xie <AlexBin.Xie at amd.com>
---
 tests/amdgpu/amdgpu_test.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/tests/amdgpu/amdgpu_test.c b/tests/amdgpu/amdgpu_test.c
index 2437db4..a6f1dd1 100644
--- a/tests/amdgpu/amdgpu_test.c
+++ b/tests/amdgpu/amdgpu_test.c
@@ -109,13 +109,14 @@ static void display_test_suites(void)
 
 /** Help string for command line parameters */
 static const char usage[] =
-	"Usage: %s [-hl] [<-s <suite id>> [-t <test id>]] [-d <device_id>]\n"
+	"Usage: %s [-hlr] [<-s <suite id>> [-t <test id>]] [-d <device_id>]\n"
 	"where:\n"
 	"       l - Display all suites and their tests\n"
+	"       r - Run the tests on render node\n"
 	"       d - Choose which device to run tests\n"
 	"       h - Display this help\n";
 /** Specified options strings for getopt */
-static const char options[]   = "hls:t:d:";
+static const char options[]   = "hlrs:t:d:";
 
 /* Open AMD devices.
  * Return the number of AMD device openned.
@@ -241,6 +242,7 @@ int main(int argc, char **argv)
 	int suite_id = -1;	/* By default run everything */
 	int test_id  = -1;	/* By default run all tests in the suite */
 	int device_id = 0;	/* By default run most tests on device 0 */
+	int render_node = 0;	/* By default run most tests on primary node */
 	CU_pSuite pSuite = NULL;
 	CU_pTest  pTest  = NULL;
 
@@ -272,6 +274,9 @@ int main(int argc, char **argv)
 		case 'd':
 			device_id = atoi(optarg);
 			break;
+		case 'r':
+			render_node = 1;
+			break;
 		case '?':
 		case 'h':
 			fprintf(stderr, usage, argv[0]);
@@ -282,7 +287,7 @@ int main(int argc, char **argv)
 		}
 	}
 
-	amdgpu_open_devices(0);
+	amdgpu_open_devices(render_node);
 
 	if (drm_amdgpu[0] < 0) {
 		perror("Cannot open AMDGPU device.\n");
-- 
2.7.4



More information about the amd-gfx mailing list