sum += ptr[i];
CU_ASSERT_EQUAL(sum, SUM_DECODE);
diff --git a/tests/amdgpu/uvd_enc_tests.c b/tests/amdgpu/uvd_enc_tests.c
index 0377c1a5d7e1b789d782..c1b840e3e56d83d0a3af 100644
--- a/tests/amdgpu/uvd_enc_tests.c
+++ b/tests/amdgpu/uvd_enc_tests.c
@@ -261,7 +261,7 @@ static void check_result(struct amdgpu_uvd_enc *enc)
uint64_t sum;
uint32_t s = 175602;
uint32_t *ptr, size;
- int j, r;
+ int r;
r = amdgpu_bo_cpu_map(enc->fb.handle, (void **)&enc->fb.ptr);
CU_ASSERT_EQUAL(r, 0);
@@ -271,7 +271,7 @@ static void check_result(struct amdgpu_uvd_enc *enc)
CU_ASSERT_EQUAL(r, 0);
r = amdgpu_bo_cpu_map(enc->bs.handle, (void **)&enc->bs.ptr);
CU_ASSERT_EQUAL(r, 0);
- for (j = 0, sum = 0; j < size; ++j)
+ for (uint32_t j = 0, sum = 0; j < size; ++j)
sum += enc->bs.ptr[j];
CU_ASSERT_EQUAL(sum, s);
r = amdgpu_bo_cpu_unmap(enc->bs.handle);
@@ -331,7 +331,7 @@ static void amdgpu_cs_uvd_enc_session_init(void)
static void amdgpu_cs_uvd_enc_encode(void)
{
- int len, r, i;
+ int len, r;
uint64_t luma_offset, chroma_offset;
uint32_t vbuf_size, bs_size = 0x003f4800, cpb_size;
unsigned align = (family_id >= AMDGPU_FAMILY_AI) ? 256 : 16;
@@ -354,11 +354,11 @@ static void amdgpu_cs_uvd_enc_encode(void)
CU_ASSERT_EQUAL(r, 0);
memset(enc.vbuf.ptr, 0, vbuf_size);
- for (i = 0; i < enc.height; ++i) {
+ for (unsigned i = 0; i < enc.height; ++i) {
memcpy(enc.vbuf.ptr, (frame + i * enc.width), enc.width);
enc.vbuf.ptr += ALIGN(enc.width, align);
}
- for (i = 0; i < enc.height / 2; ++i) {
+ for (unsigned i = 0; i < enc.height / 2; ++i) {
memcpy(enc.vbuf.ptr, ((frame + enc.height * enc.width) + i * enc.width), enc.width);
enc.vbuf.ptr += ALIGN(enc.width, align);
}
diff --git a/tests/amdgpu/vce_tests.c b/tests/amdgpu/vce_tests.c
index 75821bbb1e6c92e91fe7..6da6511793a1cf0ab488 100644
--- a/tests/amdgpu/vce_tests.c
+++ b/tests/amdgpu/vce_tests.c
@@ -425,8 +425,8 @@ static void check_result(struct amdgpu_vce_encode *enc)
{
uint64_t sum;
uint32_t s[2] = {180325, 15946};
- uint32_t *ptr, size;
- int i, j, r;
+ uint32_t *ptr, i, j, size;
+ int r;
for (i = 0; i < 2; ++i) {
r = amdgpu_bo_cpu_map(enc->fb[i].handle, (void **)&enc->fb[i].ptr);
@@ -449,7 +449,7 @@ static void amdgpu_cs_vce_encode(void)
{
uint32_t vbuf_size, bs_size = 0x154000, cpb_size;
unsigned align = (family_id >= AMDGPU_FAMILY_AI) ? 256 : 16;
- int i, r;
+ int r;
vbuf_size = ALIGN(enc.width, align) * ALIGN(enc.height, 16) * 1.5;
cpb_size = vbuf_size * 10;
@@ -472,11 +472,11 @@ static void amdgpu_cs_vce_encode(void)
CU_ASSERT_EQUAL(r, 0);
memset(enc.vbuf.ptr, 0, vbuf_size);
- for (i = 0; i < enc.height; ++i) {
+ for (unsigned i = 0; i < enc.height; ++i) {
memcpy(enc.vbuf.ptr, (frame + i * enc.width), enc.width);
enc.vbuf.ptr += ALIGN(enc.width, align);
}
- for (i = 0; i < enc.height / 2; ++i) {
+ for (unsigned i = 0; i < enc.height / 2; ++i) {
memcpy(enc.vbuf.ptr, ((frame + enc.height * enc.width) + i * enc.width), enc.width);
enc.vbuf.ptr += ALIGN(enc.width, align);
}
diff --git a/tests/amdgpu/vcn_tests.c b/tests/amdgpu/vcn_tests.c
index 2eb8c4347be094a70958..b228db609f0e0c0fefdd 100644
--- a/tests/amdgpu/vcn_tests.c
+++ b/tests/amdgpu/vcn_tests.c
@@ -239,7 +239,7 @@ static void free_resource(struct amdgpu_vcn_bo *vcn_bo)
memset(vcn_bo, 0, sizeof(*vcn_bo));
}
-static void vcn_dec_cmd(uint64_t addr, unsigned cmd, int *idx)
+static void vcn_dec_cmd(uint64_t addr, unsigned cmd, unsigned *idx)
{
ib_cpu[(*idx)++] = 0x81C4;
ib_cpu[(*idx)++] = addr;
@@ -286,7 +286,7 @@ static void amdgpu_cs_vcn_dec_decode(void)
const unsigned dpb_size = 15923584, dt_size = 737280;
uint64_t msg_addr, fb_addr, bs_addr, dpb_addr, ctx_addr, dt_addr, it_addr, sum;
struct amdgpu_vcn_bo dec_buf;
- int size, len, i, r;
+ unsigned size, len, i, r;
uint8_t *dec;
size = 4*1024; /* msg */