From patchwork Wed Apr 10 18:32:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Melin X-Patchwork-Id: 2429081 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 9E31C3FD40 for ; Thu, 11 Apr 2013 15:03:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 97D5AE664D for ; Thu, 11 Apr 2013 08:03:22 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com [209.85.217.178]) by gabe.freedesktop.org (Postfix) with ESMTP id 27359E5CFC; Wed, 10 Apr 2013 11:32:44 -0700 (PDT) Received: by mail-lb0-f178.google.com with SMTP id q13so834460lbi.23 for ; Wed, 10 Apr 2013 11:32:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=FCSQIl/VW0EIRwVxKLtFa+Amd+tLC9hJtzxix4oRW8Q=; b=ELt0XyYJf6uAvQnh+amzV983p2lRTzldi0OIuzW2fCgrIjo0YkfQzPFj7GTWEAFFSv WdgepkPEMCLop9cm2JbLz2HN3dGPCDFrflUtwe+MfiaoKcQyEyZPX/Cu/02GVtkpsCQS /e3yhnZ9W7aiMWcbt0hkVAI0o+GERRMveP34kNNT0b3EXUC2Z9HmIYFvikBT+bYcOceN yB7IOsJkX02X0my2N/Ehd2UFPtFVDUtf2TMHj+2ljavwt/8X/YlOF7/jE7XM2Nh8sczb 3ZgajEbox+7FnUve3S7e+hJ1G6aMNuGD4Irlk5G3wG7DFYV+hET1Fq2IIXKcpdKbTPnV XbpA== MIME-Version: 1.0 X-Received: by 10.152.122.100 with SMTP id lr4mr1619780lab.28.1365618763975; Wed, 10 Apr 2013 11:32:43 -0700 (PDT) Received: by 10.114.79.136 with HTTP; Wed, 10 Apr 2013 11:32:43 -0700 (PDT) In-Reply-To: <20130410172717.GA2480@netboy> References: <20130409172820.GC27612@phenom.ffwll.local> <1365537090-11518-1-git-send-email-daniel.vetter@ffwll.ch> <20130410115901.GA4502@netboy> <20130410120724.GJ27612@phenom.ffwll.local> <20130410172717.GA2480@netboy> Date: Wed, 10 Apr 2013 21:32:43 +0300 X-Google-Sender-Auth: 3m49YwCenBKZ-XVLUncIcrkhuws Message-ID: From: Tomas Melin To: Richard Cochran X-Mailman-Approved-At: Thu, 11 Apr 2013 08:02:35 -0700 Cc: Intel Graphics Development , LKML , stable@vger.kernel.org, DRI Development Subject: Re: [Intel-gfx] [PATCH] drm/i915: don't check inconsistent modeset state when force-restoring 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: , 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 On Tue, Apr 9, 2013 at 10:51 PM, Daniel Vetter wrote: > v2: Try harder not to create a big patch (Chris). > Tested the patch applied to 3.9-rc6. Atleast on my machine that helped, although once I managed to get the error (but not warning and call trace as before): [drm:i9xx_crtc_mode_set] *ERROR* Couldn't find PLL settings for mode! On Wed, Apr 10, 2013 at 8:27 PM, Richard Cochran wrote: > I couldn't see right away how to fix it up, so I just compiled your > drm-intel-next-queued plus this patch. If I close the netbook's lid > and open it again, the screen is blank, no backlight, and the machine > seems to be frozen. The patch doesn't apply at all to 3.8 since function crtc_restore_mode is missing and also 3.9-rc6 was quite different. This version of the patch applies atleast to 3.9-rc6 if you want to test it: From 9f498da114cea3d82c291b7090d4441664d7870c Mon Sep 17 00:00:00 2001 From: Tomas Melin Date: Wed, 10 Apr 2013 18:53:42 +0300 Subject: [PATCH] applied patch --- drivers/gpu/drm/i915/intel_display.c | 36 +++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) -- 1.7.9.5 diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index b20d501..83b11c5 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -7771,9 +7771,9 @@ intel_modeset_check_state(struct drm_device *dev) } } -int intel_set_mode(struct drm_crtc *crtc, - struct drm_display_mode *mode, - int x, int y, struct drm_framebuffer *fb) +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; drm_i915_private_t *dev_priv = dev->dev_private; @@ -7863,18 +7863,33 @@ done: if (ret && crtc->enabled) { crtc->hwmode = *saved_hwmode; crtc->mode = *saved_mode; - } else { - intel_modeset_check_state(dev); } out: kfree(saved_mode); return ret; } +int intel_set_mode(struct drm_crtc *crtc, + struct drm_display_mode *mode, + int x, int y, struct drm_framebuffer *fb) +{ + int ret; + + ret = __intel_set_mode(crtc, mode, x, y, fb); + + if (ret == 0) + intel_modeset_check_state(crtc->dev); + + return ret; +} + + void intel_crtc_restore_mode(struct drm_crtc *crtc) { - intel_set_mode(crtc, &crtc->mode, crtc->x, crtc->y, crtc->fb); + __intel_set_mode(crtc, &crtc->mode, crtc->x, crtc->y, crtc->fb); + + intel_modeset_check_state(crtc->dev); } #undef for_each_intel_crtc_masked @@ -9172,8 +9187,15 @@ void intel_modeset_setup_hw_state(struct drm_device *dev, } if (force_restore) { + /* + * We need to use raw interfaces for restoring state to avoid + * checking (bogus) intermediate states. + */ for_each_pipe(pipe) { - intel_crtc_restore_mode(dev_priv->pipe_to_crtc_mapping[pipe]); + struct drm_crtc *crtc = + dev_priv->pipe_to_crtc_mapping[pipe]; + __intel_set_mode(crtc, &crtc->mode, crtc->x, crtc->y, + crtc->fb); } i915_redisable_vga(dev);