drm/tests/amdgpu: fix Metadata test failed issue

The unit of size_metadata is one byte not four bytes.
Enable Metadata test.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
main
Lang Yu 2021-03-24 12:18:41 +08:00 committed by Marek Olšák
parent 6d821612d9
commit af871ec1a6
2 changed files with 2 additions and 5 deletions

View File

@ -496,9 +496,6 @@ static void amdgpu_disable_suites()
"gfx ring slow bad draw test (set amdgpu.lockup_timeout=50)", CU_FALSE)) "gfx ring slow bad draw test (set amdgpu.lockup_timeout=50)", CU_FALSE))
fprintf(stderr, "test deactivation failed - %s\n", CU_get_error_msg()); fprintf(stderr, "test deactivation failed - %s\n", CU_get_error_msg());
if (amdgpu_set_test_active(BO_TESTS_STR, "Metadata", CU_FALSE))
fprintf(stderr, "test deactivation failed - %s\n", CU_get_error_msg());
if (amdgpu_set_test_active(BASIC_TESTS_STR, "bo eviction Test", CU_FALSE)) if (amdgpu_set_test_active(BASIC_TESTS_STR, "bo eviction Test", CU_FALSE))
fprintf(stderr, "test deactivation failed - %s\n", CU_get_error_msg()); fprintf(stderr, "test deactivation failed - %s\n", CU_get_error_msg());

View File

@ -168,7 +168,7 @@ static void amdgpu_bo_metadata(void)
struct amdgpu_bo_info info = {0}; struct amdgpu_bo_info info = {0};
int r; int r;
meta.size_metadata = 1; meta.size_metadata = 4;
meta.umd_metadata[0] = 0xdeadbeef; meta.umd_metadata[0] = 0xdeadbeef;
r = amdgpu_bo_set_metadata(buffer_handle, &meta); r = amdgpu_bo_set_metadata(buffer_handle, &meta);
@ -177,7 +177,7 @@ static void amdgpu_bo_metadata(void)
r = amdgpu_bo_query_info(buffer_handle, &info); r = amdgpu_bo_query_info(buffer_handle, &info);
CU_ASSERT_EQUAL(r, 0); CU_ASSERT_EQUAL(r, 0);
CU_ASSERT_EQUAL(info.metadata.size_metadata, 1); CU_ASSERT_EQUAL(info.metadata.size_metadata, 4);
CU_ASSERT_EQUAL(info.metadata.umd_metadata[0], 0xdeadbeef); CU_ASSERT_EQUAL(info.metadata.umd_metadata[0], 0xdeadbeef);
} }