From patchwork Mon Jun 14 10:27:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 459826 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp3189065jae; Mon, 14 Jun 2021 04:21:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxcQ9Gtm8Sz2k3LhtBpODOxL7m6WGbEI58/6DV5gk283jxqbeENe27dEz2k0fiHEOcMm4v X-Received: by 2002:a17:906:c212:: with SMTP id d18mr14950215ejz.291.1623669717162; Mon, 14 Jun 2021 04:21:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623669717; cv=none; d=google.com; s=arc-20160816; b=QkGubJn37NBd+PQbrw9jEbPzzL3x53bV5rfLZb3TTUQc3/TjP6K41BN/PSL14Reyn+ 9N9c2hgOvanxiCPGyqQi/hJS+mmDWyXaIkGmPeEsvIo3DGTnSduEqM5Sh/j+F+e9co8t hjDOvcDpJqjRI9hIxVi4LKzygLBwOOjhO2b4KiU2C46A5wJg3M84/+sUhoNZGBET4TAY 8xj0mrJFwj0LhLx0rGKOqHUqEfM5DkuiGkm+nEy3zY2jZQaX+lKNRltihn19Q+vXRPAk Qu97cHdpcy8F+PMVSxUd8fKXO2mLE6CQkfRKZ8t2mu1etCCDXC0HtsJ3/8quYYVmr9GV +v5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=U3TOkEXEiEvK1QYGY7GZlbUlTWTP145KDDG7rwfTYu8=; b=tKz9Aw45shay3+Opk9UZQtqO5FSxS99ih0oGYC+/Bbwmovnzq25fO255076L1+ja75 xtu0QSAw31Ze8BavEIE0OzfhM9B0KdJikrjsxpwQDRBBN2PrRx5sP5ThY8zVA7jJ4M02 rE3vwG5gJyAF5SUGeZlwkIl4I7QG7Y3LHziUpEZ2nHY8mK+evGkfKivVmpvQcQiPH3pi qy5nl+4lJkNffQXVYSw77oJffmFiu+wE1J+CI8xP+wF6fx1xqTDFmmni+AHy5CQ/ajny lDD+MqZSf8ZxAgOgoQdQxSuSX5H82yrtCS9xn1LEnZRb3562EwQwwNJYE7OSU9GPd8PI 2KLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=B4CrFUKw; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l18si11240982ejq.514.2021.06.14.04.21.56; Mon, 14 Jun 2021 04:21:57 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=B4CrFUKw; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235708AbhFNLXR (ORCPT + 12 others); Mon, 14 Jun 2021 07:23:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:51490 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234768AbhFNLVM (ORCPT ); Mon, 14 Jun 2021 07:21:12 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7A3A36199D; Mon, 14 Jun 2021 10:52:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623667930; bh=sqXNUKRqZ/jQVQRs9cUbyrUHoCei3o6O3ABjrOCWC/U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B4CrFUKwiOLWzRkJH/ebwXPWVD9jHm3HBDgiTCwdvI91jNWgSnRKT7YAKETFOYN9X Jlsat/4scmbZY4stnv769mUebF/Ej10DMzE3I6RocjDlrxPy1Pcj8YQDn3urQI07i1 qZC1nrKzjt9LvqnFuzZL/uBA5oB2l8+4vJCSLZQA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= , Stephan Gerhold , Linus Walleij Subject: [PATCH 5.12 129/173] drm/mcde: Fix off by 10^3 in calculation Date: Mon, 14 Jun 2021 12:27:41 +0200 Message-Id: <20210614102702.459333664@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210614102658.137943264@linuxfoundation.org> References: <20210614102658.137943264@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Linus Walleij commit c8a570443943304cac2e4186dbce6989b6c2b8b5 upstream. 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 = 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älä Reported-by: Stephan Gerhold Fixes: 920dd1b1425b ("drm/mcde: Use mode->clock instead of reverse calculating it from the vrefresh") Signed-off-by: Linus Walleij Tested-by: Stephan Gerhold Reviewed-by: Stephan Gerhold Link: https://patchwork.freedesktop.org/patch/msgid/20210608213318.3897858-1-linus.walleij@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/mcde/mcde_dsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- 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(st * porches and sync. */ /* (ps/s) / (pixels/s) = ps/pixels */ - pclk = DIV_ROUND_UP_ULL(1000000000000, mode->clock); + pclk = DIV_ROUND_UP_ULL(1000000000000, (mode->clock * 1000)); dev_dbg(d->dev, "picoseconds between two pixels: %llu\n", pclk);