mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-21 14:56:18 +00:00
tests/primve_nv_test: use igt_assert for checking
... and drop the int return argument of the tests. Also: - make nv_write_i915_cpu_mmap_read functional again by dropping the goto. - add checks to i915_import_pread_pwrite Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
696c8f6434
commit
eab7a322ed
@ -84,25 +84,22 @@ static int find_and_open_devices(void)
|
|||||||
* close prime_fd,
|
* close prime_fd,
|
||||||
* unref buffers
|
* unref buffers
|
||||||
*/
|
*/
|
||||||
static int test_i915_nv_sharing(void)
|
static void test_i915_nv_sharing(void)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
drm_intel_bo *test_intel_bo;
|
drm_intel_bo *test_intel_bo;
|
||||||
int prime_fd;
|
int prime_fd;
|
||||||
struct nouveau_bo *nvbo;
|
struct nouveau_bo *nvbo;
|
||||||
|
|
||||||
test_intel_bo = drm_intel_bo_alloc(bufmgr, "test bo", BO_SIZE, 4096);
|
test_intel_bo = drm_intel_bo_alloc(bufmgr, "test bo", BO_SIZE, 4096);
|
||||||
|
igt_assert(test_intel_bo);
|
||||||
|
|
||||||
drm_intel_bo_gem_export_to_prime(test_intel_bo, &prime_fd);
|
drm_intel_bo_gem_export_to_prime(test_intel_bo, &prime_fd);
|
||||||
|
|
||||||
ret = nouveau_bo_prime_handle_ref(ndev, prime_fd, &nvbo);
|
igt_assert(nouveau_bo_prime_handle_ref(ndev, prime_fd, &nvbo) == 0);
|
||||||
close(prime_fd);
|
close(prime_fd);
|
||||||
if (ret < 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
nouveau_bo_ref(NULL, &nvbo);
|
nouveau_bo_ref(NULL, &nvbo);
|
||||||
drm_intel_bo_unreference(test_intel_bo);
|
drm_intel_bo_unreference(test_intel_bo);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -113,38 +110,30 @@ static int test_i915_nv_sharing(void)
|
|||||||
* close prime_fd,
|
* close prime_fd,
|
||||||
* unref buffers
|
* unref buffers
|
||||||
*/
|
*/
|
||||||
static int test_nv_i915_sharing(void)
|
static void test_nv_i915_sharing(void)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
drm_intel_bo *test_intel_bo;
|
drm_intel_bo *test_intel_bo;
|
||||||
int prime_fd;
|
int prime_fd;
|
||||||
struct nouveau_bo *nvbo;
|
struct nouveau_bo *nvbo;
|
||||||
|
|
||||||
ret = nouveau_bo_new(ndev, NOUVEAU_BO_GART | NOUVEAU_BO_MAP,
|
igt_assert(nouveau_bo_new(ndev, NOUVEAU_BO_GART | NOUVEAU_BO_MAP,
|
||||||
0, BO_SIZE, NULL, &nvbo);
|
0, BO_SIZE, NULL, &nvbo) == 0);
|
||||||
if (ret < 0)
|
igt_assert(nouveau_bo_set_prime(nvbo, &prime_fd) == 0);
|
||||||
return ret;
|
|
||||||
ret = nouveau_bo_set_prime(nvbo, &prime_fd);
|
|
||||||
if (ret < 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
test_intel_bo = drm_intel_bo_gem_create_from_prime(bufmgr, prime_fd, BO_SIZE);
|
test_intel_bo = drm_intel_bo_gem_create_from_prime(bufmgr, prime_fd, BO_SIZE);
|
||||||
close(prime_fd);
|
close(prime_fd);
|
||||||
if (!test_intel_bo)
|
igt_assert(test_intel_bo);
|
||||||
return -1;
|
|
||||||
|
|
||||||
nouveau_bo_ref(NULL, &nvbo);
|
nouveau_bo_ref(NULL, &nvbo);
|
||||||
drm_intel_bo_unreference(test_intel_bo);
|
drm_intel_bo_unreference(test_intel_bo);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* allocate intel, give to nouveau, map on nouveau
|
* allocate intel, give to nouveau, map on nouveau
|
||||||
* write 0xdeadbeef, non-gtt map on intel, read
|
* write 0xdeadbeef, non-gtt map on intel, read
|
||||||
*/
|
*/
|
||||||
static int test_nv_write_i915_cpu_mmap_read(void)
|
static void test_nv_write_i915_cpu_mmap_read(void)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
drm_intel_bo *test_intel_bo;
|
drm_intel_bo *test_intel_bo;
|
||||||
int prime_fd;
|
int prime_fd;
|
||||||
struct nouveau_bo *nvbo = NULL;
|
struct nouveau_bo *nvbo = NULL;
|
||||||
@ -154,46 +143,28 @@ static int test_nv_write_i915_cpu_mmap_read(void)
|
|||||||
|
|
||||||
drm_intel_bo_gem_export_to_prime(test_intel_bo, &prime_fd);
|
drm_intel_bo_gem_export_to_prime(test_intel_bo, &prime_fd);
|
||||||
|
|
||||||
ret = nouveau_bo_prime_handle_ref(ndev, prime_fd, &nvbo);
|
igt_assert(nouveau_bo_prime_handle_ref(ndev, prime_fd, &nvbo) == 0);
|
||||||
if (ret < 0) {
|
|
||||||
fprintf(stderr,"failed to ref prime buffer %d\n", ret);
|
|
||||||
close(prime_fd);
|
|
||||||
goto free_intel;
|
|
||||||
}
|
|
||||||
close(prime_fd);
|
close(prime_fd);
|
||||||
goto free_intel;
|
|
||||||
|
|
||||||
ret = nouveau_bo_map(nvbo, NOUVEAU_BO_RDWR, nclient);
|
|
||||||
if (ret < 0) {
|
|
||||||
fprintf(stderr,"failed to map nouveau bo\n");
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
igt_assert(nouveau_bo_map(nvbo, NOUVEAU_BO_RDWR, nclient) == 0);
|
||||||
ptr = nvbo->map;
|
ptr = nvbo->map;
|
||||||
*ptr = 0xdeadbeef;
|
*ptr = 0xdeadbeef;
|
||||||
|
|
||||||
drm_intel_bo_map(test_intel_bo, 1);
|
drm_intel_bo_map(test_intel_bo, 1);
|
||||||
|
|
||||||
ptr = test_intel_bo->virtual;
|
ptr = test_intel_bo->virtual;
|
||||||
|
igt_assert(ptr);
|
||||||
|
|
||||||
if (*ptr != 0xdeadbeef) {
|
igt_assert(*ptr == 0xdeadbeef);
|
||||||
fprintf(stderr,"mapped value doesn't match\n");
|
|
||||||
ret = -1;
|
|
||||||
}
|
|
||||||
out:
|
|
||||||
nouveau_bo_ref(NULL, &nvbo);
|
nouveau_bo_ref(NULL, &nvbo);
|
||||||
free_intel:
|
|
||||||
drm_intel_bo_unreference(test_intel_bo);
|
drm_intel_bo_unreference(test_intel_bo);
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* allocate intel, give to nouveau, map on nouveau
|
* allocate intel, give to nouveau, map on nouveau
|
||||||
* write 0xdeadbeef, gtt map on intel, read
|
* write 0xdeadbeef, gtt map on intel, read
|
||||||
*/
|
*/
|
||||||
static int test_nv_write_i915_gtt_mmap_read(void)
|
static void test_nv_write_i915_gtt_mmap_read(void)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
drm_intel_bo *test_intel_bo;
|
drm_intel_bo *test_intel_bo;
|
||||||
int prime_fd;
|
int prime_fd;
|
||||||
struct nouveau_bo *nvbo = NULL;
|
struct nouveau_bo *nvbo = NULL;
|
||||||
@ -203,186 +174,118 @@ static int test_nv_write_i915_gtt_mmap_read(void)
|
|||||||
|
|
||||||
drm_intel_bo_gem_export_to_prime(test_intel_bo, &prime_fd);
|
drm_intel_bo_gem_export_to_prime(test_intel_bo, &prime_fd);
|
||||||
|
|
||||||
ret = nouveau_bo_prime_handle_ref(ndev, prime_fd, &nvbo);
|
igt_assert(nouveau_bo_prime_handle_ref(ndev, prime_fd, &nvbo) == 0);
|
||||||
close(prime_fd);
|
close(prime_fd);
|
||||||
if (ret < 0) {
|
igt_assert(nouveau_bo_map(nvbo, NOUVEAU_BO_RDWR, nclient) == 0);
|
||||||
fprintf(stderr,"failed to ref prime buffer\n");
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = nouveau_bo_map(nvbo, NOUVEAU_BO_RDWR, nclient);
|
|
||||||
if (ret < 0) {
|
|
||||||
fprintf(stderr,"failed to map nouveau bo\n");
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ptr = nvbo->map;
|
ptr = nvbo->map;
|
||||||
*ptr = 0xdeadbeef;
|
*ptr = 0xdeadbeef;
|
||||||
|
|
||||||
drm_intel_gem_bo_map_gtt(test_intel_bo);
|
drm_intel_gem_bo_map_gtt(test_intel_bo);
|
||||||
ptr = test_intel_bo->virtual;
|
ptr = test_intel_bo->virtual;
|
||||||
|
igt_assert(ptr);
|
||||||
|
|
||||||
|
igt_assert(*ptr == 0xdeadbeef);
|
||||||
|
|
||||||
if (*ptr != 0xdeadbeef) {
|
|
||||||
fprintf(stderr,"mapped value doesn't match\n");
|
|
||||||
ret = -1;
|
|
||||||
}
|
|
||||||
out:
|
|
||||||
nouveau_bo_ref(NULL, &nvbo);
|
nouveau_bo_ref(NULL, &nvbo);
|
||||||
drm_intel_bo_unreference(test_intel_bo);
|
drm_intel_bo_unreference(test_intel_bo);
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* test drm_intel_bo_map doesn't work properly,
|
/* test drm_intel_bo_map doesn't work properly,
|
||||||
this tries to map the backing shmem fd, which doesn't exist
|
this tries to map the backing shmem fd, which doesn't exist
|
||||||
for these objects */
|
for these objects */
|
||||||
static int test_i915_import_cpu_mmap(void)
|
static void test_i915_import_cpu_mmap(void)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
drm_intel_bo *test_intel_bo;
|
drm_intel_bo *test_intel_bo;
|
||||||
int prime_fd;
|
int prime_fd;
|
||||||
struct nouveau_bo *nvbo;
|
struct nouveau_bo *nvbo;
|
||||||
uint32_t *ptr;
|
uint32_t *ptr;
|
||||||
|
|
||||||
ret = nouveau_bo_new(ndev, NOUVEAU_BO_GART | NOUVEAU_BO_MAP,
|
igt_assert(nouveau_bo_new(ndev, NOUVEAU_BO_GART | NOUVEAU_BO_MAP,
|
||||||
0, BO_SIZE, NULL, &nvbo);
|
0, BO_SIZE, NULL, &nvbo) == 0);
|
||||||
if (ret < 0)
|
igt_assert(nouveau_bo_set_prime(nvbo, &prime_fd) == 0);
|
||||||
return ret;
|
|
||||||
ret = nouveau_bo_set_prime(nvbo, &prime_fd);
|
|
||||||
if (ret < 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
test_intel_bo = drm_intel_bo_gem_create_from_prime(bufmgr, prime_fd, BO_SIZE);
|
test_intel_bo = drm_intel_bo_gem_create_from_prime(bufmgr, prime_fd, BO_SIZE);
|
||||||
close(prime_fd);
|
close(prime_fd);
|
||||||
if (!test_intel_bo)
|
igt_assert(test_intel_bo);
|
||||||
return -1;
|
|
||||||
|
|
||||||
ret = nouveau_bo_map(nvbo, NOUVEAU_BO_RDWR, nclient);
|
igt_assert(nouveau_bo_map(nvbo, NOUVEAU_BO_RDWR, nclient) == 0);
|
||||||
if (ret < 0) {
|
|
||||||
fprintf(stderr,"failed to map nouveau bo\n");
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
ptr = nvbo->map;
|
ptr = nvbo->map;
|
||||||
*ptr = 0xdeadbeef;
|
*ptr = 0xdeadbeef;
|
||||||
|
|
||||||
ret = drm_intel_bo_map(test_intel_bo, 0);
|
igt_assert(drm_intel_bo_map(test_intel_bo, 0) == 0);
|
||||||
if (ret != 0) {
|
igt_assert(test_intel_bo->virtual);
|
||||||
fprintf(stderr,"failed to map imported bo on intel side\n");
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
if (!test_intel_bo->virtual) {
|
|
||||||
ret = 0;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
ptr = test_intel_bo->virtual;
|
ptr = test_intel_bo->virtual;
|
||||||
|
|
||||||
if (*ptr != 0xdeadbeef) {
|
igt_assert(*ptr == 0xdeadbeef);
|
||||||
fprintf(stderr,"mapped value doesn't match %08x\n", *ptr);
|
|
||||||
ret = -1;
|
|
||||||
}
|
|
||||||
out:
|
|
||||||
nouveau_bo_ref(NULL, &nvbo);
|
nouveau_bo_ref(NULL, &nvbo);
|
||||||
drm_intel_bo_unreference(test_intel_bo);
|
drm_intel_bo_unreference(test_intel_bo);
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* test drm_intel_bo_map_gtt works properly,
|
/* test drm_intel_bo_map_gtt works properly,
|
||||||
this tries to map the backing shmem fd, which doesn't exist
|
this tries to map the backing shmem fd, which doesn't exist
|
||||||
for these objects */
|
for these objects */
|
||||||
static int test_i915_import_gtt_mmap(void)
|
static void test_i915_import_gtt_mmap(void)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
drm_intel_bo *test_intel_bo;
|
drm_intel_bo *test_intel_bo;
|
||||||
int prime_fd;
|
int prime_fd;
|
||||||
struct nouveau_bo *nvbo;
|
struct nouveau_bo *nvbo;
|
||||||
uint32_t *ptr;
|
uint32_t *ptr;
|
||||||
|
|
||||||
ret = nouveau_bo_new(ndev, NOUVEAU_BO_GART | NOUVEAU_BO_MAP,
|
igt_assert(nouveau_bo_new(ndev, NOUVEAU_BO_GART | NOUVEAU_BO_MAP,
|
||||||
0, BO_SIZE, NULL, &nvbo);
|
0, BO_SIZE, NULL, &nvbo) == 0);
|
||||||
if (ret < 0)
|
igt_assert(nouveau_bo_set_prime(nvbo, &prime_fd) == 0);
|
||||||
return ret;
|
|
||||||
ret = nouveau_bo_set_prime(nvbo, &prime_fd);
|
|
||||||
if (ret < 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
test_intel_bo = drm_intel_bo_gem_create_from_prime(bufmgr, prime_fd, BO_SIZE);
|
test_intel_bo = drm_intel_bo_gem_create_from_prime(bufmgr, prime_fd, BO_SIZE);
|
||||||
close(prime_fd);
|
close(prime_fd);
|
||||||
if (!test_intel_bo)
|
igt_assert(test_intel_bo);
|
||||||
return -1;
|
|
||||||
|
|
||||||
ret = nouveau_bo_map(nvbo, NOUVEAU_BO_RDWR, nclient);
|
igt_assert(nouveau_bo_map(nvbo, NOUVEAU_BO_RDWR, nclient) == 0);
|
||||||
if (ret < 0) {
|
|
||||||
fprintf(stderr,"failed to map nouveau bo\n");
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
ptr = nvbo->map;
|
ptr = nvbo->map;
|
||||||
*ptr = 0xdeadbeef;
|
*ptr = 0xdeadbeef;
|
||||||
*(ptr + 1) = 0xa55a55;
|
*(ptr + 1) = 0xa55a55;
|
||||||
|
|
||||||
ret = drm_intel_gem_bo_map_gtt(test_intel_bo);
|
igt_assert(drm_intel_gem_bo_map_gtt(test_intel_bo) == 0);
|
||||||
if (ret != 0) {
|
igt_assert(test_intel_bo->virtual);
|
||||||
fprintf(stderr,"failed to map bo\n");
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
if (!test_intel_bo->virtual) {
|
|
||||||
ret = -1;
|
|
||||||
fprintf(stderr,"failed to map bo\n");
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
ptr = test_intel_bo->virtual;
|
ptr = test_intel_bo->virtual;
|
||||||
|
|
||||||
if (*ptr != 0xdeadbeef) {
|
igt_assert(*ptr == 0xdeadbeef);
|
||||||
fprintf(stderr,"mapped value doesn't match %08x %08x\n", *ptr, *(ptr + 1));
|
|
||||||
ret = -1;
|
|
||||||
}
|
|
||||||
out:
|
|
||||||
nouveau_bo_ref(NULL, &nvbo);
|
nouveau_bo_ref(NULL, &nvbo);
|
||||||
drm_intel_bo_unreference(test_intel_bo);
|
drm_intel_bo_unreference(test_intel_bo);
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* test 7 - import from nouveau into intel, test pread/pwrite fail */
|
/* test 7 - import from nouveau into intel, test pread/pwrite fail */
|
||||||
static int test_i915_import_pread_pwrite(void)
|
static void test_i915_import_pread_pwrite(void)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
drm_intel_bo *test_intel_bo;
|
drm_intel_bo *test_intel_bo;
|
||||||
int prime_fd;
|
int prime_fd;
|
||||||
struct nouveau_bo *nvbo;
|
struct nouveau_bo *nvbo;
|
||||||
uint32_t *ptr;
|
uint32_t *ptr;
|
||||||
uint32_t buf[64];
|
uint32_t buf[64];
|
||||||
|
|
||||||
ret = nouveau_bo_new(ndev, NOUVEAU_BO_GART | NOUVEAU_BO_MAP,
|
igt_assert(nouveau_bo_new(ndev, NOUVEAU_BO_GART | NOUVEAU_BO_MAP,
|
||||||
0, BO_SIZE, NULL, &nvbo);
|
0, BO_SIZE, NULL, &nvbo) == 0);
|
||||||
if (ret < 0)
|
igt_assert(nouveau_bo_set_prime(nvbo, &prime_fd) == 0);
|
||||||
return ret;
|
|
||||||
ret = nouveau_bo_set_prime(nvbo, &prime_fd);
|
|
||||||
if (ret < 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
test_intel_bo = drm_intel_bo_gem_create_from_prime(bufmgr, prime_fd, BO_SIZE);
|
test_intel_bo = drm_intel_bo_gem_create_from_prime(bufmgr, prime_fd, BO_SIZE);
|
||||||
close(prime_fd);
|
close(prime_fd);
|
||||||
if (!test_intel_bo)
|
igt_assert(test_intel_bo);
|
||||||
return -1;
|
|
||||||
|
|
||||||
ret = nouveau_bo_map(nvbo, NOUVEAU_BO_RDWR, nclient);
|
igt_assert(nouveau_bo_map(nvbo, NOUVEAU_BO_RDWR, nclient) == 0);
|
||||||
if (ret < 0) {
|
|
||||||
fprintf(stderr,"failed to map nouveau bo\n");
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
ptr = nvbo->map;
|
ptr = nvbo->map;
|
||||||
*ptr = 0xdeadbeef;
|
*ptr = 0xdeadbeef;
|
||||||
|
|
||||||
gem_read(intel_fd, test_intel_bo->handle, 0, buf, 256);
|
gem_read(intel_fd, test_intel_bo->handle, 0, buf, 256);
|
||||||
|
igt_assert(buf[0] == 0xdeadbeef);
|
||||||
buf[0] = 0xabcdef55;
|
buf[0] = 0xabcdef55;
|
||||||
|
|
||||||
gem_write(intel_fd, test_intel_bo->handle, 0, buf, 4);
|
gem_write(intel_fd, test_intel_bo->handle, 0, buf, 4);
|
||||||
out:
|
|
||||||
|
igt_assert(*ptr == 0xabcdef55);
|
||||||
|
|
||||||
nouveau_bo_ref(NULL, &nvbo);
|
nouveau_bo_ref(NULL, &nvbo);
|
||||||
drm_intel_bo_unreference(test_intel_bo);
|
drm_intel_bo_unreference(test_intel_bo);
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -417,9 +320,8 @@ create_bo(drm_intel_bufmgr *ibufmgr, uint32_t val, int width, int height)
|
|||||||
|
|
||||||
/* use intel hw to fill the BO with a blit from another BO,
|
/* use intel hw to fill the BO with a blit from another BO,
|
||||||
then readback from the nouveau bo, check value is correct */
|
then readback from the nouveau bo, check value is correct */
|
||||||
static int test_i915_blt_fill_nv_read(void)
|
static void test_i915_blt_fill_nv_read(void)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
drm_intel_bo *test_intel_bo, *src_bo;
|
drm_intel_bo *test_intel_bo, *src_bo;
|
||||||
int prime_fd;
|
int prime_fd;
|
||||||
struct nouveau_bo *nvbo = NULL;
|
struct nouveau_bo *nvbo = NULL;
|
||||||
@ -431,32 +333,19 @@ static int test_i915_blt_fill_nv_read(void)
|
|||||||
|
|
||||||
drm_intel_bo_gem_export_to_prime(test_intel_bo, &prime_fd);
|
drm_intel_bo_gem_export_to_prime(test_intel_bo, &prime_fd);
|
||||||
|
|
||||||
ret = nouveau_bo_prime_handle_ref(ndev, prime_fd, &nvbo);
|
igt_assert(nouveau_bo_prime_handle_ref(ndev, prime_fd, &nvbo) == 0);
|
||||||
close(prime_fd);
|
close(prime_fd);
|
||||||
if (ret < 0) {
|
|
||||||
fprintf(stderr,"failed to ref prime buffer\n");
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
intel_copy_bo(intel_batch, test_intel_bo, src_bo, 256, 1);
|
intel_copy_bo(intel_batch, test_intel_bo, src_bo, 256, 1);
|
||||||
|
|
||||||
ret = nouveau_bo_map(nvbo, NOUVEAU_BO_RDWR, nclient);
|
igt_assert(nouveau_bo_map(nvbo, NOUVEAU_BO_RDWR, nclient) == 0);
|
||||||
if (ret < 0) {
|
|
||||||
fprintf(stderr,"failed to map nouveau bo\n");
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
drm_intel_bo_map(test_intel_bo, 0);
|
drm_intel_bo_map(test_intel_bo, 0);
|
||||||
|
|
||||||
ptr = nvbo->map;
|
ptr = nvbo->map;
|
||||||
if (*ptr != 0xaa55aa55) {
|
igt_assert(*ptr == 0xaa55aa55);
|
||||||
fprintf(stderr,"mapped value doesn't match\n");
|
|
||||||
ret = -1;
|
|
||||||
}
|
|
||||||
out:
|
|
||||||
nouveau_bo_ref(NULL, &nvbo);
|
nouveau_bo_ref(NULL, &nvbo);
|
||||||
drm_intel_bo_unreference(test_intel_bo);
|
drm_intel_bo_unreference(test_intel_bo);
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* test 8 use nouveau to do blit */
|
/* test 8 use nouveau to do blit */
|
||||||
@ -480,8 +369,8 @@ int main(int argc, char **argv)
|
|||||||
//drm_intel_bufmgr_gem_enable_reuse(bufmgr);
|
//drm_intel_bufmgr_gem_enable_reuse(bufmgr);
|
||||||
|
|
||||||
/* set up nouveau bufmgr */
|
/* set up nouveau bufmgr */
|
||||||
igt_assert(nouveau_device_wrap(nouveau_fd, 0, &ndev) >= 0);
|
igt_assert(nouveau_device_wrap(nouveau_fd, 0, &ndev) == 0);
|
||||||
igt_assert(nouveau_client_new(ndev, &nclient) >= 0);
|
igt_assert(nouveau_client_new(ndev, &nclient) == 0);
|
||||||
|
|
||||||
/* set up an intel batch buffer */
|
/* set up an intel batch buffer */
|
||||||
devid = intel_get_drm_devid(intel_fd);
|
devid = intel_get_drm_devid(intel_fd);
|
||||||
@ -490,7 +379,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
#define xtest(name) \
|
#define xtest(name) \
|
||||||
igt_subtest(#name) \
|
igt_subtest(#name) \
|
||||||
igt_assert(test_##name() == 0);
|
test_##name();
|
||||||
|
|
||||||
xtest(i915_nv_sharing);
|
xtest(i915_nv_sharing);
|
||||||
xtest(nv_i915_sharing);
|
xtest(nv_i915_sharing);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user