From patchwork Wed Oct 24 09:29:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 1636681 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 35115DFAF2 for ; Wed, 24 Oct 2012 09:29:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934538Ab2JXJ3w (ORCPT ); Wed, 24 Oct 2012 05:29:52 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:59720 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934527Ab2JXJ3r (ORCPT ); Wed, 24 Oct 2012 05:29:47 -0400 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id q9O9TlRr022830; Wed, 24 Oct 2012 04:29:47 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q9O9TlFg018966; Wed, 24 Oct 2012 04:29:47 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by dfle72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.1.323.3; Wed, 24 Oct 2012 04:29:47 -0500 Received: from deskari.tieu.ti.com (h64-3.vpn.ti.com [172.24.64.3]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id q9O9TOBO028560; Wed, 24 Oct 2012 04:29:45 -0500 From: Tomi Valkeinen To: , , CC: Tomi Valkeinen , Ricardo Neri Subject: [PATCH 14/20] OMAPDSS: HDMI: make hdmi pclk check more permissive Date: Wed, 24 Oct 2012 12:29:05 +0300 Message-ID: <1351070951-18616-15-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1351070951-18616-1-git-send-email-tomi.valkeinen@ti.com> References: <1351070951-18616-1-git-send-email-tomi.valkeinen@ti.com> MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org The hdmi driver tries to find the given video timings from its static list of timings, to find the required ID for the mode. The check tries to find exact match for the pixel clock, among other checks. with omapfb driver there can be some amount of error in the give pixel clock, as the pixel clock is converted between Hz and ps, thus the hdmi's check fails to find the mode. This patch makes the check more allowing, by rounding the pixel clocks to nearest MHz. Signed-off-by: Tomi Valkeinen Cc: Ricardo Neri --- drivers/video/omap2/dss/hdmi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c index dfbc1e7..90cc1b1 100644 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c @@ -404,7 +404,8 @@ static bool hdmi_timings_compare(struct omap_video_timings *timing1, { int timing1_vsync, timing1_hsync, timing2_vsync, timing2_hsync; - if ((timing2->pixel_clock == timing1->pixel_clock) && + if ((DIV_ROUND_CLOSEST(timing2->pixel_clock, 1000) == + DIV_ROUND_CLOSEST(timing1->pixel_clock, 1000)) && (timing2->x_res == timing1->x_res) && (timing2->y_res == timing1->y_res)) {