Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp762877rwj; Thu, 22 Dec 2022 14:40:58 -0800 (PST) X-Google-Smtp-Source: AMrXdXu8fLAATDUviT8OZy+mqb9Md6eunz10rBUGq1iok4qzpr2aejpy/aP7DPn64zC7lSDO9RaT X-Received: by 2002:a17:907:8c8e:b0:7c0:e0d9:c1df with SMTP id td14-20020a1709078c8e00b007c0e0d9c1dfmr5065976ejc.10.1671748857878; Thu, 22 Dec 2022 14:40:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1671748857; cv=pass; d=google.com; s=arc-20160816; b=R5qjPKE4dpso6vdX1obWHfs+smlKd3VjUuK+82kql7qtVT9CiikafnpOUFDqoMb75E gIC+nwzqf5pRXZehIowhdDyu8CdhKJC1l8Lre0n4Z3QTYO7llf5nxAnf3dR7SHi8BoCO UpfaxgLKBRVyJETZukyRamv7UfmixUhzOOhqkz2K/grljAJBWX4vL9d1S4Z7SU53CMTi U2+5q/7a+4QS3SZWhil/aM7opT3QpxzjxphAUoWb8w57DwuYhL3XMX+mvEtBF3F/+/2p ysLCvYB73mMf3MdqJEBhD0JiNZqPUynlgrlABl+02S+LKYQWSPgOjeeNKMNVfIbKpALV xaFg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=4qUV/ePQN2zXJPIM4M4btJBr5zqwo9T3VabUNoeDEDY=; b=PDC1Vs5EaCwfU/5uOmrXnjYmEG3j1J17RMmJs40XLLwUAUwd7vGmW5eiZ98hgrrX4E ncM8k4a7TSdXJ25mE5M8bmQIS98HvQVBN1qvWO5AiSlgs4nuUqhK9Knjd8wbWH6mzuOk zEoPW9OpGLjleGTkf8Y9C1W0aYflbZ18GyisPmtWkdLO6TDwvDRp28AN4ok8sJ0UMfi+ /6UwtpMpqnVRt0W8A0NAHrS5FuS3grIDvQXNIW4taQWjWiNq60da9eNLJv2rDgGFlPqK PuD5okiiBcjhIRYTc736loR32r6oMw5J6K5KtK1Sd/TUOJHb1IkR6nFp4rBBcuOxhL+U mx+g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@seco.com header.s=selector1 header.b="Scb0paf/"; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=seco.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ww3-20020a170907084300b007a641e472f0si1404502ejb.139.2022.12.22.14.40.40; Thu, 22 Dec 2022 14:40:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@seco.com header.s=selector1 header.b="Scb0paf/"; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=seco.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235438AbiLVVey (ORCPT + 68 others); Thu, 22 Dec 2022 16:34:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229785AbiLVVev (ORCPT ); Thu, 22 Dec 2022 16:34:51 -0500 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2070.outbound.protection.outlook.com [40.107.7.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71E9822BD0 for ; Thu, 22 Dec 2022 13:34:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D7UXk2DlRNTB886XnznrqjWgeoWJi9ZaA8MqsVvSk8berbGPVv9ijk4nnYopTPBQFUiFTgqNqfcueCr6GRMgVAunJk1fDZ/PS6by3BEeHqcfKlCA5NM3P7fkLI++5GCUBirIyPe41awz6NxXOmQifMJE16zhqjMK3/eYnNWH9XXQvPRMr6My3sMT7VOYNev0rHcbKpHO2MF1zEm12AQtQ+plQq7f6ZDMBDT18S83c+VkNdzXo7IaLoe30JXJRKGvlhZ9VZ6ZefWbV55uhxHlHrWjb6NL0yf2PgsEO1HloPxz/DjQ8c6HqlXElVMr4ONoxJTChsJGVHGi7tvL5b17jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4qUV/ePQN2zXJPIM4M4btJBr5zqwo9T3VabUNoeDEDY=; b=L+bnynOAVDitdHMe6cNeFnytFWh3zIebZ+Fu8YA8HFvj+t89bJLhIrI9x1sFYc6ngw9NOwNXSDPHWzMnnfLKVY6a3+Y+Mp99KA4Dl26ePOcRs32pA5gIuk8+mEnQhRQv9N9CsGjgN+ojpGe8bG/qkwkrQZppC0L+tOIAX1PvEfsn6ZCTGErmM5vmRzywEtPtbTdJQPHyHNy8Ctu6C8prdpB0NpuECbtEUqCrZcGWhQp8MRHWUQp+WviuXAy4H0q/e1IKR4q1s/0oZVW3177BlrQxkNM1fjuYZ2Q17o/HxM/L38rudTxb/6Kap6utql/jO5ML7vjracKLxEu0JeQHlQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4qUV/ePQN2zXJPIM4M4btJBr5zqwo9T3VabUNoeDEDY=; b=Scb0paf/SnaQIg4QH0ChI8btk0JyzVq1LCjQDcSgy5ZheqUMrkm0ZVlhwZw/NLnxbYWqlkYro9Ubll/7tOoGZe0K8ALpycsdfc/bUfCvZD5+PQlnVvBGQsi4x4IqTIvwyKbElHNmODX/APRsugGd4tXPZEei8jdAMb7QXDDYb6lXgVdnulrUJaOePSPdwPG0/NNxKl7jda+JXQMJrlyfjy/vR6VEkiBZi4BfQh7pLpBM+lu4CiXOhvjUKQ1GsOe5ilDRleSEjSta/5otJeHfFKKVNapILd5EUl52wfTmM4SZlGCAYsxkKkOuI3D9poVZk/oUFGYlE1dtwjx7T/xQzQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from AS8PR03MB8832.eurprd03.prod.outlook.com (2603:10a6:20b:56e::11) by AS8PR03MB7587.eurprd03.prod.outlook.com (2603:10a6:20b:34d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.6; Thu, 22 Dec 2022 21:34:48 +0000 Received: from AS8PR03MB8832.eurprd03.prod.outlook.com ([fe80::264c:4825:bcb5:e4ac]) by AS8PR03MB8832.eurprd03.prod.outlook.com ([fe80::264c:4825:bcb5:e4ac%9]) with mapi id 15.20.5924.016; Thu, 22 Dec 2022 21:34:47 +0000 From: Sean Anderson To: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org Cc: Xinwei Kong , Chen Feng , Tian Tao , Xinliang Liu , linux-kernel@vger.kernel.org, John Stultz , Sean Anderson Subject: [PATCH] drm: kirin: Enable COMPILE_TEST Date: Thu, 22 Dec 2022 16:34:26 -0500 Message-Id: <20221222213426.1858941-1-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: MN2PR13CA0011.namprd13.prod.outlook.com (2603:10b6:208:160::24) To AS8PR03MB8832.eurprd03.prod.outlook.com (2603:10a6:20b:56e::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR03MB8832:EE_|AS8PR03MB7587:EE_ X-MS-Office365-Filtering-Correlation-Id: 499c05fa-5abc-4255-44a0-08dae4645983 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: M+/50+M5ZrY2PMdVa6PksLffhVW9WP9TnAGy+nPyn0x0bNKBcStKaAyoLGyaHjXltq4IYY9zfobrQxDzRGycYTBiircxmxgUH/UaEVcUR0YfhpbRH6Ro38qYemRtWpeLYgqZo7yBF6Yz5AeJgI42v8iLY1EofEyWHC4kON3+cTGAn+rhBbaRR/PXxYRiJYtwhbLumucNGGy7jvropkUZaGS0zqzK/CudhN4AiN1LHIVyfbPPLEXpdnfQ/EuqrnyhUCYdtRs0fa/JLI9QHOAnI+JOBz22jT6TJZjy4zyXhpgiW2XeiltGNRAukxTXSteEwuUzqGxZOGpsogHjWlk5R2KgoKLpOPiwJYXzeT7xXjS4ffRRwflxv/F2d/E7QTaagzh/hhetCe0G0CewUChhPfWpQhFxy8hb7zD5cIXCypypsjuHjQ7+NaCEcNs4Gv5X3/PhSrMg+UuGP47rtmEzsl7BadG8GQQDm7YUdulaHuzQRU5wqUNJnWVXfj3uIObaLaIgx+sa33mXthfAMOrkoZpwqGkjF5wxAxTSI4rlxElLswQ30gDHhF7iUjSleFg5+79+JuOeeLHD5hUXjP6jquM5dS1UmMnWCeq1KabzFToSEmWE9UI75guOd3CHPhPp4/x7zbfdcDq5UHBiFHppSRHN0ZG0tySF8qnfn0IaFMDh4c8nMovMmD81doOrXJwRbLYFUymnXGPIivSxFVVGzQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR03MB8832.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(396003)(376002)(346002)(136003)(39850400004)(366004)(451199015)(36756003)(44832011)(110136005)(2906002)(54906003)(316002)(1076003)(83380400001)(2616005)(6486002)(52116002)(478600001)(86362001)(186003)(6512007)(26005)(6666004)(38100700002)(38350700002)(107886003)(6506007)(41300700001)(4326008)(8676002)(5660300002)(8936002)(66946007)(66476007)(66556008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Ft1FvPM11QnO970QRasv6Vp+L+DFPgYfmaGwfU/ngcguxOlgQQyef48Nyj1X?= =?us-ascii?Q?XDDmB7mgnW0lUM23KeIpLgbn1NJt63ADDbMgn9qb1hsrFOWTsQbsqRGd+ZhH?= =?us-ascii?Q?D3EAQRQeBzL24zvSDwHnUi7Ma3WaW5Toyk+7XqNOGlTIXspfmmK5Rz3czj0Z?= =?us-ascii?Q?lPeeNZKRSa6uI6zj/EJIOc6gGGoAbbmSl6qiGykegJrg5hZuOg90zbw1dOFK?= =?us-ascii?Q?RSE4LPadOQBgGLBbfeNKX0JaCte61sTXypD3Rynli2grk2Or92/KXPUub7Zj?= =?us-ascii?Q?3XFphtmVkSYNTdP0hbW2093H8ZiHIKfrL7ShcXVWy8IFlvNJf2lTd4luSvOl?= =?us-ascii?Q?3eLvW04A2yHmWhQr4UxYFg31TyhlHBXZ1BDidkEyHF3tK8a/lY77bDPevQH7?= =?us-ascii?Q?/jrHKvfYwk360mnPfPLWiR1GRkRwc7+kmnQY8aNoUMR7MqXTXOKePnAgbBFO?= =?us-ascii?Q?/mdNOL+nyNDBMq0fAQun6yIA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0y8mv4o?= =?us-ascii?Q?zX+cSIzV98DUV6153nhIvg+kaefc9Po1Nj0X0C9p2p0G0RcDR8PGN/qbC8v0?= =?us-ascii?Q?FrXbgjOOTZEolCPWieDpP2jEJ3uXW9inwmcglqNlFFmsvrv3698/UF0tzWxz?= =?us-ascii?Q?nqIwzT5NG8LUDVZgPKib95HnQRe8w7NvGzUifXpWzUy7oxkrXzVGLvWvyceC?= =?us-ascii?Q?BHopSugifJO7x2z5GiLeU9VhAcHYGL0R/N/oGEeDAVdqVAAPxCNi9Hce4Llx?= =?us-ascii?Q?Qg=3D=3D?= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 499c05fa-5abc-4255-44a0-08dae4645983 X-MS-Exchange-CrossTenant-AuthSource: AS8PR03MB8832.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Dec 2022 21:34:47.6608 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pLT33stOMkYsEGesqfOCz32YF4LAieA4fYm2xeHxQK6L1ZylTZ2/iPPJwMsw6ED5R0/zS2s34nQbW1XC6l0+TQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7587 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use macros for 64-bit operations. This allows compile-testing this driver on 32-bit arches, so enable it. Signed-off-by: Sean Anderson --- drivers/gpu/drm/hisilicon/kirin/Kconfig | 2 +- drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/hisilicon/kirin/Kconfig b/drivers/gpu/drm/hisilicon/kirin/Kconfig index c5265675bf0c..0772f79567ef 100644 --- a/drivers/gpu/drm/hisilicon/kirin/Kconfig +++ b/drivers/gpu/drm/hisilicon/kirin/Kconfig @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only config DRM_HISI_KIRIN tristate "DRM Support for Hisilicon Kirin series SoCs Platform" - depends on DRM && OF && ARM64 + depends on DRM && OF && (ARM64 || COMPILE_TEST) select DRM_KMS_HELPER select DRM_GEM_DMA_HELPER select DRM_MIPI_DSI diff --git a/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c b/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c index d9978b79828c..1cfeffefd4b4 100644 --- a/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c +++ b/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c @@ -157,8 +157,8 @@ static u32 dsi_calc_phy_rate(u32 req_kHz, struct mipi_phy_params *phy) q_pll = 0x10 >> (7 - phy->hstx_ckg_sel); temp = f_kHz * (u64)q_pll * (u64)ref_clk_ps; - m_n_int = temp / (u64)1000000000; - m_n = (temp % (u64)1000000000) / (u64)100000000; + m_n_int = div_u64_rem(temp, 1000000000, &m_n); + m_n /= 100000000; if (m_n_int % 2 == 0) { if (m_n * 6 >= 50) { @@ -229,8 +229,8 @@ static u32 dsi_calc_phy_rate(u32 req_kHz, struct mipi_phy_params *phy) phy->pll_fbd_div5f = 1; } - f_kHz = (u64)1000000000 * (u64)m_pll / - ((u64)ref_clk_ps * (u64)n_pll * (u64)q_pll); + f_kHz = div64_u64((u64)1000000000 * (u64)m_pll, + (u64)ref_clk_ps * (u64)n_pll * (u64)q_pll); if (f_kHz >= req_kHz) break; @@ -490,7 +490,7 @@ static void dsi_set_mode_timing(void __iomem *base, hsa_time = (hsw * lane_byte_clk_kHz) / pixel_clk_kHz; hbp_time = (hbp * lane_byte_clk_kHz) / pixel_clk_kHz; tmp = (u64)htot * (u64)lane_byte_clk_kHz; - hline_time = DIV_ROUND_UP(tmp, pixel_clk_kHz); + hline_time = DIV64_U64_ROUND_UP(tmp, pixel_clk_kHz); /* all specified in byte-lane clocks */ writel(hsa_time, base + VID_HSA_TIME); -- 2.35.1.1320.gc452695387.dirty