From patchwork Fri Jan 26 11:32:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Engestrom X-Patchwork-Id: 10185477 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3493960383 for ; Fri, 26 Jan 2018 11:33:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D2A3290F6 for ; Fri, 26 Jan 2018 11:33:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 101F02911E; Fri, 26 Jan 2018 11:33:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A26E1290F6 for ; Fri, 26 Jan 2018 11:33:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 721056E59B; Fri, 26 Jan 2018 11:33:12 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailapp01.imgtec.com (mailapp01.imgtec.com [195.59.15.196]) by gabe.freedesktop.org (Postfix) with ESMTP id A7D3A6E4E5 for ; Fri, 26 Jan 2018 11:32:58 +0000 (UTC) Received: from HHMAIL01.hh.imgtec.org (unknown [10.100.10.19]) by Forcepoint Email with ESMTPS id DC57F110D318 for ; Fri, 26 Jan 2018 11:32:53 +0000 (GMT) Received: from localhost.localdomain (10.60.4.28) by HHMAIL01.hh.imgtec.org (10.100.10.21) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 26 Jan 2018 11:32:56 +0000 From: Eric Engestrom To: Subject: [PATCH libdrm 4/7] tests/amdgpu: fix bad sign comparisons Date: Fri, 26 Jan 2018 11:32:41 +0000 Message-ID: <20180126113244.26946-4-eric.engestrom@imgtec.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180126113244.26946-1-eric.engestrom@imgtec.com> References: <20180126113244.26946-1-eric.engestrom@imgtec.com> MIME-Version: 1.0 X-Originating-IP: [10.60.4.28] X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Eric Engestrom --- tests/amdgpu/cs_tests.c | 2 +- tests/amdgpu/uvd_enc_tests.c | 10 +++++----- tests/amdgpu/vce_tests.c | 10 +++++----- tests/amdgpu/vcn_tests.c | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/amdgpu/cs_tests.c b/tests/amdgpu/cs_tests.c index a5361cd59457d039dea9..40700f53d35f3340b895 100644 --- a/tests/amdgpu/cs_tests.c +++ b/tests/amdgpu/cs_tests.c @@ -396,7 +396,7 @@ static void amdgpu_cs_uvd_decode(void) CU_ASSERT_EQUAL(r, 0); /* TODO: use a real CRC32 */ - for (i = 0, sum = 0; i < dt_size; ++i) + for (uint64_t i = 0, sum = 0; i < dt_size; ++i) 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 */