From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B892C48BCF for ; Wed, 9 Jun 2021 10:15:20 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0D9E06128A for ; Wed, 9 Jun 2021 10:15:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0D9E06128A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gerhold.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/mIxmDLlse4QKfZErVUzfFUvd59phnchqamV5zfxpJA=; b=cIinVDAHJ2Wup4 lzweegV0Y3MrV2ZeQsEJ9YYJmobRdTX3IztnjxNZI+qji/RgPDJEudGvuci2WiobDVyUbr1DMh6kn rZSilBPWlWkcRmzPn+X4WwQH3gDhG6R3754VX0vGqPSSKgo6xBU9laxGYpbtKeFyFKN6NgoOZaNe7 JIhyfG/Us0st1I55KIfgHtxB51bXylZVENlfw3uuWphv1T0ypmCm2Piw/VlbKgLInxIpXru6bZiKM Y2D+O28ClkVT2TW1nS31wkHNjVCmNcdQNyWJEQWRFXreK5LtB5opcELn1wnD5bdBTyxuUv6e59BUL UuDDV+o1djxdz1AgDH3A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqvAj-00Cv6A-QO; Wed, 09 Jun 2021 10:10:55 +0000 Received: from mo4-p01-ob.smtp.rzone.de ([85.215.255.51]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqv55-00CsgP-QS for linux-arm-kernel@lists.infradead.org; Wed, 09 Jun 2021 10:05:05 +0000 ARC-Seal: i=1; a=rsa-sha256; t=1623233100; cv=none; d=strato.com; s=strato-dkim-0002; b=kHO6KBv82tPQXRN/96teOiv5/v9VW9hWDsRaVShOnsbeTBIzB6y4QPW6SiPbPLu9EE Yvxs1WdMdqxezQHsjWWcOQrVC8D77wvJs5PCehFcHYAKtL95nR8rAmhL/Q0MNvF6U+2s ad4OR5g80R35YHmmwybX23pbStgyd2iR+j+qVs24EU6RvYKXEGWqZ99y5OsPedo34WCW hAX/a6OlryPu8o4We9G6gJwzlOVlOKoSpWernNJFM2Pv7RXiNVMIjV9B0APIFVsbGaa3 DkJSZKfMEcCpA3zp/1U3rZmc21rUQi7y7Am79dQOWfTtBYzHKz+iB5IYabJGmoBfdQNP PIxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1623233100; s=strato-dkim-0002; d=strato.com; h=In-Reply-To:References:Message-ID:Subject:Cc:To:From:Date:Cc:Date: From:Subject:Sender; bh=ItsPMlHbJWRbDzq8RhdjxHbYrMVELXpPagW5og9aBug=; b=ivU/7eSS/vplEe67FfTcNsnnYehtQrTXE7NReOHXDzUIyC/Cd1YQ99LG5fNUYdQFXV 5K0b1NLUqj6hEfD2Yf1BMuMB1OG3prAg0gjx0OxVk3CH98lc18A1e/LI60s8GvKNwSVe ZAJ8w0wb6DVhW9Yp3/LqTBGLUhxT0r5w2tfaibuolyjSaeb9UFFVdBz3kSTGb0LQAowZ lGRKTYerwajr9ERwULMWMQDvbkOMQrm4a1RqWnDoLWJ5t/YJczl+Yh8xcStRxpS2RTRp ZLXRzBml3mrLwZE8RRnFmwwa7Jfl0nwbT0xhZcPU0ptFhex6HgFlWfQ54N6JmxBaHWgE Tl4w== ARC-Authentication-Results: i=1; strato.com; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1623233100; s=strato-dkim-0002; d=gerhold.net; h=In-Reply-To:References:Message-ID:Subject:Cc:To:From:Date:Cc:Date: From:Subject:Sender; bh=ItsPMlHbJWRbDzq8RhdjxHbYrMVELXpPagW5og9aBug=; b=G2lylwr1PPWZNvT831Kqcln6U5qMIhEvuhEgYS2YfGPEIiGca/FsKu1O8Lo27C108t RZYtprebD38Z1li1ZxxPeRxraogUQSXVPkyir7s/8SkCUl+I+r7hdHLNq34pOVjCSHEw 7i78hS8wUjE9JjZl+if1pVJO6LslYNORXYEfSFuhcvYTkFhGku+Matyfhn3QgiJPfnis JCcibc8cgXWBeOBl1+WYoTEi9V9JKW4Snr19e5C4Vf6FLQQoYdkfuCPcSTbfI5RkddP8 bKgB3408WkeSsd+XcrH5lYB1s6k/Yhiuirl2MCl9371DsN13EG+4rVM/YKUvnsadSWpF 969g== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVOQ/OcYgojyw4j34+u26zEodhPgRDZ8j9IcbDBg==" X-RZG-CLASS-ID: mo00 Received: from gerhold.net by smtp.strato.de (RZmta 47.27.2 DYNA|AUTH) with ESMTPSA id y01375x59A4xkmc (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Wed, 9 Jun 2021 12:04:59 +0200 (CEST) Date: Wed, 9 Jun 2021 12:04:52 +0200 From: Stephan Gerhold To: Linus Walleij Cc: dri-devel@lists.freedesktop.org, Maarten Lankhorst , Maxime Ripard , Sean Paul , linux-arm-kernel@lists.infradead.org, Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Subject: Re: [PATCH] drm/mcde: Fix off by 10^3 in calculation Message-ID: References: <20210608213318.3897858-1-linus.walleij@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210608213318.3897858-1-linus.walleij@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210609_030504_115355_9172957F X-CRM114-Status: GOOD ( 26.87 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Jun 08, 2021 at 11:33:18PM +0200, Linus Walleij wrote: > The calclulation of how many bytes we stuff into the > DSI pipeline for video mode panels is off by three > orders of magnitude because we did not account for the > fact that the DRM mode clock is in kilohertz rather > than hertz. > = > This used to be: > drm_mode_vrefresh(mode) * mode->htotal * mode->vtotal > which would become for example for s6e63m0: > 60 x 514 x 831 =3D 25628040 Hz, but mode->clock is > 25628 as it is in kHz. > = > This affects only the Samsung GT-I8190 "Golden" phone > right now since it is the only MCDE device with a video > mode display. > = > Curiously some specimen work with this code and wild > settings in the EOL and empty packets at the end of the > display, but I have noticed an eeire flicker until now. > Others were not so lucky and got black screens. > = > Cc: Ville Syrj=E4l=E4 > Reported-by: Stephan Gerhold > Fixes: 920dd1b1425b ("drm/mcde: Use mode->clock instead of reverse calcul= ating it from the vrefresh") > Signed-off-by: Linus Walleij Can confirm this makes things much better, thanks :) There is some garbage on the screen for a short moment, but overall it works really well now. > --- > drivers/gpu/drm/mcde/mcde_dsi.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > = > diff --git a/drivers/gpu/drm/mcde/mcde_dsi.c b/drivers/gpu/drm/mcde/mcde_= dsi.c > index b3fd3501c412..5275b2723293 100644 > --- a/drivers/gpu/drm/mcde/mcde_dsi.c > +++ b/drivers/gpu/drm/mcde/mcde_dsi.c > @@ -577,7 +577,7 @@ static void mcde_dsi_setup_video_mode(struct mcde_dsi= *d, > * porches and sync. > */ > /* (ps/s) / (pixels/s) =3D ps/pixels */ > - pclk =3D DIV_ROUND_UP_ULL(1000000000000, mode->clock); > + pclk =3D DIV_ROUND_UP_ULL(1000000000000, (mode->clock * 1000)); Removing three 0 in the dividend might be slightly more efficient, i.e. pclk =3D DIV_ROUND_UP(1000000000, mode->clock); since then we don't need 64-bit division (_ULL) anymore (1000000000 < 4294967296 =3D 2^32). but that's more nitpick level. I tested both, so for both options: Tested-by: Stephan Gerhold Reviewed-by: Stephan Gerhold Thanks! Stephan _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel