From patchwork Thu Nov 2 11:26:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 117794 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2037822qgn; Thu, 2 Nov 2017 04:27:16 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QCIiJN6I7ctKm7k2Bc1ZZjKva03aa2KyvcKcukjKTsQ0gK3U+BCNCDC/bcnwK8SGDH+iKJ X-Received: by 10.84.235.3 with SMTP id o3mr2932372plk.30.1509622036673; Thu, 02 Nov 2017 04:27:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509622036; cv=none; d=google.com; s=arc-20160816; b=eNuMG9shYPXFdR87N6qfX89tlVb83peRsiGB4tWsNQOruJHZPzxCVjp5V6ytl93y0G SIGf8QXbc+ZMsFs5LV1tkOox13Io4D98zDkX4fUD87Hpnt26q5hu4crDFmJF6Zk5PC2C kiG0Ejs0AwCcokshSMk98XIWF77k/NTqFp7gTdRtrdmF6WxoaCg7O50mJe6EtoIaRcok IGAwrg75h2SF4q2VfQpdG5+PBu9NTpJIpTo2y9Nq1nkB81rTKIoHyTdo6FjuP4454k5S Mwp72EF36S7mDxJ51Qty2wjKUTLwKLX8n+QZsasRvwbCkd1kZu/8XwxIUFyBDEe/zaQe JAqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=+/6XpAEeIKCxdl3iptzu3siuY9AYK7/We0Jf8FBpl/4=; b=lmAVQJJA4WL9bvbXiwI/0jwB/psSUqA8fexDgD6oNxzn0Tvai7tQb5N01+fxxQABBZ vdilCZeqUDXgxeXIT+gDPHrUukOLDr0WpaH//lPRAvyF1hp6dB/NlGsXyV9v1bKMdBsp Pu/JkOr/g0Mb2wJehPxr+K/CXAHt9i+QGPs/grrRBj/IGGn6QzlhTEz77SlYmREFmX2n dLUVerusOF/8jqXjS1OZjf68bQL2u4+60PX7Hgu0riu/DYRCcXwm5vAsXdg+LL1PM5Xg NlAh7PrtVIxLpilNJVuMKmoa2JsF0Bd9P79SsHijUlPFYaoWlWESz9nuu/sPzl2QVvzf TV5w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 97si2193560pld.158.2017.11.02.04.27.16; Thu, 02 Nov 2017 04:27:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753829AbdKBL1O (ORCPT + 26 others); Thu, 2 Nov 2017 07:27:14 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:62133 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751011AbdKBL1N (ORCPT ); Thu, 2 Nov 2017 07:27:13 -0400 Received: from wuerfel.lan ([109.193.157.232]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0LeLdN-1dMeIT2HZF-00qEmb; Thu, 02 Nov 2017 12:27:00 +0100 From: Arnd Bergmann To: Alex Deucher , =?utf-8?q?Christian_K=C3=B6n?= =?utf-8?q?ig?= Cc: Arnd Bergmann , David Airlie , Harry Wentland , Tony Cheng , Dave Airlie , "Edward O'Callaghan" , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] drm/amdgpu/display: provide ASSERT macros unconditionally Date: Thu, 2 Nov 2017 12:26:41 +0100 Message-Id: <20171102112657.111405-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:nPVo576yWmfLJzdFbR4Wbr2roa7QJz21Zm7Zf+WvBbVgIzkxEmp p91FRUxYiletfCT2YpTcd/y6SZ+FdVwhaPsXD06jvCMtV5bBsZ09vWGC/+aBc1iQAgBRcQT Y6iVt+Pa8jeaQcpG8uvdlvvQLJtriJfC3UNeh5F9W3+u0jULCesyocpRmafnTD5LOPM4MYk gnI4c3lKFDgWa4srhmwng== X-UI-Out-Filterresults: notjunk:1; V01:K0:7di+JGZOLbs=:NxQQ8Qhr0ozwzp+uONkmbQ woWXic5IwOh5sGTjnprf/e2ADnRtDqxKzaEyRJWK897W59UuSOo4GCd679s/CBFYZACbuo48s GwpNGyVsZVRRMI/c2xEZmoodLtdVUxyVHgxFqy8jeWDlivJ4wTLrC7abDl5H+VGIsyEyRGWvW cL8DVFLRdVmPGlTwSI7buEqJKCXJTQ5x+vaElWtjSDJcPf/UFFdFIEZCP0ertkuxeNgXoEAGP ItrgLZlHf1rC9L4AEKHlAOz5tgCgyeI3jPfpCzissZEV0ua3OsOrc4MMy6kI4aFiRcHDtqjR5 dSZAZyXQr8Vl+VSDEFio5Z4JJHKPNzVKOCqnTXBUEI459oqvJh1bIckp0x5y673qVTpFNsLff xQVzypg85SzKbDqFiFywhEF6egDZ1KlR+ddaPoPLczFIakIuTOhdDyiV5g7vc+qXCJb2f6/cS qaLfX67aEJ7A5sR/XAYvBC+j8YYg5CxQUjGXPscusjXujuvuja6DuHFH7E56hlaydr3xk+bjB 7FacgrJuSkeVIPnGxzBa5Izj/j6RMahD23as4jxKGP0GQeS+5ZwgXz9wp0ksnRrhQKv0wfbsS lYhrdWTmwQcoqSb1U8uCVMETZj1/QHybtNQtHpfVhQ5OAK1oJ3uIuZEFh34JJsgF49WtAIjch JnGxayioB3yN0iu3D4qn9xWMNQUV/z6rs4/k7ceSU2bPYGTCujJPZksj9qZ10uiSmSM97E11F /RWnzYh2D9fVpZQE7EkOsSWTPjhsOz40PCWzyg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It seems impossible to build this driver without setting either CONFIG_DEBUG_KERNEL or CONFIG_DEBUG_DRIVER: drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services.h: In function 'set_reg_field_value_ex': drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services.h:132:2: error: implicit declaration of function 'ASSERT'; did you mean 'IS_ERR'? [-Werror=implicit-function-declaration] This moves the ASSERT() macro and related helpers outside of the #ifdef to get it to build again. Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/amd/display/dc/os_types.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) -- 2.9.0 diff --git a/drivers/gpu/drm/amd/display/dc/os_types.h b/drivers/gpu/drm/amd/display/dc/os_types.h index 86170b40b5c5..499bd52004cf 100644 --- a/drivers/gpu/drm/amd/display/dc/os_types.h +++ b/drivers/gpu/drm/amd/display/dc/os_types.h @@ -61,8 +61,6 @@ * general debug capabilities * */ -#if defined(CONFIG_DEBUG_KERNEL) || defined(CONFIG_DEBUG_DRIVER) - #if defined(CONFIG_HAVE_KGDB) || defined(CONFIG_KGDB) #define ASSERT_CRITICAL(expr) do { \ if (WARN_ON(!(expr))) { \ @@ -75,7 +73,7 @@ ; \ } \ } while (0) -#endif +#endif /* CONFIG_DEBUG_KERNEL || CONFIG_DEBUG_DRIVER */ #if defined(CONFIG_DEBUG_KERNEL_DC) #define ASSERT(expr) ASSERT_CRITICAL(expr) @@ -86,8 +84,6 @@ #define BREAK_TO_DEBUGGER() ASSERT(0) -#endif /* CONFIG_DEBUG_KERNEL || CONFIG_DEBUG_DRIVER */ - #define DC_ERR(...) do { \ dm_error(__VA_ARGS__); \ BREAK_TO_DEBUGGER(); \ From patchwork Thu Nov 2 11:26:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 117796 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2038301qgn; Thu, 2 Nov 2017 04:27:49 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TIYMotmJ4DQa6hMURDD5Lj1VixwWA9dkceX1uhwSInSg4SGHYI8QgiE47BRf3ud6bWlmSY X-Received: by 10.99.114.19 with SMTP id n19mr3177737pgc.356.1509622069039; Thu, 02 Nov 2017 04:27:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509622069; cv=none; d=google.com; s=arc-20160816; b=0RAZ824Wh/0HJvn2MFiNAE081hvgiWSXV/3rS9R7ZKCVGzdmxyJLk5Z+wPu5ZKGaRC tQMFra+ASm5+nsjFovBCaGnzSWMR7j3kYlKWvjFLmIDBqYoW2vej4nQ0Por+/A6xsWRt M3JuBpT1OMGx4G/6ZAkB1lU578m1Vn4XOQER5Kp9XwYosEVXV51n8mRuMXEsuwwt83lA /+881gYr0OyR5rTMfV64N5n5amyFCXA3f/ES7nscDRmWAf2Ot3xE7J7zN7H6++UXFlIa lnWpMULYj2Gojk1AWlAizeCpvohXmoSCaCOAixwkytKyzMleW0wsQBr4Zg+6d2JeUBWt jmvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=iXfg+/s1+mB/iqdkg7GfXSCZ7rV0gU+nCc1ANrZuYoU=; b=k3A1m25Orz7BhnbaKtKUVO5YjZxo6qVHsfMJeRIae37yN6Mt+sqLyI75MKmt4m5WY9 PgMighQiVzzsXaG8Z/BiWY4rAICm4T9He/3cdD0TMBMhG/5rkKUA+38Q51D8OpigQrB9 JPbFkPwUhYQmDcnfN60uppKAEs7otFGDT0cpo8KhMLTq2qTxLLeUeaSentBLWmeICoCQ PmQXtiHaLLOYud7ltHgT6K6mXxa9UW0rxSBJ44uUnkpn1Ls+6WR0dkIP6rsinW8aIRZE eIbaIhXoniyPrQJ6A+n2COaVsNgsv/sgJcC6URuOZ15rhPKV0/syEfotHK4Ldf/ksOZ9 +BWQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 97si2193560pld.158.2017.11.02.04.27.48; Thu, 02 Nov 2017 04:27:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754242AbdKBL1q (ORCPT + 26 others); Thu, 2 Nov 2017 07:27:46 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:56195 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754153AbdKBL1n (ORCPT ); Thu, 2 Nov 2017 07:27:43 -0400 Received: from wuerfel.lan ([109.193.157.232]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0M8hmN-1dEQJK2gHT-00wBJz; Thu, 02 Nov 2017 12:27:33 +0100 From: Arnd Bergmann To: Alex Deucher , =?utf-8?q?Christian_K=C3=B6n?= =?utf-8?q?ig?= Cc: Arnd Bergmann , David Airlie , Harry Wentland , Tony Cheng , Dmytro Laktyushkin , Joshua Aberback , "Leo (Sunpeng) Li" , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] drm/amdgpu/display: fix integer arithmetic problem Date: Thu, 2 Nov 2017 12:26:43 +0100 Message-Id: <20171102112657.111405-3-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20171102112657.111405-1-arnd@arndb.de> References: <20171102112657.111405-1-arnd@arndb.de> X-Provags-ID: V03:K0:sTYaLgEnB+dgWrtDykqTffpw4GKC9CdbyBtvHCo2OSO8th8f3T0 AO+pAW1uCdj/6wryiK5+Vf1V5fy62lqjMpU0NAnn57mQf9wW415DmlKmk5nm0mJ5/eDzmDx rxwIGps2oSfFoZ8LD9w9/Lw4AWCDs2HRgi6hviHNszE5UyhSMv1T6y7jaEqVPxZLja9yf07 y2yRega7UFzrnAXe9FZZQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:ZDDlfzMdTJQ=:5Xr/dpjUeImQDLn8eq93JO pt8HfwW9ZWVeXeFgr6zF5RtHFtkJdGQWo8ztD1spzs1KtlLx/qXzAMOAGEOk403RbMYFkBRx0 bQEkpDZPav07JzV8EaPv5OscOoE2RkW4khnNtdsdzpsDsBvdDRvnPSSSdjO0bRiNI9SAF2wCd Ivqteqy6ImuhC+6DvKnWZK08K11mKe29NVKGyqozNu3gJEWQbD4uQH77HUDfBHcXZWkl1rMrg MBMLScBiCo1XonetcCAl8dEXS/OvfHbEGThR6IQn9pd7mdv6Azx3+STtEVwjqIJ9ku3ZAuu30 gtTXZiedlGV2mf4Jqf8/ccgKSqsrBr6LfOgrqV9hkVmwAHnSsRpESi0HE/v5s4xrcNRMLsZOs lQNCQqlkaeN+zYNwHwndb5JXcD3WZLEOXlzJKOUQGb9KVWUpxjIZ2fIwiO6CgqD54OtwzBvep 7OJcSHewQk19I0Ck4hJja08po1JUWEa1CW8U3g3IhtcHVngcPSk+kf6llSO/RtnO29ChQTR8H bi0UR1BuZfmXw1ul7L+kCUw5RSffy3bXP5bYZlixbc4DyoxLtl+VxJnNEVCqDd+5VtelQ2rRQ YPI/Jfj1giUdorFABXudQ9HSAMGHGv65DoCLoE2xlgaLxy3+55sBak7q5yCHxc/6oJpJWH67N /MPAwv+ekuOzbIOkGzNXYv/8/B7j0H03uV+JKmj+rUb8Y3+MwcsI84r2zvtF1J4S2+t1s6aYT BGUXnvpwVrVpbINaYG+FlTmUNXnx9vSILjzqAA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org gcc warns about an ambiguous integer calculation: drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c: In function 'calculate_bandwidth': drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c:534:5: error: this decimal constant is unsigned only in ISO C90 [-Werror] data->lb_line_pitch = bw_ceil2(bw_mul(bw_div(bw_frc_to_fixed(2401171875, 100000000), bw_int_to_fixed(3)), bw_ceil2(data->source_width_in_lb, bw_int_to_fixed(8))), bw_int_to_fixed(48)); ^~~~ Marking the constant as explicitly unsigned makes it work fine everywhere without warnings. Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.0 Reviewed-by: Harry Wentland diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c index 15cbfc400633..4f8a95368ffc 100644 --- a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c +++ b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c @@ -531,7 +531,7 @@ static void calculate_bandwidth( } switch (data->lb_bpc[i]) { case 8: - data->lb_line_pitch = bw_ceil2(bw_mul(bw_div(bw_frc_to_fixed(2401171875, 100000000), bw_int_to_fixed(3)), bw_ceil2(data->source_width_in_lb, bw_int_to_fixed(8))), bw_int_to_fixed(48)); + data->lb_line_pitch = bw_ceil2(bw_mul(bw_div(bw_frc_to_fixed(2401171875ul, 100000000), bw_int_to_fixed(3)), bw_ceil2(data->source_width_in_lb, bw_int_to_fixed(8))), bw_int_to_fixed(48)); break; case 10: data->lb_line_pitch = bw_ceil2(bw_mul(bw_div(bw_frc_to_fixed(300234375, 10000000), bw_int_to_fixed(3)), bw_ceil2(data->source_width_in_lb, bw_int_to_fixed(8))), bw_int_to_fixed(48));