mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-12 02:16:17 +00:00
tests/prime_nv_api: convert to subtest infrastructure
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
b37d89318d
commit
c28b898cd4
@ -10,9 +10,9 @@ noinst_PROGRAMS = \
|
|||||||
if HAVE_NOUVEAU
|
if HAVE_NOUVEAU
|
||||||
NOUVEAU_TESTS_M = \
|
NOUVEAU_TESTS_M = \
|
||||||
prime_nv_test \
|
prime_nv_test \
|
||||||
prime_nv_pcopy
|
prime_nv_pcopy \
|
||||||
NOUVEAU_TESTS = \
|
prime_nv_api \
|
||||||
prime_nv_api
|
$(NULL)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
TESTS_progs_M = \
|
TESTS_progs_M = \
|
||||||
@ -105,7 +105,6 @@ TESTS_progs = \
|
|||||||
gem_ctx_basic \
|
gem_ctx_basic \
|
||||||
gem_reg_read \
|
gem_reg_read \
|
||||||
gem_tiling_max_stride \
|
gem_tiling_max_stride \
|
||||||
$(NOUVEAU_TESTS) \
|
|
||||||
prime_udl \
|
prime_udl \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
#include "nouveau.h"
|
#include "nouveau.h"
|
||||||
#include "intel_gpu_tools.h"
|
#include "intel_gpu_tools.h"
|
||||||
#include "intel_batchbuffer.h"
|
#include "intel_batchbuffer.h"
|
||||||
|
#include "drmtest.h"
|
||||||
|
|
||||||
#define BO_SIZE (256*1024)
|
#define BO_SIZE (256*1024)
|
||||||
|
|
||||||
@ -316,13 +317,16 @@ int main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
drmtest_subtest_init(argc, argv);
|
||||||
|
|
||||||
ret = find_and_open_devices();
|
ret = find_and_open_devices();
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if (nouveau_fd == -1 || intel_fd == -1 || nouveau_fd2 == -1 || intel_fd2 == -1) {
|
if (nouveau_fd == -1 || intel_fd == -1 || nouveau_fd2 == -1 || intel_fd2 == -1) {
|
||||||
fprintf(stderr,"failed to find intel and nouveau GPU\n");
|
fprintf(stderr,"failed to find intel and nouveau GPU\n");
|
||||||
return 77;
|
if (!drmtest_only_list_subtests())
|
||||||
|
return 77;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set up intel bufmgr */
|
/* set up intel bufmgr */
|
||||||
@ -341,7 +345,7 @@ int main(int argc, char **argv)
|
|||||||
ret = nouveau_device_wrap(nouveau_fd, 0, &ndev);
|
ret = nouveau_device_wrap(nouveau_fd, 0, &ndev);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
fprintf(stderr,"failed to wrap nouveau device\n");
|
fprintf(stderr,"failed to wrap nouveau device\n");
|
||||||
return 77;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = nouveau_client_new(ndev, &nclient);
|
ret = nouveau_client_new(ndev, &nclient);
|
||||||
@ -354,7 +358,7 @@ int main(int argc, char **argv)
|
|||||||
ret = nouveau_device_wrap(nouveau_fd2, 0, &ndev2);
|
ret = nouveau_device_wrap(nouveau_fd2, 0, &ndev2);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
fprintf(stderr,"failed to wrap nouveau device\n");
|
fprintf(stderr,"failed to wrap nouveau device\n");
|
||||||
return 77;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = nouveau_client_new(ndev2, &nclient2);
|
ret = nouveau_client_new(ndev2, &nclient2);
|
||||||
@ -367,37 +371,37 @@ int main(int argc, char **argv)
|
|||||||
devid = intel_get_drm_devid(intel_fd);
|
devid = intel_get_drm_devid(intel_fd);
|
||||||
intel_batch = intel_batchbuffer_alloc(bufmgr, devid);
|
intel_batch = intel_batchbuffer_alloc(bufmgr, devid);
|
||||||
|
|
||||||
ret = test1();
|
if (drmtest_run_subtest("test1"))
|
||||||
if (ret)
|
if (test1())
|
||||||
fprintf(stderr,"prime_test: failed test 1\n");
|
exit(2);
|
||||||
|
|
||||||
ret = test2();
|
if (drmtest_run_subtest("test2"))
|
||||||
if (ret)
|
if (test2())
|
||||||
fprintf(stderr,"prime_test: failed test 2\n");
|
exit(2);
|
||||||
|
|
||||||
ret = test3();
|
if (drmtest_run_subtest("test3"))
|
||||||
if (ret)
|
if (test3())
|
||||||
fprintf(stderr,"prime_test: failed test 3\n");
|
exit(2);
|
||||||
|
|
||||||
ret = test4();
|
if (drmtest_run_subtest("test4"))
|
||||||
if (ret)
|
if (test4())
|
||||||
fprintf(stderr,"prime_test: failed test 4\n");
|
exit(2);
|
||||||
|
|
||||||
ret = test5();
|
if (drmtest_run_subtest("test5"))
|
||||||
if (ret)
|
if (test5())
|
||||||
fprintf(stderr,"prime_test: failed test 5\n");
|
exit(2);
|
||||||
|
|
||||||
ret = test6();
|
if (drmtest_run_subtest("test6"))
|
||||||
if (ret)
|
if (test6())
|
||||||
fprintf(stderr,"prime_test: failed test 6\n");
|
exit(2);
|
||||||
|
|
||||||
ret = test7();
|
if (drmtest_run_subtest("test7"))
|
||||||
if (ret)
|
if (test7())
|
||||||
fprintf(stderr,"prime_test: failed test 7\n");
|
exit(2);
|
||||||
|
|
||||||
ret = test8();
|
if (drmtest_run_subtest("test8"))
|
||||||
if (ret)
|
if (test8())
|
||||||
fprintf(stderr,"prime_test: failed test 8\n");
|
exit(2);
|
||||||
|
|
||||||
intel_batchbuffer_free(intel_batch);
|
intel_batchbuffer_free(intel_batch);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user