From patchwork Thu Jan 2 21:26:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King X-Patchwork-Id: 3431931 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4F8EEC02DC for ; Fri, 3 Jan 2014 15:25:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 40D7620127 for ; Fri, 3 Jan 2014 15:25:42 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 5D74820108 for ; Fri, 3 Jan 2014 15:25:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B8F56FAB54; Fri, 3 Jan 2014 07:25:28 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from pandora.arm.linux.org.uk (gw-1.arm.linux.org.uk [78.32.30.217]) by gabe.freedesktop.org (Postfix) with ESMTP id 42524FB913 for ; Thu, 2 Jan 2014 13:31:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=arm.linux.org.uk; s=pandora; h=Date:Sender:Message-Id:Subject:Cc:To:From:References:In-Reply-To; bh=MuQOWw4y0MKX4MPVChyi8PYsHM/S93V1LsVUYAXS+C8=; b=SOeNko3N9dxPEyQrN/TewUJH0O3yt+5QnJlq/iuY33B86i2KC7EL87nxtT4N0Io1oatz4edDmS5Lv1hXv4AJw9Ook8uupc8xHd/jlRXJObR9e2m0Bvl3wLIKruT5bv6BqxQ8NDY4UmAGpJkG2olBJHY1Ki0lT63cf3F7oux/iZ4=; Received: from [2001:4d48:ad52:3201:222:68ff:fe15:37dd] (port=58591 helo=rmk-PC.arm.linux.org.uk) by pandora.arm.linux.org.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1Vypms-00049j-Cr; Thu, 02 Jan 2014 21:26:42 +0000 Received: from rmk by rmk-PC.arm.linux.org.uk with local (Exim 4.76) (envelope-from ) id 1Vypms-0007EF-0J; Thu, 02 Jan 2014 21:26:42 +0000 In-Reply-To: <20140102212528.GD7383@n2100.arm.linux.org.uk> References: <20140102212528.GD7383@n2100.arm.linux.org.uk> From: Russell King To: David Airlie , Greg Kroah-Hartman , Sascha Hauer , Shawn Guo Subject: [PATCH RFC 11/46] imx-drm: imx-hdmi: fix pixel clock Message-Id: Date: Thu, 02 Jan 2014 21:26:42 +0000 X-Mailman-Approved-At: Fri, 03 Jan 2014 07:21:55 -0800 Cc: devel@driverdev.osuosl.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 The correct pixel clock can be found in the drm_display_mode structure. Use this rather than trying to calculate it from the h/v total and the refresh rate, which can be inaccurate. Signed-off-by: Russell King --- drivers/staging/imx-drm/imx-hdmi.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/staging/imx-drm/imx-hdmi.c b/drivers/staging/imx-drm/imx-hdmi.c index ff00759b4d6f..fe3a6779b620 100644 --- a/drivers/staging/imx-drm/imx-hdmi.c +++ b/drivers/staging/imx-drm/imx-hdmi.c @@ -1206,8 +1206,7 @@ static void hdmi_av_composer(struct imx_hdmi *hdmi, vmode->mhsyncpolarity = !!(mode->flags & DRM_MODE_FLAG_PHSYNC); vmode->mvsyncpolarity = !!(mode->flags & DRM_MODE_FLAG_PVSYNC); vmode->minterlaced = !!(mode->flags & DRM_MODE_FLAG_INTERLACE); - vmode->mpixelclock = mode->htotal * mode->vtotal * - drm_mode_vrefresh(mode); + vmode->mpixelclock = mode->clock * 1000; dev_dbg(hdmi->dev, "final pixclk = %d\n", vmode->mpixelclock);