From patchwork Fri Feb 21 16:52:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 3698721 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 EDCD7BF13A for ; Fri, 21 Feb 2014 16:53:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 27511201B9 for ; Fri, 21 Feb 2014 16:53:02 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 4472F2018A for ; Fri, 21 Feb 2014 16:53:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0BFFEFB56F; Fri, 21 Feb 2014 08:53:00 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-yk0-f169.google.com (mail-yk0-f169.google.com [209.85.160.169]) by gabe.freedesktop.org (Postfix) with ESMTP id 003A1FB56F for ; Fri, 21 Feb 2014 08:52:56 -0800 (PST) Received: by mail-yk0-f169.google.com with SMTP id 142so6573948ykq.0 for ; Fri, 21 Feb 2014 08:52:56 -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=zMIt93pV639xLGRckuys3i0czeDSl4mE2bBzHn95MRM=; b=DPl2l/UhXgkU7VMMe44545a7ja9V/H8kDv54M2ESiXT7H1j2W2K1xZgLKVxCBHHBmF 5utIqZl3lbxFOpd+IEL8IokxS9qAnNaeMnj0YLxYVYyemH2Q5CVw02EsfMayp/hA3WHk mkjcjQtHq5SJ65AjHLl1ebT/InpEt/wjqlAbhlQbftYBeod2deXlGXRh2u4eY3bILxJy rPyOODHqpNih1H6em+akRL24fU1Xm3IRdr71vpiR+bOIkP7h0dHBaeFAIi2BBo+MeD99 NLPlLY1HI9MDnjGpfO5g7kKNar6WjYRP1HhDXWv5ksl9eSfLQvG4o/SEalqGwt9TF8fQ 814g== X-Received: by 10.236.136.231 with SMTP id w67mr12313255yhi.53.1393001576684; Fri, 21 Feb 2014 08:52:56 -0800 (PST) Received: from localhost.localdomain ([187.112.125.205]) by mx.google.com with ESMTPSA id v41sm20148975yhi.19.2014.02.21.08.52.52 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Feb 2014 08:52:56 -0800 (PST) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Fri, 21 Feb 2014 13:52:21 -0300 Message-Id: <1393001548-2883-5-git-send-email-przanoni@gmail.com> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1393001548-2883-1-git-send-email-przanoni@gmail.com> References: <1393001548-2883-1-git-send-email-przanoni@gmail.com> Cc: Paulo Zanoni Subject: [Intel-gfx] [PATCH 04/11] drm/i915: get runtime PM at intel_set_mode 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=-5.1 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 Otherwise, when we run intel_modeset_check_state we may already be runtime suspended, and our state checking code will read registers while the device is suspended. This can only happen if your autosuspend_delay_ms is low (not the default 10s). Signed-off-by: Paulo Zanoni Reviewed-by: Jesse Barnes --- drivers/gpu/drm/i915/intel_display.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 10ec401..c64fb7f 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -9746,13 +9746,18 @@ static int intel_set_mode(struct drm_crtc *crtc, struct drm_display_mode *mode, int x, int y, struct drm_framebuffer *fb) { + struct drm_device *dev = crtc->dev; + struct drm_i915_private *dev_priv = dev->dev_private; int ret; + intel_runtime_pm_get(dev_priv); + ret = __intel_set_mode(crtc, mode, x, y, fb); if (ret == 0) intel_modeset_check_state(crtc->dev); + intel_runtime_pm_put(dev_priv); return ret; }