From patchwork Mon Dec 18 10:24:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dhinakaran Pandiyan X-Patchwork-Id: 10118749 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 63775603FA for ; Mon, 18 Dec 2017 10:25:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 51F1F28931 for ; Mon, 18 Dec 2017 10:25:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 46B74289B8; Mon, 18 Dec 2017 10:25:39 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID 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 0B53E28931 for ; Mon, 18 Dec 2017 10:25:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7C4C86E195; Mon, 18 Dec 2017 10:25:38 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pl0-x241.google.com (mail-pl0-x241.google.com [IPv6:2607:f8b0:400e:c01::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 10A666E195 for ; Mon, 18 Dec 2017 10:25:35 +0000 (UTC) Received: by mail-pl0-x241.google.com with SMTP id o2so4546540plk.12 for ; Mon, 18 Dec 2017 02:25:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=awoRM6qH/YYKBPmXvlIHBoqGqK/54jO8MjFhn+dPn90=; b=E1KjBpafF2N7ww7MaZUpD6STKNBc04C4OKFoXJTr4FXTc19wFZIzPru1NBXdFY5fhV eTiv9EjDXybqSLKbJpTEdqRbKYYk3GBwZhTpR1uOL+uae/aBWTY/8+gSYj4YlT6y9FkM gz7GKXmGMbhb6bxVhGh6fFh4KzbepKRgANzfb3kjZzuKczMTNHHqSrtfyZMeFpfOPHEO zaVF8+vl4jO6zlxTULCWIzy00Y6Bl/y/lnbv4+HdoJ711b1kllLpaE6vJIBfRh2NXmQI w8z2br2EX/Bsih1CIU4NDv9bFSm/V6vxRodSqLFgZarsoXOHxQSb8qtZFPHqMhIiMiFR Bovw== 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:in-reply-to :references; bh=awoRM6qH/YYKBPmXvlIHBoqGqK/54jO8MjFhn+dPn90=; b=HtLA2lLMdCUuakx7eh5wc+eGyPi0VHlRT1/EzhYO1WoNDtLMX2XEC+KHpcN2W5QO86 XxkUV/N4SNRgpbYVmlybZTM33SH5qUacpirGboQjwnMlNcfi9jjn4CISRrr6L7fKHT6Q Ni6kpnU+Xjfdk80kEtcdsF7ZE7mryI7P6J3+FHu6OXzQMPMhkUIbB7FTXeMj54ApEuJo nrusmyq/FbsIKy8/0GkKvEt5Kz0sgPgIexWfYb6r1wbxI7HnNmaTPTxBNHxUV9fzhrCb hs3bBhjDbnvahEB4GALIfj4XvRDZEdYrkKY8LmJwYTfeaAf5L6vbNJ7UvKdu7TvsuDxe Hmmg== X-Gm-Message-State: AKGB3mIbw67PJo6qnJ9IkxjQKctiJG//ktb5c7A3rqAixk8qd8Kk61+4 QBQPHy88WOFVzru62EMBwNS9mQ== X-Google-Smtp-Source: ACJfBotFbpKndliS9PjgYODuLKyGImz/0iy6m/RboKZ475yCUWwtJRXEFQ/aCGE6uuqip65rg07Ibw== X-Received: by 10.84.130.65 with SMTP id 59mr6139950plc.308.1513592734287; Mon, 18 Dec 2017 02:25:34 -0800 (PST) Received: from localhost.localdomain ([2601:1c0:5402:5a00:d047:2358:10ac:f41c]) by smtp.gmail.com with ESMTPSA id u125sm21206499pgc.94.2017.12.18.02.25.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Dec 2017 02:25:33 -0800 (PST) From: Dhinakaran Pandiyan X-Google-Original-From: Dhinakaran Pandiyan To: intel-gfx@lists.freedesktop.org Date: Mon, 18 Dec 2017 02:24:45 -0800 Message-Id: <20171218102445.2709-5-dhinakaran.pandiyan@intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171218102445.2709-1-dhinakaran.pandiyan@intel.com> References: <20171218102445.2709-1-dhinakaran.pandiyan@intel.com> Cc: Dhinakaran Pandiyan Subject: [Intel-gfx] [CI v2 5/5] drm/i915: Use the vblank power domain disallow or disable DC states. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Disable DC states before enabling vblank interrupts and conversely enable DC states after disabling. Since the frame counter may have got reset between disabling and enabling, use drm_crtc_vblank_restore() to compute the missed vblanks. Signed-off-by: Dhinakaran Pandiyan --- drivers/gpu/drm/i915/i915_irq.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 3517c6548e2c..88b4ceac55d0 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -2963,6 +2963,11 @@ static int gen8_enable_vblank(struct drm_device *dev, unsigned int pipe) { struct drm_i915_private *dev_priv = to_i915(dev); unsigned long irqflags; + bool needs_restore = false; + + intel_display_power_vblank_get(dev_priv, &needs_restore); + if (needs_restore) + drm_crtc_vblank_restore(dev, pipe); spin_lock_irqsave(&dev_priv->irq_lock, irqflags); bdw_enable_pipe_irq(dev_priv, pipe, GEN8_PIPE_VBLANK); @@ -3015,6 +3020,7 @@ static void gen8_disable_vblank(struct drm_device *dev, unsigned int pipe) spin_lock_irqsave(&dev_priv->irq_lock, irqflags); bdw_disable_pipe_irq(dev_priv, pipe, GEN8_PIPE_VBLANK); spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags); + intel_display_power_vblank_put(dev_priv); } static void ibx_irq_reset(struct drm_i915_private *dev_priv)