Message ID | 20180109020323.11852-4-net147@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 962BE60210 for <patchwork-linux-arm@patchwork.kernel.org>; Tue, 9 Jan 2018 02:08:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 893C728AEB for <patchwork-linux-arm@patchwork.kernel.org>; Tue, 9 Jan 2018 02:08:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7DDEB28AED; Tue, 9 Jan 2018 02:08:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 132D628AEB for <patchwork-linux-arm@patchwork.kernel.org>; Tue, 9 Jan 2018 02:08:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=iQSxNW7+466UuN1Gc865KKER8p2xPXPeO8gq8jCQ84Y=; b=K+X72GJNujjNRvI2+KFwFILaTc hO0DEYOjG1G8TqCFAK6YBtU7Y4qhMa35+ErnY6cu3xglSO6Z3L+XwUvVQ1OrWQeHJPM/YgLavMQyd dCwWpDfmuizx42wp2pTHDqG9G6RPSnxcOEpmp89WtpyQkgvdDgo3nzuaHjsPErKvaQCDarJknRDwz MwxW/Nb0DUOGNG17X8sfnhhYsj34uAuNZpXloA1LuxQ8TMAuoQv3ORbjxFj7Om/FULEebC+oLqOek wdAeB9ChqbCantqq5TBUgpXSLu43dITXK8LR86fLmO1sQVUbMRpYXTPY+XSJ4TWiN2kqFMu3tIFQ1 sm2VZAig==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eYjKl-00036v-LB; Tue, 09 Jan 2018 02:08:11 +0000 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eYjGb-0008R5-M7 for linux-arm-kernel@lists.infradead.org; Tue, 09 Jan 2018 02:04:07 +0000 Received: by mail-pf0-x242.google.com with SMTP id j3so3586871pfh.8 for <linux-arm-kernel@lists.infradead.org>; Mon, 08 Jan 2018 18:03:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=wehpzekEmdS+w+XwvE65sTVMqxFWmmKT/xYvSW+zEf0=; b=SoybwBOfB7/Xq8kYY648OXpOr0rZXAOKSYJz2NzCFNWvjIrvq/EoiZzm1f6cNn+Bvg jS6F46WIvXM54kbh+Db6937gA49gPc/Cb9bbu9i8f9El8k6xyFbqMBgoPx2vt36OD6iC m4p5q6BhE9i1FaGooaDXN+z28zutzUa+LW0+rAgV/bNaCRxZpb99h5PK4Qhp4eKTV4c2 raVBkOyChHLhytrMI7zrLPz/JIbVWwFqnLmFKDnQwTl2Rv9O/lVMeSBafLnOvHDI71/v uctcFmO8Jag0/QUzOKxPfIZ31HiMjm3uvb1vn3n7oy9sDwQdjgGgWnJnQf8qiZcxt3z/ X2Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=wehpzekEmdS+w+XwvE65sTVMqxFWmmKT/xYvSW+zEf0=; b=k6xrSdnziEULIzidtbqA52nAqxuB03nnLjVRiUo5l+npKrL+Q7c0HXnSJ2qO5b01el qcYWUQI3K399G5Bru3PlB7juvnXwMek4MWf+PWy8eOZS8oio++sElAUfXsq1cv8vcJAo pWQuRaSP2PyjJW7DT+yUQOhPG36CrGwySKGEzJr1RUTEg5r4EA8CSIkkNjXdWv1fSNPw 4VUKY4Kt51K9CCiEJNSaXSJNvBiKb2uvljAXbi9wyPAOsu8UbYKKOPLFvsD7bOAVpI+s 3NTJtEh0F7qpN4VqCIPgvt2SLSuMr58oPL/xrEDyXZzsBaQgRNYtsxpP+sYjvodr4mGX e82A== X-Gm-Message-State: AKGB3mJKrmyf6jSQV5KPpHR605tNoAqQKj/h8EAfXCiTgipDwAIJZWQ/ S8YQYjRMc7l2t5HZDhHL3mA= X-Google-Smtp-Source: ACJfBouoZMBT4SkbRuloHk8mfSZH+xxRgUBRrOsDhmz245ckYnW/yA5sVcJuoM55zmx+AGoCT8Bjiw== X-Received: by 10.159.208.2 with SMTP id a2mr13846285plp.371.1515463422405; Mon, 08 Jan 2018 18:03:42 -0800 (PST) Received: from 60-242-179-244.static.tpgi.com.au (60-242-179-244.static.tpgi.com.au. [60.242.179.244]) by smtp.gmail.com with ESMTPSA id t75sm24022750pgc.30.2018.01.08.18.03.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Jan 2018 18:03:41 -0800 (PST) From: Jonathan Liu <net147@gmail.com> To: Maxime Ripard <maxime.ripard@free-electrons.com>, David Airlie <airlied@linux.ie>, Chen-Yu Tsai <wens@csie.org> Subject: [PATCH v3 3/3] drm/sun4i: hdmi: Add missing rate halving check in sun4i_tmds_determine_rate Date: Tue, 9 Jan 2018 13:03:23 +1100 Message-Id: <20180109020323.11852-4-net147@gmail.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180109020323.11852-1-net147@gmail.com> References: <20180109020323.11852-1-net147@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180108_180354_776619_A36663A7 X-CRM114-Status: GOOD ( 12.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Cc: linux-arm-kernel@lists.infradead.org, linux-sunxi@googlegroups.com, Jonathan Liu <net147@gmail.com>, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c index 88eeeaf34638..3ecffa52c814 100644 --- a/drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c +++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c @@ -102,9 +102,12 @@ static int sun4i_tmds_determine_rate(struct clk_hw *hw, goto out; } - if (!best_parent || abs(rate - rounded / i) < - abs(rate - best_parent / best_div)) { + if (!best_parent || + abs(rate - rounded / i / j) < + abs(rate - best_parent / best_half / + best_div)) { best_parent = rounded; + best_half = i; best_div = j; } }
It was only checking the divider when determing the closest match if it could not match the requested rate exactly. For a projector connected to an Olimex A20-OLinuXino-LIME using HDMI with a native resolution of 1280x800 and pixel clock of 83.5 MHz, this resulted in 1280x800 mode not being available and the following in dmesg when the kernel is booted with drm.debug=0x3e: [drm:drm_mode_debug_printmodeline] Modeline 37:"1280x800" 60 83500 1280 1352 1480 1680 800 810 816 831 0x48 0x5 [drm:drm_mode_prune_invalid] Not using 1280x800 mode: NOCLOCK Fixes: 9c5681011a0c ("drm/sun4i: Add HDMI support") Signed-off-by: Jonathan Liu <net147@gmail.com> --- drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)