From patchwork Sun Jul 1 21:46:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dhinakaran Pandiyan X-Patchwork-Id: 10500261 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 62A6260230 for ; Sun, 1 Jul 2018 21:47:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B4F428306 for ; Sun, 1 Jul 2018 21:47:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2F0592835B; Sun, 1 Jul 2018 21:47:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 58EFF28306 for ; Sun, 1 Jul 2018 21:47:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AA2476E11B; Sun, 1 Jul 2018 21:47:00 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-io0-x242.google.com (mail-io0-x242.google.com [IPv6:2607:f8b0:4001:c06::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id DC9EB6E11B for ; Sun, 1 Jul 2018 21:46:58 +0000 (UTC) Received: by mail-io0-x242.google.com with SMTP id i23-v6so13042938iog.10 for ; Sun, 01 Jul 2018 14:46:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=v6Uym9mogO9bpj4ehiFVxl+Y+fO8DT5wyzxTMQKm9Dw=; b=mlwrb1YOrnDfe4Sz/Xa6YzRgJ6Z8jFE9ZJ1si5A0IR7Zbl1wQd9JSA46wBBOl7JoJc pL3ZjyBEHB4W1Kq7ULcdJ8DN5wQKdhYCaCnc01dqTKvds1JpOGs1tOVWSZexYEs9L/f5 VpCuR0VVGMkzyomKUPmayBhYDVJWcqfVW+RV776622KAGfJ+9To7HHDF15lTdrMGorxz 9WAOE0bTizk488YwVQGFQ8SddQwLxwMqlB0jOUD1dioMZ+ah/90or3tKMpW9NfCAr/8c KqTW02lDc73npls4YNcgq/NDlVNvycijrdnMXcCTbuRGQi5T4dm85hmaNfBSu/8WfXfC e/jg== X-Gm-Message-State: APt69E0RMAaR/GV8FC24olHRip/sR8Sa6LCzbT+LEcTqYWBklfL6tXAg 0jyuFdaPew8qsl22eSkG/1hsZQ== X-Google-Smtp-Source: AAOMgpeN7h2GPZ66uSvmGPrVcbWNt/T1yHDB0pb77OvbYOTHtFknmXyUIB4Jm7W49viYx+hxkBQ4Ww== X-Received: by 2002:a6b:f20e:: with SMTP id q14-v6mr17701927ioh.4.1530481617904; Sun, 01 Jul 2018 14:46:57 -0700 (PDT) Received: from dk-ThinkPad-X260.jf.intel.com (50-39-164-98.bvtn.or.frontiernet.net. [50.39.164.98]) by smtp.gmail.com with ESMTPSA id f8-v6sm2518235ioe.46.2018.07.01.14.46.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Jul 2018 14:46:56 -0700 (PDT) From: Dhinakaran Pandiyan X-Google-Original-From: Dhinakaran Pandiyan To: intel-gfx@lists.freedesktop.org Date: Sun, 1 Jul 2018 14:46:45 -0700 Message-Id: <20180701214645.5956-1-dhinakaran.pandiyan@intel.com> X-Mailer: git-send-email 2.14.1 Subject: [Intel-gfx] [PATCH] drm/i915/psr: Prevent DC5/6 entry when reading pipe CRCs X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dhinakaran Pandiyan , Paulo Zanoni MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP We've seen pipe CRC related failures in CI when PSR is enabled. Since pipe A can be disabled by DMC when PSR is enabled, it is likely that CRCs aren't available. Grab a power domain reference to enable DC_OFF power well to handle this. It might well be possible that CRC's are wrong or unavailable with PSR irrespective of DMC, but let's start with this. References: https://bugs.freedesktop.org/show_bug.cgi?id=106103 References: https://bugs.freedesktop.org/show_bug.cgi?id=105750 Cc: Imre Deak Cc: Paulo Zanoni Signed-off-by: Dhinakaran Pandiyan --- drivers/gpu/drm/i915/intel_display.h | 1 + drivers/gpu/drm/i915/intel_pipe_crc.c | 9 +++++++++ drivers/gpu/drm/i915/intel_runtime_pm.c | 7 +++++++ 3 files changed, 17 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_display.h b/drivers/gpu/drm/i915/intel_display.h index a77dd29db2ec..5cbdf9a7846d 100644 --- a/drivers/gpu/drm/i915/intel_display.h +++ b/drivers/gpu/drm/i915/intel_display.h @@ -204,6 +204,7 @@ enum intel_display_power_domain { POWER_DOMAIN_AUX_TBT3, POWER_DOMAIN_AUX_TBT4, POWER_DOMAIN_GMBUS, + POWER_DOMAIN_PIPE_A_CRC, POWER_DOMAIN_MODESET, POWER_DOMAIN_GT_IRQ, POWER_DOMAIN_INIT, diff --git a/drivers/gpu/drm/i915/intel_pipe_crc.c b/drivers/gpu/drm/i915/intel_pipe_crc.c index 39a4e4edda07..5888d8d511ef 100644 --- a/drivers/gpu/drm/i915/intel_pipe_crc.c +++ b/drivers/gpu/drm/i915/intel_pipe_crc.c @@ -922,6 +922,7 @@ int intel_crtc_set_crc_source(struct drm_crtc *crtc, const char *source_name, enum intel_pipe_crc_source source; u32 val = 0; /* shut up gcc */ int ret = 0; + bool dc_off = false; if (display_crc_ctl_parse_source(source_name, &source) < 0) { DRM_DEBUG_DRIVER("unknown source %s\n", source_name); @@ -938,11 +939,19 @@ int intel_crtc_set_crc_source(struct drm_crtc *crtc, const char *source_name, if (ret != 0) goto out; + dc_off = dev_priv->csr.dmc_payload && power_domain == POWER_DOMAIN_PIPE_A; + if (dc_off && source) + intel_display_power_get(dev_priv, POWER_DOMAIN_PIPE_A_CRC); + pipe_crc->source = source; I915_WRITE(PIPE_CRC_CTL(crtc->index), val); POSTING_READ(PIPE_CRC_CTL(crtc->index)); if (!source) { + if (dc_off) + intel_display_power_put(dev_priv, + POWER_DOMAIN_PIPE_A_CRC); + if (IS_G4X(dev_priv)) g4x_undo_pipe_scramble_reset(dev_priv, crtc->index); else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c index d81b2cfe1c5e..fd12bba1be3b 100644 --- a/drivers/gpu/drm/i915/intel_runtime_pm.c +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c @@ -144,6 +144,8 @@ intel_display_power_domain_str(enum intel_display_power_domain domain) return "AUX_TBT4"; case POWER_DOMAIN_GMBUS: return "GMBUS"; + case POWER_DOMAIN_PIPE_A_CRC: + return "PIPE_A_CRC:"; case POWER_DOMAIN_INIT: return "INIT"; case POWER_DOMAIN_MODESET: @@ -1800,6 +1802,7 @@ void intel_display_power_put(struct drm_i915_private *dev_priv, BIT_ULL(POWER_DOMAIN_GT_IRQ) | \ BIT_ULL(POWER_DOMAIN_MODESET) | \ BIT_ULL(POWER_DOMAIN_AUX_A) | \ + BIT_ULL(POWER_DOMAIN_PIPE_A_CRC) | \ BIT_ULL(POWER_DOMAIN_INIT)) #define BXT_DISPLAY_POWERWELL_2_POWER_DOMAINS ( \ @@ -1822,6 +1825,7 @@ void intel_display_power_put(struct drm_i915_private *dev_priv, BIT_ULL(POWER_DOMAIN_GT_IRQ) | \ BIT_ULL(POWER_DOMAIN_MODESET) | \ BIT_ULL(POWER_DOMAIN_AUX_A) | \ + BIT_ULL(POWER_DOMAIN_PIPE_A_CRC) | \ BIT_ULL(POWER_DOMAIN_GMBUS) | \ BIT_ULL(POWER_DOMAIN_INIT)) #define BXT_DPIO_CMN_A_POWER_DOMAINS ( \ @@ -1883,6 +1887,7 @@ void intel_display_power_put(struct drm_i915_private *dev_priv, BIT_ULL(POWER_DOMAIN_GT_IRQ) | \ BIT_ULL(POWER_DOMAIN_MODESET) | \ BIT_ULL(POWER_DOMAIN_AUX_A) | \ + BIT_ULL(POWER_DOMAIN_PIPE_A_CRC) | \ BIT_ULL(POWER_DOMAIN_GMBUS) | \ BIT_ULL(POWER_DOMAIN_INIT)) @@ -1941,6 +1946,7 @@ void intel_display_power_put(struct drm_i915_private *dev_priv, BIT_ULL(POWER_DOMAIN_GT_IRQ) | \ BIT_ULL(POWER_DOMAIN_MODESET) | \ BIT_ULL(POWER_DOMAIN_AUX_A) | \ + BIT_ULL(POWER_DOMAIN_PIPE_A_CRC) | \ BIT_ULL(POWER_DOMAIN_INIT)) /* @@ -2006,6 +2012,7 @@ void intel_display_power_put(struct drm_i915_private *dev_priv, ICL_PW_2_POWER_DOMAINS | \ BIT_ULL(POWER_DOMAIN_MODESET) | \ BIT_ULL(POWER_DOMAIN_AUX_A) | \ + BIT_ULL(POWER_DOMAIN_PIPE_A_CRC) | \ BIT_ULL(POWER_DOMAIN_INIT)) #define ICL_DDI_IO_A_POWER_DOMAINS ( \