From patchwork Thu Feb 25 21:11:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 8426671 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D28649F314 for ; Thu, 25 Feb 2016 21:12:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 103B62025B for ; Thu, 25 Feb 2016 21:12:04 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 46EDE2038F for ; Thu, 25 Feb 2016 21:12:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C46286E96E; Thu, 25 Feb 2016 21:12:01 +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.73]) by gabe.freedesktop.org (Postfix) with ESMTPS id 66E9A6E96E for ; Thu, 25 Feb 2016 21:12:00 +0000 (UTC) Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue103) with ESMTPA (Nemesis) id 0M1hZS-1ZfYxs2gLS-00tkyS; Thu, 25 Feb 2016 22:11:54 +0100 From: Arnd Bergmann To: David Airlie Subject: [PATCH, RESEND] drm/sti: use u32 to store DMA addresses Date: Thu, 25 Feb 2016 22:11:42 +0100 Message-Id: <1456434711-48393-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:ClG3Nj6EEEjIljreJKP94n7QKnLLFqOa8X8l4Iow3qi4FSIp+Ci pFVbyMte2mtbVyLMjjhMg0Kvrn1t4J/MFvrB0EqdMSmYX9A7hFARefs8PYmQsK/rcfwEONx 6kehZC3/n8sLx4cr5k9N1KnKNZXIkCuGp85kcwCskw5oH7zCBfShOE7bPNtCJ8eoCx+Jxop sdftCg3lI4NHJY8KwVuqQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:rAsMcjiT/Mo=:OBW7kC3DwKl2WD6b/MOo4w xx+QV/kTf7UXALt+zjbCM+r0Dbg4aQxpDPPrtQJv0LonU9LuUgYZaR24GUPahxdGaGd6dW5BV ZsTnqvXQJWD1XFIaMs15Go3POQ2v0eKX09r3No8u4qrlxcCLoFgx85Y5kPMne6eRuThFdXI4h mUA7pkfONQC/7OAkhctUY5NlaRpghCqfLAJ32BaMeTIKk6Eatnp4VN0hT/v8eCc83e+zH/Tb5 VmwYFcPfZps3QPrp392cvqtgBJLKewHXcIf24Floi0hC5LaWuCGqMlUOCtPLi/y2Jc+wC4qhw 0EqfUj/uQYs3y23+MoRcYuaBstxMuNdMm3zLraXVzhtEeuqKq5vPKjz9UwLCVE0rvy2cmtsCj Ah9l+zOXlNVtdkJPX7BCLOtZ3ohcTmfkNeXB+y9rrh7r1idfTsvgCDf0YBDEhdFHVWs7MOKVp mi3cjY6JPsO8HAJOp+u6w28AkEBC1/n7FXEE03/6S5hs+MS7vA2BglLi2oIdGd1tRdBY7B3Gt 1lPjmH6ass6uqPtBcCPlJ5tMjI8Y9GuNy3Nb53P2KDBDcNm5ZK/Z/+wd7HlthIG66xgZ/3Wbu XApo7wmnzBTo+dySerfQF+ZLndfAmQo8B00PQAGN99b0ZE9fByFlqRcW9ja8+HdnPmM/EsoE1 EUePTwNRaXjrWG2Sin8Ls3wNPO9iKmu1lcIC4+CRqYGWUcUXdNVD5KZpoQvfDyEOuUvg= Cc: Arnd Bergmann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Benjamin Gaignard , Vincent Abriou , linux-arm-kernel@lists.infradead.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=-1.9 required=5.0 tests=BAYES_00, 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 STi drm driver correctly warns about invalid format strings when built with 64-bit dma_addr_t: sti_hqvdp.c: In function 'sti_hqvdp_vtg_cb': sti_hqvdp.c:605:119: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'dma_addr_t {aka long long unsigned int}' [-Wformat=] sti_hqvdp.c: In function 'sti_hqvdp_atomic_update': sti_hqvdp.c:931:118: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'dma_addr_t {aka long long unsigned int}' [-Wformat=] This could be changed to using the %pad format string, but that does not work when printing an rvalue, so instead I'm changing the type in the sti_hqvdp structure to u32, which is what gets written into the registers anyway. Signed-off-by: Arnd Bergmann Reviewed-by: Vincent Abriou --- drivers/gpu/drm/sti/sti_hqvdp.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) I originally submitted this on Tue, 08 Dec 2015, but got no reply, so resending the same patch now. diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c index 1d3c3d029603..7818d47bea43 100644 --- a/drivers/gpu/drm/sti/sti_hqvdp.c +++ b/drivers/gpu/drm/sti/sti_hqvdp.c @@ -349,7 +349,7 @@ struct sti_hqvdp { unsigned int curr_field_count; unsigned int last_field_count; void *hqvdp_cmd; - dma_addr_t hqvdp_cmd_paddr; + u32 hqvdp_cmd_paddr; struct sti_vtg *vtg; bool xp70_initialized; }; @@ -372,8 +372,8 @@ static const uint32_t hqvdp_supported_formats[] = { */ static int sti_hqvdp_get_free_cmd(struct sti_hqvdp *hqvdp) { - int curr_cmd, next_cmd; - dma_addr_t cmd = hqvdp->hqvdp_cmd_paddr; + u32 curr_cmd, next_cmd; + u32 cmd = hqvdp->hqvdp_cmd_paddr; int i; curr_cmd = readl(hqvdp->regs + HQVDP_MBX_CURRENT_CMD); @@ -400,8 +400,8 @@ static int sti_hqvdp_get_free_cmd(struct sti_hqvdp *hqvdp) */ static int sti_hqvdp_get_curr_cmd(struct sti_hqvdp *hqvdp) { - int curr_cmd; - dma_addr_t cmd = hqvdp->hqvdp_cmd_paddr; + u32 curr_cmd; + u32 cmd = hqvdp->hqvdp_cmd_paddr; unsigned int i; curr_cmd = readl(hqvdp->regs + HQVDP_MBX_CURRENT_CMD); @@ -612,19 +612,21 @@ int sti_hqvdp_vtg_cb(struct notifier_block *nb, unsigned long evt, void *data) static void sti_hqvdp_init(struct sti_hqvdp *hqvdp) { int size; + dma_addr_t dma_addr; hqvdp->vtg_nb.notifier_call = sti_hqvdp_vtg_cb; /* Allocate memory for the VDP commands */ size = NB_VDP_CMD * sizeof(struct sti_hqvdp_cmd); hqvdp->hqvdp_cmd = dma_alloc_wc(hqvdp->dev, size, - &hqvdp->hqvdp_cmd_paddr, + &dma_addr, GFP_KERNEL | GFP_DMA); if (!hqvdp->hqvdp_cmd) { DRM_ERROR("Failed to allocate memory for VDP cmd\n"); return; } + hqvdp->hqvdp_cmd_paddr = (u32)dma_addr; memset(hqvdp->hqvdp_cmd, 0, size); }