From patchwork Fri Dec 5 08:35:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 41966 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6B00B26669 for ; Fri, 5 Dec 2014 08:36:14 +0000 (UTC) Received: by mail-wg0-f69.google.com with SMTP id k14sf140234wgh.0 for ; Fri, 05 Dec 2014 00:36:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:subject:date :message-id:in-reply-to:references:cc:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :mime-version:content-type:content-transfer-encoding:errors-to :sender:x-original-sender:x-original-authentication-results :mailing-list; bh=NO60M8qnjYfgN3GIQJEzjXHT7wYy41PZm+AyIXOj7n4=; b=jv/3Ml/D40KIa1vpcIkJ6c+OvX4/p7fIKXascRHti0oNzJtqo1tSh6TSYJvvEO8HZk fr4Rjlyf16dZUyrJZoR+ea4bdVAN91dwEuSZ2EkLOTulqbMnVWe4zdfA1eYAikp7DSrV bPGetpe4E2PptBfYecsd5S5CBaCfOHyWCldwaGpPk9xW5paCzpjbm/avCTBTBYej5VJa dz68zLnDkDQbRUaSvOfddz8NpB8k+SELeg2Mesq9iYyiNRG9uU7R/5kHmZqG0geLXc9C A4UEwVKQvtb3aiJUG5ix3Cn27wW+hv9s6Tjd9Cwb716BeZpSCmwhQ9+D6toX2V7s6Ngb 5rSw== X-Gm-Message-State: ALoCoQmg1MXCDN1KdbKxK7KlD4vaRlRb/Ros4lfOogR+NuM/IJhES38kk406uvXZ4RTcBVpPF5E8 X-Received: by 10.112.154.194 with SMTP id vq2mr225829lbb.10.1417768573745; Fri, 05 Dec 2014 00:36:13 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.7.232 with SMTP id m8ls338256laa.45.gmail; Fri, 05 Dec 2014 00:36:13 -0800 (PST) X-Received: by 10.152.27.202 with SMTP id v10mr1687675lag.13.1417768573267; Fri, 05 Dec 2014 00:36:13 -0800 (PST) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com. [209.85.215.43]) by mx.google.com with ESMTPS id q5si28213369lbp.93.2014.12.05.00.36.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 05 Dec 2014 00:36:13 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by mail-la0-f43.google.com with SMTP id ge10so274071lab.30 for ; Fri, 05 Dec 2014 00:36:13 -0800 (PST) X-Received: by 10.152.2.165 with SMTP id 5mr1758607lav.40.1417768573186; Fri, 05 Dec 2014 00:36:13 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp173514lbc; Fri, 5 Dec 2014 00:36:12 -0800 (PST) X-Received: by 10.66.226.198 with SMTP id ru6mr776505pac.79.1417768568815; Fri, 05 Dec 2014 00:36:08 -0800 (PST) Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id og2si46580330pbc.104.2014.12.05.00.36.08 for ; Fri, 05 Dec 2014 00:36:08 -0800 (PST) Received-SPF: none (google.com: dri-devel-bounces@lists.freedesktop.org does not designate permitted sender hosts) client-ip=131.252.210.177; Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 624B96E470; Fri, 5 Dec 2014 00:36:07 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by gabe.freedesktop.org (Postfix) with ESMTP id 811E66E4A2 for ; Fri, 5 Dec 2014 00:36:04 -0800 (PST) Received: by mail-wg0-f50.google.com with SMTP id k14so264644wgh.37 for ; Fri, 05 Dec 2014 00:36:03 -0800 (PST) X-Received: by 10.194.238.3 with SMTP id vg3mr21675914wjc.69.1417768563836; Fri, 05 Dec 2014 00:36:03 -0800 (PST) Received: from lmenx321.lme.st.com (LPuteaux-656-1-48-212.w82-127.abo.wanadoo.fr. [82.127.83.212]) by mx.google.com with ESMTPSA id eu8sm1299618wib.21.2014.12.05.00.36.02 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 05 Dec 2014 00:36:03 -0800 (PST) From: Benjamin Gaignard To: dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org Subject: [PATCH 9/9] drm: sti: fix delay in VTG programming Date: Fri, 5 Dec 2014 09:35:07 +0100 Message-Id: <1417768507-7538-10-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1417768507-7538-1-git-send-email-benjamin.gaignard@linaro.org> References: <1417768507-7538-1-git-send-email-benjamin.gaignard@linaro.org> Cc: Benjamin Gaignard X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: benjamin.gaignard@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 The HDMI path introduce a delay of 6 pixels. This delay should be take into account while programming VTG for the HDMI. Without this delay, the HDMI active window area is shift of 6 pixel on the right. Set also timing for DVO output. Signed-off-by: Benjamin Gaignard --- drivers/gpu/drm/sti/sti_vtg.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/sti/sti_vtg.c b/drivers/gpu/drm/sti/sti_vtg.c index 740d6e3..ce7c0c9 100644 --- a/drivers/gpu/drm/sti/sti_vtg.c +++ b/drivers/gpu/drm/sti/sti_vtg.c @@ -55,6 +55,9 @@ #define VTG_IRQ_TOP BIT(1) #define VTG_IRQ_MASK (VTG_IRQ_TOP | VTG_IRQ_BOTTOM) +/* Delay introduced by the HDMI in nb of pixel */ +#define HDMI_DELAY (6) + /* delay introduced by the Arbitrary Waveform Generator in nb of pixels */ #define AWG_DELAY_HD (-9) #define AWG_DELAY_ED (-8) @@ -133,10 +136,10 @@ static void vtg_set_mode(struct sti_vtg *vtg, writel(tmp, vtg->regs + VTG_VID_TFS); writel(tmp, vtg->regs + VTG_VID_BFS); - /* prepare VTG set 1 and 2 for HDMI and VTG set 3 for HD DAC */ - tmp = (mode->hsync_end - mode->hsync_start) << 16; + /* prepare VTG set 1 for HDMI */ + tmp = (mode->hsync_end - mode->hsync_start + HDMI_DELAY) << 16; + tmp |= HDMI_DELAY; writel(tmp, vtg->regs + VTG_H_HD_1); - writel(tmp, vtg->regs + VTG_H_HD_2); tmp = (mode->vsync_end - mode->vsync_start + 1) << 16; tmp |= 1; @@ -146,6 +149,11 @@ static void vtg_set_mode(struct sti_vtg *vtg, writel(0, vtg->regs + VTG_BOT_V_HD_1); /* prepare VTG set 2 for for HD DCS */ + tmp = (mode->hsync_end - mode->hsync_start) << 16; + writel(tmp, vtg->regs + VTG_H_HD_2); + + tmp = (mode->vsync_end - mode->vsync_start + 1) << 16; + tmp |= 1; writel(tmp, vtg->regs + VTG_TOP_V_VD_2); writel(tmp, vtg->regs + VTG_BOT_V_VD_2); writel(0, vtg->regs + VTG_TOP_V_HD_2); @@ -166,6 +174,17 @@ static void vtg_set_mode(struct sti_vtg *vtg, writel(tmp, vtg->regs + VTG_TOP_V_HD_3); writel(tmp, vtg->regs + VTG_BOT_V_HD_3); + /* Prepare VTG set 4 for DVO */ + tmp = (mode->hsync_end - mode->hsync_start) << 16; + writel(tmp, vtg->regs + VTG_H_HD_4); + + tmp = (mode->vsync_end - mode->vsync_start + 1) << 16; + tmp |= 1; + writel(tmp, vtg->regs + VTG_TOP_V_VD_4); + writel(tmp, vtg->regs + VTG_BOT_V_VD_4); + writel(0, vtg->regs + VTG_TOP_V_HD_4); + writel(0, vtg->regs + VTG_BOT_V_HD_4); + /* mode */ writel(type, vtg->regs + VTG_MODE); }