Message ID | 20230720071430.259892-6-victor.liu@nxp.com |
---|---|
State | Accepted |
Commit | ac87d23694f44af44a98d21dd77016f2756b6b1b |
Headers | show
Return-Path: <devicetree-owner@vger.kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5DD52EB64DD for <linux-devicetree@archiver.kernel.org>; Thu, 20 Jul 2023 07:12:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231423AbjGTHML (ORCPT <rfc822;linux-devicetree@archiver.kernel.org>); Thu, 20 Jul 2023 03:12:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231425AbjGTHLp (ORCPT <rfc822;devicetree@vger.kernel.org>); Thu, 20 Jul 2023 03:11:45 -0400 Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2057.outbound.protection.outlook.com [40.107.247.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC0F41998 for <devicetree@vger.kernel.org>; Thu, 20 Jul 2023 00:10:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iebD1sNFUvHM9FzvDiYtru0o+DNKMjVxovMXzr/OZVn9mmk0XZYu5R7q26CetNwIJGOBbtw5EnqlVk6/K42IDlQBVBKj0rPEfXXqBL2s6oZOzgo8EyDJFZucBLGzuI4qc+ZC4z4Fi3bMNuk1p+CwZ9DpbnwHwAkGkbzPeihFosbe05gE5tf72+YcdjS7av0opu+oVqUQROHHey7ZnyZgSBV6MrgRfzN4u+rLHQyO2PqJBtHPkouBlZwfo4U4CK9YEk/hhq/Jrid+CaRrRalUaqHxrBEma73bWy2BaLX/0WG5qnKGfBUViOsuPlYzz4PzDA0nynNGK4zDz3j5EtY+0w== 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=QcM4UwOad8aiPGN1wd4BrcxlMjn1XZT0hNlv74Fm71U=; b=W2T0BZ+vVunXRzf1yEJ60gYPy5JFLRkwaAtUlHJnJYwMx77ULtDj9FgOeHd2FR4h3HVhSqQL/XYR6fmZxoU2e5KtYndPhUWwaQSNNuCDD7Hn+DNopOHdQqixdj0Ce+yFy+5xMfHnsZkzwejws8khi4MXrzOJ56wDdUrNBFerqHZA2DaGmcgJUyRdoZQ01i7ZtScp4gnHXJrabUTybzlBBJNEioNo2XX+1BBTMhmPPV+erMZIe7mUn08G3bdZxrbqzV+i5jlIno/dFFYJXZ1N7PZuyObTFFm5/1ktUnhjLTqaHXDfY73crG3to138tszLorEDyUD7wwFqUxpkZFkvfw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QcM4UwOad8aiPGN1wd4BrcxlMjn1XZT0hNlv74Fm71U=; b=p63uVE1ONxlpX2cNAKmATkJxkyFiArmHHr4db7MBOhHwr5+31wnIw3L17XKkZ6tIT9/grP7Gc4dBt6f8/qnzmNiWCbk9gHynj4NkiUuV9W8XMD4OLe/uQ4yAV/qY6OMc3xhmGw0Dtsqy3Ra9BB+vnNVkWqecteB2nvHIDJvYYMQ= Received: from AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) by AM9PR04MB8415.eurprd04.prod.outlook.com (2603:10a6:20b:3b5::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Thu, 20 Jul 2023 07:10:19 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::9018:e395:332c:e24b]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::9018:e395:332c:e24b%4]) with mapi id 15.20.6609.022; Thu, 20 Jul 2023 07:10:19 +0000 From: Ying Liu <victor.liu@nxp.com> To: "dri-devel@lists.freedesktop.org" <dri-devel@lists.freedesktop.org>, "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>, "linux-arm-kernel@lists.infradead.org" <linux-arm-kernel@lists.infradead.org> CC: "andrzej.hajda@intel.com" <andrzej.hajda@intel.com>, "neil.armstrong@linaro.org" <neil.armstrong@linaro.org>, "rfoss@kernel.org" <rfoss@kernel.org>, "Laurent.pinchart@ideasonboard.com" <Laurent.pinchart@ideasonboard.com>, "jonas@kwiboo.se" <jonas@kwiboo.se>, "jernej.skrabec@gmail.com" <jernej.skrabec@gmail.com>, "airlied@gmail.com" <airlied@gmail.com>, "daniel@ffwll.ch" <daniel@ffwll.ch>, "robh+dt@kernel.org" <robh+dt@kernel.org>, "krzysztof.kozlowski+dt@linaro.org" <krzysztof.kozlowski+dt@linaro.org>, "conor+dt@kernel.org" <conor+dt@kernel.org>, "shawnguo@kernel.org" <shawnguo@kernel.org>, "s.hauer@pengutronix.de" <s.hauer@pengutronix.de>, "kernel@pengutronix.de" <kernel@pengutronix.de>, "festevam@gmail.com" <festevam@gmail.com>, dl-linux-imx <linux-imx@nxp.com>, "alexander.stein@ew.tq-group.com" <alexander.stein@ew.tq-group.com>, "sam@ravnborg.org" <sam@ravnborg.org>, "jagan@amarulasolutions.com" <jagan@amarulasolutions.com> Subject: [PATCH v2 5/9] drm/bridge: synopsys: dw-mipi-dsi: Use pixel clock rate to calculate lbcc Thread-Topic: [PATCH v2 5/9] drm/bridge: synopsys: dw-mipi-dsi: Use pixel clock rate to calculate lbcc Thread-Index: Adm62T4XsRXruAuytUCRfthfHJ0PDA== Date: Thu, 20 Jul 2023 07:10:19 +0000 Message-ID: <20230720071430.259892-6-victor.liu@nxp.com> References: <20230720071430.259892-1-victor.liu@nxp.com> In-Reply-To: <20230720071430.259892-1-victor.liu@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: SI2PR01CA0039.apcprd01.prod.exchangelabs.com (2603:1096:4:193::16) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) x-mailer: git-send-email 2.37.1 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: AM7PR04MB7046:EE_|AM9PR04MB8415:EE_ x-ms-office365-filtering-correlation-id: 5f39451c-bd98-470c-49b1-08db88f06092 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 927SuwfviYwscyZCa5dO7tqXKFvioMorJOXtth6I0zsODsAVtNszmHr0I7EffDf1uz9vUvrs+eM3jjWkcWM1hxtq9E3t0jNeSpSPuvD1dCCMXNqJSApd6kRaF+8vmZVpvoyokQ4XGDC0g+Jh573NC9YBU49Co4wepeUm21843J055OzfI1pvzOsd/wFDVnkF9T+HYToWlHNNHh0S+T+C/k7jvnGJ4FEs+/ScJ78kqxxGkT3KlLVblePQS4kNeMkqjZHaQut964Tc+w7EiMYmb2PlA/0HJiyiKAGzeoA6g1h25P9jQYbIe6ccd58eYXPNot27RK29hYq91Hqu/QZeZUvVDt9a/l/uQ1QJcGcKtqbqS/27Lm/0IoGbhGLejxRkZUa9i6HRfNPSCkj/E2o7eZE9NhWmt4U84YP1YLapI1CMl/veWsX6eurMFp80TcjXb4M+5xyHbLAz6+19Z1DPoTm7lqmBULjOM45FS3uIXNaKawb4LpZmQRHlJKAOS8eULhd5sGDDKAlnOb8HwCkl80M/BLVvsaqdWkBUViuSuaqkkDi9jSs+QoVfp2tFbus/Lb9HSRH7v5KHuSC0JXP6XEDFom+LCJ7wLw9IHeGUcrg= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM7PR04MB7046.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(136003)(376002)(39860400002)(346002)(396003)(451199021)(6506007)(478600001)(1076003)(26005)(6486002)(52116002)(2906002)(6512007)(71200400001)(4326008)(5660300002)(66556008)(316002)(66946007)(66476007)(83380400001)(66446008)(54906003)(110136005)(64756008)(38350700002)(36756003)(38100700002)(7416002)(8936002)(8676002)(86362001)(186003)(2616005)(41300700001)(122000001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?pFIuyYGjs++tFrtAbBWKG2B?= =?iso-8859-1?q?VQ9ZJ4tW0TOo+Dw92NSGdm/cBJFNLYSM29+v3qops7gFmWy7DyrIyCdSL/pJ?= =?iso-8859-1?q?k6St2buNdUFMzF7ddi0qGjnQKkwGhRyDtTbrr0MP1RsBqwrkskatOeiYty/F?= =?iso-8859-1?q?HdeXTc62ZXk/T3ydYN9BN3dM7FdZPiMQR+mxD+zmMJqo9fuv75471brwkBTg?= =?iso-8859-1?q?AGEG8bgtT9zack9dDWMw8g4wT1/plBq81nMTUJNuSB35XHt8tLArtN8cFjIx?= =?iso-8859-1?q?2P5RLrqnIcP6ukyY/zx8WmUrryTWHjq5MuRFRAsq8DUUw0VecKW21cZdNGuE?= =?iso-8859-1?q?S/lohap/Ej27vdSk+9TDjxklTzNPQJ0xhoniAClo+tCTyKmo4uJvu145dJ9L?= =?iso-8859-1?q?S0Ewq/qXdL2FWhNqJROv7GQFIwdpsRb1m3I+sVfK64ydMfF6LxeviH5yJscc?= =?iso-8859-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EaUzTanYzGie1DRDkXsLOcnGdW1PuZ3H?= =?iso-8859-1?q?Rs8OUJlI//nCvOW79F+JXuKektKqG67jLUI0AwyR03V0VT/yWNomwFbmlk7v?= =?iso-8859-1?q?Q4kJUN5vddfDOUjqqhuJdT3uvfPln3UM9eRcIC8gxoJNNLy/zguWVUmggwKJ?= =?iso-8859-1?q?IEY9nyUc927WFz76oujuUeZ5+kQIfnp93CGMJA5BRipnYpXc1hKEKdaDE9wR?= =?iso-8859-1?q?hvtm24DWU+85sw2Wh7tXud+IE4OPlodxyqgon1oBRf0DFX2tlon3kxYmko7i?= =?iso-8859-1?q?xLktmPyKtqbgRpNiG?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5f39451c-bd98-470c-49b1-08db88f06092 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2023 07:10:19.6718 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: /aiazLIxuDq3z9yQZVss5F3pct/K9HTwicUSVVnoXI3zyBSmlLKlwHyxOMshlPBBY2yglbFwGBmL1C2ANlF3hg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8415 Precedence: bulk List-ID: <devicetree.vger.kernel.org> X-Mailing-List: devicetree@vger.kernel.org |
Series |
[v2,1/9] drm/bridge: synopsys: dw-mipi-dsi: Add dw_mipi_dsi_get_bridge() helper
|
expand
|
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c index c754d55f71d1..332388fd86da 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c @@ -12,6 +12,7 @@ #include <linux/component.h> #include <linux/debugfs.h> #include <linux/iopoll.h> +#include <linux/math64.h> #include <linux/media-bus-format.h> #include <linux/module.h> #include <linux/of_device.h> @@ -762,8 +763,15 @@ static u32 dw_mipi_dsi_get_hcomponent_lbcc(struct dw_mipi_dsi *dsi, u32 hcomponent) { u32 frac, lbcc; + int bpp; - lbcc = hcomponent * dsi->lane_mbps * MSEC_PER_SEC / 8; + bpp = mipi_dsi_pixel_format_to_bpp(dsi->format); + if (bpp < 0) { + dev_err(dsi->dev, "failed to get bpp\n"); + return 0; + } + + lbcc = div_u64((u64)hcomponent * mode->clock * bpp, dsi->lanes * 8); frac = lbcc % mode->clock; lbcc = lbcc / mode->clock;
To get better accuration, use pixel clock rate to calculate lbcc instead of lane_mbps since the pixel clock rate is in KHz while lane_mbps is in MHz. Without this, distorted image can be seen on a HDMI monitor connected with i.MX93 11x11 EVK through ADV7535 DSI to HDMI bridge in 1920x1080p@60 video mode. Signed-off-by: Liu Ying <victor.liu@nxp.com> --- v1->v2: * No change. drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)