From patchwork Fri Jan 8 13:22:48 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 71781 X-Patchwork-Delegate: tomi.valkeinen@nokia.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o08DMKBi013169 for ; Fri, 8 Jan 2010 13:22:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753211Ab0AHNWm (ORCPT ); Fri, 8 Jan 2010 08:22:42 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753343Ab0AHNWk (ORCPT ); Fri, 8 Jan 2010 08:22:40 -0500 Received: from smtp.nokia.com ([192.100.122.230]:25342 "EHLO mgw-mx03.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753211Ab0AHNWh (ORCPT ); Fri, 8 Jan 2010 08:22:37 -0500 Received: from esebh105.NOE.Nokia.com (esebh105.ntc.nokia.com [172.21.138.211]) by mgw-mx03.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o08DMTVb019736; Fri, 8 Jan 2010 15:22:35 +0200 Received: from esebh102.NOE.Nokia.com ([172.21.138.183]) by esebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 8 Jan 2010 15:22:27 +0200 Received: from mgw-da02.ext.nokia.com ([147.243.128.26]) by esebh102.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Fri, 8 Jan 2010 15:22:27 +0200 Received: from localhost.localdomain (esdhcp04146.research.nokia.com [172.21.41.46]) by mgw-da02.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o08DM1QO024564; Fri, 8 Jan 2010 15:22:23 +0200 From: Tomi Valkeinen To: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org Cc: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= Subject: [PATCH 14/15] DSS2: Reject scaling settings when they cannot be supported Date: Fri, 8 Jan 2010 15:22:48 +0200 Message-Id: <1262956969-1664-15-git-send-email-tomi.valkeinen@nokia.com> X-Mailer: git-send-email 1.6.5 In-Reply-To: <1262956969-1664-14-git-send-email-tomi.valkeinen@nokia.com> References: <1262956969-1664-1-git-send-email-tomi.valkeinen@nokia.com> <1262956969-1664-2-git-send-email-tomi.valkeinen@nokia.com> <1262956969-1664-3-git-send-email-tomi.valkeinen@nokia.com> <1262956969-1664-4-git-send-email-tomi.valkeinen@nokia.com> <1262956969-1664-5-git-send-email-tomi.valkeinen@nokia.com> <1262956969-1664-6-git-send-email-tomi.valkeinen@nokia.com> <1262956969-1664-7-git-send-email-tomi.valkeinen@nokia.com> <1262956969-1664-8-git-send-email-tomi.valkeinen@nokia.com> <1262956969-1664-9-git-send-email-tomi.valkeinen@nokia.com> <1262956969-1664-10-git-send-email-tomi.valkeinen@nokia.com> <1262956969-1664-11-git-send-email-tomi.valkeinen@nokia.com> <1262956969-1664-12-git-send-email-tomi.valkeinen@nokia.com> <1262956969-1664-13-git-send-email-tomi.valkeinen@nokia.com> <1262956969-1664-14-git-send-email-tomi.valkeinen@nokia.com> MIME-Version: 1.0 X-OriginalArrivalTime: 08 Jan 2010 13:22:27.0819 (UTC) FILETIME=[9FA863B0:01CA9065] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index e2e0f9a..de8bfba 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c @@ -1454,7 +1454,10 @@ static unsigned long calc_fclk_five_taps(u16 width, u16 height, do_div(tmp, 2 * out_height * ppl); fclk = tmp; - if (height > 2 * out_height && ppl != out_width) { + if (height > 2 * out_height) { + if (ppl == out_width) + return 0; + tmp = pclk * (height - 2 * out_height) * out_width; do_div(tmp, 2 * out_height * (ppl - out_width)); fclk = max(fclk, (u32) tmp); @@ -1634,7 +1637,7 @@ static int _dispc_setup_plane(enum omap_plane plane, DSSDBG("required fclk rate = %lu Hz\n", fclk); DSSDBG("current fclk rate = %lu Hz\n", dispc_fclk_rate()); - if (fclk > dispc_fclk_rate()) { + if (!fclk || fclk > dispc_fclk_rate()) { DSSERR("failed to set up scaling, " "required fclk rate = %lu Hz, " "current fclk rate = %lu Hz\n",