From patchwork Fri Jan 17 15:51:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 3505951 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8AA7B9F2E9 for ; Fri, 17 Jan 2014 15:52:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BA1072015E for ; Fri, 17 Jan 2014 15:52:19 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id A451E200D7 for ; Fri, 17 Jan 2014 15:52:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9B7F5106751 for ; Fri, 17 Jan 2014 07:52:18 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-qe0-f51.google.com (mail-qe0-f51.google.com [209.85.128.51]) by gabe.freedesktop.org (Postfix) with ESMTP id E3D84106751 for ; Fri, 17 Jan 2014 07:51:38 -0800 (PST) Received: by mail-qe0-f51.google.com with SMTP id d4so3290416qej.38 for ; Fri, 17 Jan 2014 07:51:38 -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=GX+um2LcsZjGkeGmiIxQMBHuwPJ/sbJhWnkhBIiQ+cs=; b=zjv6qt71IRNSMpRQ2V05mpNNmi9Xpg8q8xteLW9p5QM1oUfZxLVOJVcDWIVtWYbZWi OdHuBJOh3JVNi2V0tqns6nknYQLmf4MTUEGVRdf9A8ntkdgkMALSvQ6EzlGgidwPg4Pu 0HW6Ie6GtBhW4NDntBD/4hwaT5uH1Mw6TnFpY56XnkSeKDVxCH4f8FUiL+X5cRHRKV/9 /tSH1pELzD3U47KzUjSqVLrdFFcpiivnYURBt+azDLPMx02LsGXkANW1ka+ed6I916B/ avNQxnagoqaDAp/K0hxX/Tsylk+B2hijSFE4MRa+GZXXOSk6jH9n0gBBaBC+pp0ajkB+ tpmg== X-Received: by 10.224.115.19 with SMTP id g19mr4188541qaq.95.1389973898366; Fri, 17 Jan 2014 07:51:38 -0800 (PST) Received: from localhost.localdomain ([177.96.29.155]) by mx.google.com with ESMTPSA id w104sm2901857qge.5.2014.01.17.07.51.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Jan 2014 07:51:37 -0800 (PST) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Fri, 17 Jan 2014 13:51:13 -0200 Message-Id: <1389973873-2005-5-git-send-email-przanoni@gmail.com> X-Mailer: git-send-email 1.8.4.2 In-Reply-To: <1389973873-2005-1-git-send-email-przanoni@gmail.com> References: <1389973873-2005-1-git-send-email-przanoni@gmail.com> Cc: Paulo Zanoni Subject: [Intel-gfx] [PATCH 8/3] drm/i915: WARN in case we're enabling the pipe and it's enabled 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+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.4 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: Paulo Zanoni ... and QUIRK_PIPEA_FORCE is not present. I initially thought that case was impossible and just added a WARN on it, but then I was told this case is possible due to QUIRK_PIPEA_FORCE. So let's add a WARN that serves two purposes: - tell us in case we have done something wrong; - document the only case where we expect this. Signed-off-by: Paulo Zanoni Reviewed-by: Damien Lespiau --- drivers/gpu/drm/i915/intel_display.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 9f356f9..e2df886 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -1791,8 +1791,11 @@ static void intel_enable_pipe(struct intel_crtc *crtc) reg = PIPECONF(cpu_transcoder); val = I915_READ(reg); - if (val & PIPECONF_ENABLE) + if (val & PIPECONF_ENABLE) { + WARN_ON(!(pipe == PIPE_A && + dev_priv->quirks & QUIRK_PIPEA_FORCE)); return; + } I915_WRITE(reg, val | PIPECONF_ENABLE); POSTING_READ(reg);