From patchwork Tue May 3 15:23:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9004911 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 98574BF29F for ; Tue, 3 May 2016 15:24:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0986D202C8 for ; Tue, 3 May 2016 15:23:58 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 8ADFD20270 for ; Tue, 3 May 2016 15:23:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 246C36E8E4; Tue, 3 May 2016 15:23:50 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.74]) by gabe.freedesktop.org (Postfix) with ESMTPS id 975F86E8E4 for ; Tue, 3 May 2016 15:23:48 +0000 (UTC) Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue101) with ESMTPA (Nemesis) id 0MNL1F-1b07Gw48jp-006tBl; Tue, 03 May 2016 17:23:44 +0200 From: Arnd Bergmann To: Maxime Ripard , David Airlie , Chen-Yu Tsai Subject: [PATCH] drm: sun4i: print DMA address correctly Date: Tue, 3 May 2016 17:23:28 +0200 Message-Id: <1462289020-774976-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:SQozKrh3Lpx0Hv24iTdckS1HyQqza7jaAkeKJ4vFgsAXVHpl2Vh qnD+R0i9l9NQolyuLlz4D/we7hzMJdyBi9TGlzi16jEE33tDRfNkuUlSt6NvFu5rXI2Wfza 8FrbR0vZcpENTEaTOsCPdVPbkB1nlpzXb5zvDwQXiZjAOI7cfiOTpJIjT4K02RtF/iGHUDB gTwharM9OKvVnqiuaFHKw== X-UI-Out-Filterresults: notjunk:1; V01:K0:p+p2SJiGqEs=:H7+dLUhgf5LWiyxTyq3j8f 7BX5oDtwuytqzTSQE5tqoW+KXOWtxSxfE3dg6rdHII6GBV9wL5mG8zXhyk6P72t2WZoh5RGWz xzMEJI7vwxyrtFY4uUEhJBUx0LvOnkZtahI2hHBsQpDQapbQ3L3wW+w7ecrzL8QKivxI1Suoh Dby359OX3Tg379fMz1SRNgdteSDARjy5gAdJDAOG9fUKzWaeznRKER9x8L/Oap5r+lK2ck6U/ /l/lbwiUVhlORhaTmiBHFANfUG1h87Eq18gWK76wDKHHX4BHHrCscOGRP2gzz+uuFKlr78uGZ tk4ASnLr/c8U2NWTIPD+t7nJaJsO7c92oVzXrmK75SBhsbMls/2cJ9glvgYei+/0R1FnsBRzd drtii/FfuSbiJM4gsPmlL92YZfk+7ZhTQn/mdJQzmJNtuIM0po8fr7aoY22K5tc9ezm8Sb6m6 /w3+KVqKPyF5tnuT5Lmx8T3GuuPr4a5ZOkUbSfPhN3wjnIKj6sx3Zirt6ukVV8w7yHlwWX6FS uVi6Qa1aN1XpDQOg1l4Z95nHtRGkjgUofaBkg2NpNMbJkbp1D2tyfPKyrcg7DRV3Xty7a2FBX G9devBaDeMagVikS+Eg6aoT6PC8OLtzhW0/27WFIUsrTrgOzKANe0JjzUrF6LA/WyvjKkdwT/ TwyE3HRSg23YUfv+3vxaTa/oC16SmVZoYwe96cFkMeov/aJXNeMdMZseINbb9an0+gyo= Cc: linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, Arnd Bergmann , linux-kernel@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The newly added sun4i drm driver prints a dma address using the %x format string, which cannot work when dma_addr_t is 64 bit, and gcc warns about this configuration: drm/sun4i/sun4i_backend.c: In function 'sun4i_backend_update_layer_buffer': drm/sun4i/sun4i_backend.c:193:84: error: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'dma_addr_t {aka long long unsigned int}' [-Werror=format=] DRM_DEBUG_DRIVER("Using GEM @ 0x%x\n", gem->paddr); drm/sun4i/sun4i_backend.c:201:84: error: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'dma_addr_t {aka long long unsigned int}' [-Werror=format=] DRM_DEBUG_DRIVER("Setting buffer address to 0x%x\n", paddr); This changes the code to use the explicit %pad format string, which always prints the right length. Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/sun4i/sun4i_backend.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_backend.c b/drivers/gpu/drm/sun4i/sun4i_backend.c index f7a15c1a93bf..3ab560450a82 100644 --- a/drivers/gpu/drm/sun4i/sun4i_backend.c +++ b/drivers/gpu/drm/sun4i/sun4i_backend.c @@ -190,7 +190,7 @@ int sun4i_backend_update_layer_buffer(struct sun4i_backend *backend, /* Get the physical address of the buffer in memory */ gem = drm_fb_cma_get_gem_obj(fb, 0); - DRM_DEBUG_DRIVER("Using GEM @ 0x%x\n", gem->paddr); + DRM_DEBUG_DRIVER("Using GEM @ %pad\n", &gem->paddr); /* Compute the start of the displayed memory */ bpp = drm_format_plane_cpp(fb->pixel_format, 0); @@ -198,7 +198,7 @@ int sun4i_backend_update_layer_buffer(struct sun4i_backend *backend, paddr += (state->src_x >> 16) * bpp; paddr += (state->src_y >> 16) * fb->pitches[0]; - DRM_DEBUG_DRIVER("Setting buffer address to 0x%x\n", paddr); + DRM_DEBUG_DRIVER("Setting buffer address to %pad\n", &paddr); /* Write the 32 lower bits of the address (in bits) */ lo_paddr = paddr << 3;