From patchwork Mon Jan 26 13:10:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 5709361 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9357A9F333 for ; Mon, 26 Jan 2015 13:10:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AE9FC20125 for ; Mon, 26 Jan 2015 13:10:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BADE8200F2 for ; Mon, 26 Jan 2015 13:10:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753184AbbAZNKi (ORCPT ); Mon, 26 Jan 2015 08:10:38 -0500 Received: from arroyo.ext.ti.com ([192.94.94.40]:38648 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751244AbbAZNKh (ORCPT ); Mon, 26 Jan 2015 08:10:37 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id t0QDAZCJ015307; Mon, 26 Jan 2015 07:10:35 -0600 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id t0QDAYWv011041; Mon, 26 Jan 2015 07:10:34 -0600 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.224.2; Mon, 26 Jan 2015 07:10:34 -0600 Received: from deskari.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t0QDAWHf017475; Mon, 26 Jan 2015 07:10:33 -0600 From: Tomi Valkeinen To: CC: Tomi Valkeinen , David Ung , "Antonino A. Daplas" Subject: [PATCH] fbdev: fix CVT vertical front and back porch values Date: Mon, 26 Jan 2015 15:10:30 +0200 Message-ID: <1422277830-5163-1-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.2.2 MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP CVT v1.1 spec says: "the vertical front porch shall in all cases be fixed to 3 lines". The code in fbcvt.c instead sets the _back_ porch to 3 (plus margin). After swapping cvt.v_front_porch and cvt.v_back_porch the resulting timings were in line with CVT timings in VESA DMT spec. The bug seems to be more than 9 years old, but I presume it has not been noticed as usually the video timings come from the EDID or from the timing tables in fbdev, and probably swapped values for vfp and vbp work fine for most of the displays. Signed-off-by: Tomi Valkeinen Cc: David Ung Cc: Antonino A. Daplas --- drivers/video/fbdev/core/fbcvt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/core/fbcvt.c b/drivers/video/fbdev/core/fbcvt.c index 7cb715dfc0e1..55d2bd0ce5c0 100644 --- a/drivers/video/fbdev/core/fbcvt.c +++ b/drivers/video/fbdev/core/fbcvt.c @@ -369,9 +369,9 @@ int fb_find_mode_cvt(struct fb_videomode *mode, int margins, int rb) cvt.h_back_porch = cvt.hblank/2 + cvt.h_margin; cvt.h_front_porch = cvt.hblank - cvt.hsync - cvt.h_back_porch + 2 * cvt.h_margin; - cvt.v_back_porch = 3 + cvt.v_margin; - cvt.v_front_porch = cvt.vtotal - cvt.yres/cvt.interlace - - cvt.v_back_porch - cvt.vsync; + cvt.v_front_porch = 3 + cvt.v_margin; + cvt.v_back_porch = cvt.vtotal - cvt.yres/cvt.interlace - + cvt.v_front_porch - cvt.vsync; fb_cvt_print_name(&cvt); fb_cvt_convert_to_mode(&cvt, mode);