From patchwork Sat Dec 14 22:38:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 3349601 Return-Path: X-Original-To: patchwork-intel-gfx@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 24B96C0D4A for ; Sat, 14 Dec 2013 22:38:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 48DA3206A5 for ; Sat, 14 Dec 2013 22:38:50 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 6AED9206A1 for ; Sat, 14 Dec 2013 22:38:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 24011FB82D; Sat, 14 Dec 2013 14:38:47 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-yh0-f44.google.com (mail-yh0-f44.google.com [209.85.213.44]) by gabe.freedesktop.org (Postfix) with ESMTP id 803E1FB7B0 for ; Sat, 14 Dec 2013 14:38:44 -0800 (PST) Received: by mail-yh0-f44.google.com with SMTP id f64so2657946yha.31 for ; Sat, 14 Dec 2013 14:38:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5N0w9SZY1b0FYDuy2Ll7zTBZZOhE9axkcHV32H0XoJY=; b=lCRaR7FQoynYIxDuem/mICWy2gZRlJ9SYo7Plty8/9dTJ6/hQaDQrMLf1bALWd77sB tH/vmeL/Z/Dqm1UueSSDhasb1oD+KnohbN9UE1ZkYsJ+aSOEhIAfTyXXXhI9WrbVINrF fQvoyTsp8IeZamuZkefGK+wPOgUwsFOE/MyAs36SWzzN6cySzh8t5V8AIvIf1mnsTXMw FiEaY/TT7EsE6wstrd16xqFXvQInMCVDA5F4euXr+BtACDY8nBd+bgY2fD14EtLZYM7D 3braMvGoxYtacvkhF+Y/2E3/LT+fyEFwtAxCREyi+eFlVrWjNES7cgQd3r060BNAUKZO jpUg== X-Received: by 10.236.83.7 with SMTP id p7mr1194041yhe.90.1387060724184; Sat, 14 Dec 2013 14:38:44 -0800 (PST) Received: from localhost.localdomain ([177.140.135.10]) by mx.google.com with ESMTPSA id h23sm10544321yhc.0.2013.12.14.14.38.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 Dec 2013 14:38:43 -0800 (PST) From: Rodrigo Vivi To: intel-gfx@lists.freedesktop.org Date: Sat, 14 Dec 2013 20:38:31 -0200 Message-Id: <1387060712-5081-5-git-send-email-rodrigo.vivi@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1387060712-5081-1-git-send-email-rodrigo.vivi@gmail.com> References: <1387060712-5081-1-git-send-email-rodrigo.vivi@gmail.com> Subject: [Intel-gfx] [PATCH 4/5] drm/i915: vlv: W/a for hotplug/manual VGA detection X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 From: Imre Deak At least on my VLV stepping VGA detection doesn't work in certain cases. One such case is when all pipes are off and VGA is plugged in. Another case reported by Joonas Lahtinen (also on the same stepping) is booting with VGA disconnected where we incorrectly report that VGA is connected. At least in the first case writing the FORCE bit in the ADPA reg will get stuck, i.e. the detection never completes. Both cases seem to be solved by disabling DPIO clock gating based on the PSR state. As I haven't found any trace that this would be a known issue, I can only speculate that both the DPIO HW block and the HW block responsible for VGA detection uses the same clock source which gets gated even though PSR is inactive. I haven't measured if and how this change affects our power savings. Reported-by: Joonas Lahtinen Signed-off-by: Imre Deak Signed-off-by: Rodrigo Vivi --- drivers/gpu/drm/i915/i915_reg.h | 3 +++ drivers/gpu/drm/i915/intel_pm.c | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index f1eece4..726c3ce 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h @@ -1451,6 +1451,9 @@ # define I965_FT_CLOCK_GATE_DISABLE (1 << 1) # define I965_DM_CLOCK_GATE_DISABLE (1 << 0) +#define DPPSR_CGDIS_VLV (dev_priv->info->display_mmio_offset + 0x6204) +# define DPIOUNIT_PSR_CLOCK_GATING_DISABLE (1 << 6) + #define RENCLK_GATE_D2 0x6208 #define VF_UNIT_CLOCK_GATE_DISABLE (1 << 9) #define GS_UNIT_CLOCK_GATE_DISABLE (1 << 7) diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index 465304a..4208065 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c @@ -5438,6 +5438,11 @@ static void valleyview_init_clock_gating(struct drm_device *dev) I915_WRITE(DSPCLK_GATE_D, VRHUNIT_CLOCK_GATE_DISABLE); + /* Wa to make VGA hotplug and manual detection work. */ + val = I915_READ(DPPSR_CGDIS_VLV); + val |= DPIOUNIT_PSR_CLOCK_GATING_DISABLE; + I915_WRITE(DPIOUNIT_PSR_CLOCK_GATING_DISABLE, val); + /* WaDisableEarlyCull:vlv */ I915_WRITE(_3D_CHICKEN3, _MASKED_BIT_ENABLE(_3D_CHICKEN_SF_DISABLE_OBJEND_CULL));