From patchwork Fri May 25 15:50:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10427875 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 970F16025B for ; Fri, 25 May 2018 15:56:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 83EC9288FC for ; Fri, 25 May 2018 15:56:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 779D0289AA; Fri, 25 May 2018 15:56:11 +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=-5.2 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, 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 140D0288FC for ; Fri, 25 May 2018 15:56:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3F3C56E975; Fri, 25 May 2018 15:56:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 309 seconds by postgrey-1.36 at gabe; Fri, 25 May 2018 15:56:09 UTC Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.10]) by gabe.freedesktop.org (Postfix) with ESMTPS id 274CF6E975; Fri, 25 May 2018 15:56:08 +0000 (UTC) Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPA (Nemesis) id 0LmLB4-1fw7yR1oqg-00ZvWm; Fri, 25 May 2018 17:50:53 +0200 From: Arnd Bergmann To: Oded Gabbay , Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , "David (ChunMing) Zhou" , David Airlie Subject: [PATCH 2/8] drm/amdgpu: fix 32-bit build warning Date: Fri, 25 May 2018 17:50:09 +0200 Message-Id: <20180525155030.3667352-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180525155030.3667352-1-arnd@arndb.de> References: <20180525155030.3667352-1-arnd@arndb.de> X-Provags-ID: V03:K1:tLTWrYXK1XmFzZLwisy/MzqQOimKFZ/gBKSKdg92DpoZEKoM3d6 taKR1iy1GFRGryEPMWpUBJeb65etS2e2S5yQ7BkZTsOj8GUYkNfPVlaoMmngou1h3FM9e3X Vug1UAWFHUD8h//gmV9DvaI5zH6u4Mc4TNcSVbicSNsntGJKNzWStqD9Q5pqfJzWF4cB4u2 jPcLUOMUphxjvEKM0ACjw== X-UI-Out-Filterresults: notjunk:1; V01:K0:aYHSL3Dksp0=:6YC2t+srTMUV2gn0eevhr3 JKEhzB0HOo+Luem92gjug7F434CdyYsjJJyMHtm6PQV5VVlqFCn8EYRj6nQ+PrSpoauZSw+Si OzTVwpjdXCflHCJPwZXtboUnhbTAvSr2NZLd15wAQcbXmi4raoJlrz9Gg9G6R2B8YC2NfdV7u 3btV850HZ4MtWUmuYUfP1WAd5AOKOvazZI+UhWgbVRJouFhp4ftSv2LMfog8i9x8c/XQ33c3x skMI9uJpTavngbHwd/EwBpAsCj3f5Vp+wYmIulbhlMX2HqD/Awy51mGocvpxeH+yLVhjCvAFM vC9j7+764Zq5oYzOAnx4E/iRfgBZPRbygdAsGukeWwZoZk3KOLVfj/W7gB/vty2zlg5xAav+H JI8Pv6V5XP6XL7cdatujSdH6W4MYyPjZ74a/1DTJqD6nWVmn36P7DkcViNmSA57zntu9o7fkb tphfdbbalXQmJxMgrAlw4dFP6NQQTXYEWFSsgP3d7QBhWwcHun/JAFFPkYrvc87A69Z/Z9xbU NuuShRp12L5NmARsqSuLcxHQXf/PPvhdyNn3iysFe1YBBM6cjK1R+N4EV3IFkRtnG9BZCcui3 Mb3TmggPP0ozQgCjInk5+zfCCdDy2t5SVIRhUpEbm5FC8m/WFGN1UoIrFOKzPgw4pDLNP2LhQ PDLhKnVNZmNR8OwGYYkuROw8coprbtwpyowWnYB2INw/4o0L2Q1m8dBw4iOtvteMiVsY= 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: , Cc: amd-gfx@lists.freedesktop.org, Arnd Bergmann , Felix Kuehling , Harish Kasiviswanathan , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Andres Rodriguez , Colin Ian King , Kent Russell MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Casting a pointer to a 64-bit type causes a warning on 32-bit targets: drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c:473:24: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] lower_32_bits((uint64_t)wptr)); ^ drivers/gpu/drm/amd/amdgpu/amdgpu.h:1701:53: note: in definition of macro 'WREG32' #define WREG32(reg, v) amdgpu_mm_wreg(adev, (reg), (v), 0) ^ drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c:473:10: note: in expansion of macro 'lower_32_bits' lower_32_bits((uint64_t)wptr)); ^~~~~~~~~~~~~ The correct method is to cast to 'uintptr_t'. Fixes: d5a114a6c5f7 ("drm/amdgpu: Add GFXv9 kfd2kgd interface functions") Signed-off-by: Arnd Bergmann Reviewed-by: Oded Gabbay --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c index 8f37991df61b..f0c0d3953f69 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c @@ -470,9 +470,9 @@ static int kgd_hqd_load(struct kgd_dev *kgd, void *mqd, uint32_t pipe_id, WREG32(SOC15_REG_OFFSET(GC, 0, mmCP_HQD_PQ_WPTR_HI), upper_32_bits(guessed_wptr)); WREG32(SOC15_REG_OFFSET(GC, 0, mmCP_HQD_PQ_WPTR_POLL_ADDR), - lower_32_bits((uint64_t)wptr)); + lower_32_bits((uintptr_t)wptr)); WREG32(SOC15_REG_OFFSET(GC, 0, mmCP_HQD_PQ_WPTR_POLL_ADDR_HI), - upper_32_bits((uint64_t)wptr)); + upper_32_bits((uintptr_t)wptr)); WREG32(SOC15_REG_OFFSET(GC, 0, mmCP_PQ_WPTR_POLL_CNTL1), get_queue_mask(adev, pipe_id, queue_id)); }