Message ID | 20171226111227.4526-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 91F7460211 for <patchwork-linux-arm@patchwork.kernel.org>; Tue, 26 Dec 2017 11:12:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 89BC92D15F for <patchwork-linux-arm@patchwork.kernel.org>; Tue, 26 Dec 2017 11:12:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7CC612E50B; Tue, 26 Dec 2017 11:12:25 +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 11CAC2E504 for <patchwork-linux-arm@patchwork.kernel.org>; Tue, 26 Dec 2017 11:12:25 +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=Ynal8RsylQdqo8DcNXtmlbj42nLq2UR7DYAd0IvEzAs=; b=t82/iHoKhCD54cLkv5ry+ZlnJa /LguZtDlCkRJNpdNIA1SM+Eowl3WH28K43Z+wLGVFcsESOCLK14dEmtU7n2mfUBT4sVMIFt4QUP+R rT+lKOiB3m6jOLfISYBoxEZ2ccrSx2QwB9UANT8ZFj+QcADJmFRHiR618SVzQfTdLe87dYQUym2a7 x1xROUWOFfadqjMRXXuesQhWvD+gi7Sy0/26mzWdZCtrW9VNw0hCBt+kCiYibLHf6W7X73GWqd5Z5 wANQSvOqnLPide9lgZCTQ7OdTlgAlGnFv3SpPfPHpOS4QOdVblteKPsXEuN4GGDzN3MbrR2iioR1V RhP2ndqw==; 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 1eTn9g-0006jU-26; Tue, 26 Dec 2017 11:12:20 +0000 Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eTn7l-0005fR-WD for linux-arm-kernel@lists.infradead.org; Tue, 26 Dec 2017 11:10:23 +0000 Received: by mail-pg0-x244.google.com with SMTP id f18so1019880pga.10 for <linux-arm-kernel@lists.infradead.org>; Tue, 26 Dec 2017 03:10:11 -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=bqGxEHu2k4r5KqqKLeK3m7gjNvALJXRtY7bjFVxv6U0=; b=ArUnXqni6ptXbCTyfvEekEUJZiu9C2riFxznfPod5SoIUpm24oTysMR4ZUQYKSdo2M +JRxevprEDvF8BSQVYw1QpiTdx2qjPbccMfoQRSV0Y3lo+jNOgOpIsVV7XB1y7smipt7 SOoU/7ojICLMNxckH3sGUa0RXlp70uaJgoSTIaqpdtUxpaa3jG3UxmYAO1fedZF10w7S 0jNj1TbSMdzTrlM+SeS2VlNAvoOSrACYhdvwyXRy3UEAJT/O9wv7X+jh0tPQv0X8U5nR QsPjzVTO3vK2LC6Dkxmlq2QDt98ZvSkApmZp3WhIMfxwVbgkDufn70t1SSvmnbN7kCbO OrIA== 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=bqGxEHu2k4r5KqqKLeK3m7gjNvALJXRtY7bjFVxv6U0=; b=trvUFla0tmg+Pp4SobUwKPgTZPOWtjWvtQRqy1aKyIA9fMElZmYD1JZh0exAvfqNYm 3thrj+juFjX7q1P+kZ09qdyr7cdsft3r7eeOh3m0dGYTV5VI0EBqVZkZpXLpyE2H+0hb Nd9Gmk9SFloTqJPC4Qz3vSVn2UUah0F9FjSVBlKk/5gU83SQ6T1NcGoUnUt4BIlA6kQy IWKcFl6M77JS/NeMe+82qnCKlWm4dw5Kksyoah3ycAffYpzSAagT9r0K+hfJjXnaCHz3 OOZMegypRsTu27d/skCLN1rugFLdfOumOVhq1Q72fsGfTgk2mo4dKEfQ3hB+M1GuTFf1 yc+Q== X-Gm-Message-State: AKGB3mLuhwdhE+i3hta3bkUUFIKoOSuSQ+Q8qb60gCCPNoUEN0Js4XwQ aC5xH+Gw1gMzkjh5GqriY4c= X-Google-Smtp-Source: ACJfBot2ccbNTpCWPqdgxsRghuFILwLbJ8SWCC9uwFyG9mmDxIUrSlyab+99DzmrWQRcPggkVhH6PQ== X-Received: by 10.101.89.5 with SMTP id f5mr22388990pgu.370.1514286610970; Tue, 26 Dec 2017 03:10:10 -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 q24sm60633048pfk.168.2017.12.26.03.10.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Dec 2017 03:10:10 -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 v2 3/3] drm/sun4i: hdmi: Add missing rate halving check in sun4i_tmds_determine_rate Date: Tue, 26 Dec 2017 22:12:27 +1100 Message-Id: <20171226111227.4526-4-net147@gmail.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171226111227.4526-1-net147@gmail.com> References: <20171226111227.4526-1-net147@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171226_031022_034816_10F82DB6 X-CRM114-Status: GOOD ( 12.59 ) 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(-)