From patchwork Fri Apr 20 16:07:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10353135 X-Patchwork-Delegate: agross@codeaurora.org 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 55F6D60365 for ; Fri, 20 Apr 2018 16:07:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 46374287AA for ; Fri, 20 Apr 2018 16:07:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3AA55287C5; Fri, 20 Apr 2018 16:07:24 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F3EE287AA for ; Fri, 20 Apr 2018 16:07:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755733AbeDTQHW (ORCPT ); Fri, 20 Apr 2018 12:07:22 -0400 Received: from mail-yb0-f193.google.com ([209.85.213.193]:34193 "EHLO mail-yb0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755655AbeDTQHV (ORCPT ); Fri, 20 Apr 2018 12:07:21 -0400 Received: by mail-yb0-f193.google.com with SMTP id b14-v6so3195147ybk.1 for ; Fri, 20 Apr 2018 09:07:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=YNUuJo/KhbwB8fXZO1wEuGMJgaUhKfKsEaEu1h9vQ4M=; b=THMkH99vfgv1o6MNy94cKVBFqcjc4GJI3MfXwvzjm39+HpBhGZjfCV8JZgiJrXaWnc tLoYCCo0zGQNvE4BMyrhefG+cYZzuj6q53QwgUSkfNF00i/++qBP1pYXciZ/1AOnUXkj QgTCNuPkK5TxX9CF+fnVlSEm3/Yg31GxCqdac= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=YNUuJo/KhbwB8fXZO1wEuGMJgaUhKfKsEaEu1h9vQ4M=; b=LCEIpimkSYVMKQG1UBuCsMEYQ4Ql1mONSMbVEfm+/qE8jYmt3NM4x+VhOR/Z1NRbiR F1iHjfXHvKeCwcwYJ92gwwdAuSyunpET+/4GIstqFEZdJcUt3IqE6RN3PCtOMydfh2YE tChM+B+tQmVPnzMBSnyeNILCRJ9aJ6cKnuFLDpPEnECDTAupxDoMKF0mlPdQdKf9yVHw 301TygYNDSpTBWug30h/lSmNATx1a+Tyfkr8YVYStlqZ6364UdDOxW6xXBHIyvTlKwl4 EfJ4GK2cAWiBBYXxzpXlrL3w0qLh8tfTTRf6h4NuRgDNkTyEkgDLCs3qut+yH9VGMz8E lZsA== X-Gm-Message-State: ALQs6tDI9Li07SoAus41GP2pbstr2kAE+Cutmsxnbi4Begfn47y8MofF 2NAR3USKRxE3jCXr5FZ9MOZoMg== X-Google-Smtp-Source: AIpwx48wN+qoRe85YGA1Zv6KakJgFYV27LCeZAT53iS6bV4qjTR9P9chewkEz5iClXlzWkgKyXVaMQ== X-Received: by 2002:a25:910c:: with SMTP id v12-v6mr2999993ybl.413.1524240441071; Fri, 20 Apr 2018 09:07:21 -0700 (PDT) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:ad55:b1db:adfe:3b9f]) by smtp.gmail.com with ESMTPSA id p4-v6sm2614585ywb.47.2018.04.20.09.07.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Apr 2018 09:07:20 -0700 (PDT) From: Sean Paul To: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org Cc: robdclark@gmail.com, hoegsberg@chromium.org, jsanka@codeaurora.org, abhinavk@codeaurora.org, Sean Paul Subject: [DPU PATCH] drm/msm: dpu: Fix build warnings Date: Fri, 20 Apr 2018 12:07:19 -0400 Message-Id: <20180420160719.54461-1-seanpaul@chromium.org> X-Mailer: git-send-email 2.17.0.484.g0c8726318c-goog Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Sean Paul Reviewed-by: Abhinav Kumar Reviewed-by: Jeykumar Sankaran --- .../gpu/drm/msm/disp/dpu1/dpu_color_processing.c | 5 +++-- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 4 ++-- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_reg_dma_v1.c | 14 +++++++------- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 9 +++++---- drivers/gpu/drm/msm/dpu_dbg.c | 14 ++++++++------ drivers/gpu/drm/msm/dsi/dsi_manager.c | 2 +- 6 files changed, 26 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_color_processing.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_color_processing.c index c6fc0a28d76f..f13d1cc8f635 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_color_processing.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_color_processing.c @@ -244,7 +244,8 @@ static int dpu_cp_handle_range_property(struct dpu_cp_node *prop_node, return 0; } - ret = copy_from_user(blob_ptr->data, (void *)val, blob_ptr->length); + ret = copy_from_user(blob_ptr->data, u64_to_user_ptr(val), + blob_ptr->length); if (ret) { DRM_ERROR("failed to get the property info ret %d", ret); ret = -EFAULT; @@ -910,7 +911,7 @@ int dpu_cp_crtc_set_property(struct drm_crtc *crtc, */ if (!dpu_crtc->num_mixers || dpu_crtc->num_mixers > ARRAY_SIZE(dpu_crtc->mixers)) { - DRM_ERROR("Invalid mixer config act cnt %d max cnt %ld\n", + DRM_ERROR("Invalid mixer config act cnt %d max cnt %zd\n", dpu_crtc->num_mixers, ARRAY_SIZE(dpu_crtc->mixers)); return -EINVAL; } diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c index 631ba7ebf596..f7ac9c85c336 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c @@ -3366,11 +3366,11 @@ static int dpu_crtc_atomic_set_property(struct drm_crtc *crtc, switch (idx) { case CRTC_PROP_DIM_LAYER_V1: _dpu_crtc_set_dim_layer_v1(cstate, - (void __user *)val); + u64_to_user_ptr(val)); break; case CRTC_PROP_DEST_SCALER: ret = _dpu_crtc_set_dest_scaler(dpu_crtc, - cstate, (void __user *)val); + cstate, u64_to_user_ptr(val)); break; case CRTC_PROP_DEST_SCALER_LUT_ED: case CRTC_PROP_DEST_SCALER_LUT_CIR: diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_reg_dma_v1.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_reg_dma_v1.c index e0d46c545c14..7c2772f7219f 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_reg_dma_v1.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_reg_dma_v1.c @@ -171,7 +171,7 @@ static void get_decode_sel(unsigned long blk, u32 *decode_sel) *decode_sel |= BIT(21); break; default: - DRM_ERROR("block not supported %zx\n", BIT(i)); + DRM_ERROR("block not supported %lx\n", BIT(i)); break; } } @@ -275,7 +275,7 @@ static int validate_write_multi_lut_reg(struct dpu_reg_dma_setup_ops_cfg *cfg) return rc; if (cfg->wrap_size < WRAP_MIN_SIZE || cfg->wrap_size > WRAP_MAX_SIZE) { - DRM_ERROR("invalid wrap sz %d min %d max %zd\n", + DRM_ERROR("invalid wrap sz %d min %d max %ld\n", cfg->wrap_size, WRAP_MIN_SIZE, WRAP_MAX_SIZE); rc = -EINVAL; } @@ -302,7 +302,7 @@ static int validate_write_reg(struct dpu_reg_dma_setup_ops_cfg *cfg) } if ((SIZE_DWORD(cfg->data_size)) > MAX_DWORDS_SZ || NOT_WORD_ALIGNED(cfg->data_size)) { - DRM_ERROR("Invalid data size %d max %zd align %x\n", + DRM_ERROR("Invalid data size %d max %ld align %x\n", cfg->data_size, MAX_DWORDS_SZ, NOT_WORD_ALIGNED(cfg->data_size)); return -EINVAL; @@ -310,7 +310,7 @@ static int validate_write_reg(struct dpu_reg_dma_setup_ops_cfg *cfg) if (cfg->blk_offset > MAX_RELATIVE_OFF || NOT_WORD_ALIGNED(cfg->blk_offset)) { - DRM_ERROR("invalid offset %d max %zd align %x\n", + DRM_ERROR("invalid offset %d max %ld align %x\n", cfg->blk_offset, MAX_RELATIVE_OFF, NOT_WORD_ALIGNED(cfg->blk_offset)); return -EINVAL; @@ -374,7 +374,7 @@ static int validate_dma_cfg(struct dpu_reg_dma_setup_ops_cfg *cfg) } if (cfg->dma_buf->iova & GUARD_BYTES || !cfg->dma_buf->vaddr) { - DRM_ERROR("iova not aligned to %zx iova %llx kva %pK", + DRM_ERROR("iova not aligned to %lx iova %llx kva %pK", ADDR_ALIGN, cfg->dma_buf->iova, cfg->dma_buf->vaddr); return -EINVAL; @@ -433,7 +433,7 @@ static int validate_kick_off_v1(struct dpu_reg_dma_kickoff_cfg *cfg) (WRITE_TRIGGER); if (cfg->dma_buf->iova & GUARD_BYTES) { - DRM_ERROR("Address is not aligned to %zx iova %llx", ADDR_ALIGN, + DRM_ERROR("Address is not aligned to %lx iova %llx", ADDR_ALIGN, cfg->dma_buf->iova); return -EINVAL; } @@ -445,7 +445,7 @@ static int validate_kick_off_v1(struct dpu_reg_dma_kickoff_cfg *cfg) if (SIZE_DWORD(cfg->dma_buf->index) > MAX_DWORDS_SZ || !cfg->dma_buf->index) { - DRM_ERROR("invalid dword size %zd max %zd\n", + DRM_ERROR("invalid dword size %zd max %ld\n", SIZE_DWORD(cfg->dma_buf->index), MAX_DWORDS_SZ); return -EINVAL; } diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c index e5051b9920a7..d87f752f786a 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c @@ -2641,19 +2641,20 @@ static int dpu_plane_atomic_set_property(struct drm_plane *plane, property); switch (idx) { case PLANE_PROP_CSC_V1: - _dpu_plane_set_csc_v1(pdpu, (void *)val); + _dpu_plane_set_csc_v1(pdpu, + u64_to_user_ptr(val)); break; case PLANE_PROP_SCALER_V1: _dpu_plane_set_scaler_v1(pdpu, pstate, - (void *)val); + u64_to_user_ptr(val)); break; case PLANE_PROP_SCALER_V2: _dpu_plane_set_scaler_v2(pdpu, pstate, - (void *)val); + u64_to_user_ptr(val)); break; case PLANE_PROP_EXCL_RECT_V1: _dpu_plane_set_excl_rect_v1(pdpu, pstate, - (void *)val); + u64_to_user_ptr(val)); break; default: /* nothing to do */ diff --git a/drivers/gpu/drm/msm/dpu_dbg.c b/drivers/gpu/drm/msm/dpu_dbg.c index 341b5964ca18..54ea631ee6b3 100644 --- a/drivers/gpu/drm/msm/dpu_dbg.c +++ b/drivers/gpu/drm/msm/dpu_dbg.c @@ -2048,8 +2048,9 @@ static void _dpu_dump_reg(const char *dump_name, u32 reg_dump_flag, return; if (in_log) - dev_info(dpu_dbg_base.dev, "%s: start_offset 0x%lx len 0x%zx\n", - dump_name, addr - base_addr, len_bytes); + dev_info(dpu_dbg_base.dev, "%s: start_offset %p len 0x%zx\n", + dump_name, (void*)(addr - base_addr), + len_bytes); len_align = (len_bytes + REG_DUMP_ALIGN - 1) / REG_DUMP_ALIGN; len_padded = len_align * REG_DUMP_ALIGN; @@ -2065,9 +2066,9 @@ static void _dpu_dump_reg(const char *dump_name, u32 reg_dump_flag, if (dump_mem && *dump_mem) { dump_addr = *dump_mem; dev_info(dpu_dbg_base.dev, - "%s: start_addr:0x%pK len:0x%x reg_offset=0x%lx\n", + "%s: start_addr:0x%pK len:0x%x reg_offset=%p\n", dump_name, dump_addr, len_padded, - addr - base_addr); + (void*)(addr - base_addr)); } else { in_mem = 0; pr_err("dump_mem: kzalloc fails!\n"); @@ -2087,8 +2088,9 @@ static void _dpu_dump_reg(const char *dump_name, u32 reg_dump_flag, if (in_log) dev_info(dpu_dbg_base.dev, - "0x%lx : %08x %08x %08x %08x\n", - addr - base_addr, x0, x4, x8, xc); + "%p : %08x %08x %08x %08x\n", + (void*)(addr - base_addr), x0, x4, x8, + xc); if (dump_addr) { dump_addr[i * 4] = x0; diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c index 2a11f820f35a..000721fe5ab4 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_manager.c +++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c @@ -311,7 +311,7 @@ static int dsi_mgr_connector_get_modes(struct drm_connector *connector) int id = dsi_mgr_connector_get_id(connector); struct msm_dsi *msm_dsi = dsi_mgr_get_dsi(id); struct drm_panel *panel = msm_dsi->panel; - int ret, num; + int num; if (!panel) return 0;