From patchwork Tue Mar 1 23:54:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 8472461 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6D0669F2F0 for ; Wed, 2 Mar 2016 00:09:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A666220376 for ; Wed, 2 Mar 2016 00:09:57 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B81542034E for ; Wed, 2 Mar 2016 00:09:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2C0DD6E1E8; Wed, 2 Mar 2016 00:09:52 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 902 seconds by postgrey-1.35 at gabe; Wed, 02 Mar 2016 00:09:50 UTC Received: from mail333.us4.mandrillapp.com (mail333.us4.mandrillapp.com [205.201.137.77]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7F7526E1E8 for ; Wed, 2 Mar 2016 00:09:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; s=mandrill; d=linuxfoundation.org; h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Date:MIME-Version:Content-Type:Content-Transfer-Encoding; i=gregkh@linuxfoundation.org; bh=hn+//9Pey/Ft12Ls3VRotFELDEI=; b=OrGJYGoUJ5DyixIl/WiWl8BFs+asZ1VyzL+5HbuPb+ApzCuF6rgIXESlmQRAb2A85ZIuGxthMl6H NDjQV1VDTxv5Wc3rMwgbAWsL7zNbrOJcCN7B9FKr6S/OXUiSpM3WHGMpiLkN7+zT1e1F4UdBqRwt Sfndnt8PpbQ1DRfSnNc= DomainKey-Signature: a=rsa-sha1; c=nofws; q=dns; s=mandrill; d=linuxfoundation.org; b=SlXZoUuiNh4OGtUVZcKOvWKOb4FgIp1TLONE2zJbdQpVWSzPrKL+bE7K8p5OIMLyor7R2ng/XJ8Y CKB9OkfFJs/hrEKqJomVAyba42pJY9UhN4jiqNDXvbCimbDY6bJANzCt1GnBxrVh5mkEkGbOEtwI iQyd1eBPj9ssAUpKOqQ=; Received: from pmta03.dal05.mailchimp.com (127.0.0.1) by mail333.us4.mandrillapp.com id hqonks174no1 for ; Tue, 1 Mar 2016 23:54:47 +0000 (envelope-from ) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com; i=@mandrillapp.com; q=dns/txt; s=mandrill; t=1456876487; h=From : Subject : To : Cc : Message-Id : In-Reply-To : References : Date : MIME-Version : Content-Type : Content-Transfer-Encoding : From : Subject : Date : X-Mandrill-User : List-Unsubscribe; bh=fBfRtzA06XtZ3Jk0eKkv0uGC9xtd10LaJ1AtPjQw8Cw=; b=g0ngMtXYYTgGx3GaN8jOxv03ySDFwLQJajTuzFUb932t7aflRdwRK6co3ZzSM3UyVI5K6k 3bqUgx1QklnIaPVkVqApHJkmMDms0M6B1r/oVZTpiFzdqDJedyrvbNRiNjONHXkuKyzh8emM rN3kBJ827KgLslHh0DvNq6jjvxwa0= From: Greg Kroah-Hartman Subject: [PATCH 4.4 193/342] drm/nouveau/display: Enable vblank irqs after display engine is on again. Received: from [50.170.35.168] by mandrillapp.com id bd8b6b5226334e5696b587a92bc44bda; Tue, 01 Mar 2016 23:54:47 +0000 X-Mailer: git-send-email 2.7.2 To: Message-Id: <20160301234534.173103133@linuxfoundation.org> In-Reply-To: <20160301234527.990448862@linuxfoundation.org> References: <20160301234527.990448862@linuxfoundation.org> X-Report-Abuse: Please forward a copy of this message, including all headers, to abuse@mandrill.com X-Report-Abuse: You can also report abuse here: http://mandrillapp.com/contact/abuse?id=30481620.bd8b6b5226334e5696b587a92bc44bda X-Mandrill-User: md_30481620 Date: Tue, 01 Mar 2016 23:54:47 +0000 MIME-Version: 1.0 Cc: Greg Kroah-Hartman , dri-devel@lists.freedesktop.org, stable@vger.kernel.org, Ben Skeggs , daniel.vetter@ffwll.ch, Dave Airlie X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY, URIBL_GREY 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 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mario Kleiner commit ff683df7bf34f90766a50c7e7454e219aef2710e upstream. In the display resume path, move the calls to drm_vblank_on() after the point when the display engine is running again. Since changes were made to drm_update_vblank_count() in Linux 4.4+ to emulate hw vblank counters via vblank timestamping, the function drm_vblank_on() now needs working high precision vblank timestamping and therefore working scanout position queries at time of call. These don't work before the display engine gets restarted, causing miscalculation of vblank counter increments and thereby large forward jumps in vblank count at display resume. These jumps can cause client hangs on resume, or desktop hangs in the case of composited desktops. Fix this Linux 4.4 regression by reordering calls accordingly. Signed-off-by: Mario Kleiner Cc: Ben Skeggs Cc: ville.syrjala@linux.intel.com Cc: daniel.vetter@ffwll.ch Cc: dri-devel@lists.freedesktop.org Reviewed-by: Daniel Vetter Signed-off-by: Dave Airlie Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/nouveau/nouveau_display.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c @@ -634,10 +634,6 @@ nouveau_display_resume(struct drm_device nv_crtc->lut.depth = 0; } - /* Make sure that drm and hw vblank irqs get resumed if needed. */ - for (head = 0; head < dev->mode_config.num_crtc; head++) - drm_vblank_on(dev, head); - /* This should ensure we don't hit a locking problem when someone * wakes us up via a connector. We should never go into suspend * while the display is on anyways. @@ -647,6 +643,10 @@ nouveau_display_resume(struct drm_device drm_helper_resume_force_mode(dev); + /* Make sure that drm and hw vblank irqs get resumed if needed. */ + for (head = 0; head < dev->mode_config.num_crtc; head++) + drm_vblank_on(dev, head); + list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); _______________________________________________