From patchwork Tue Mar 1 23:55:01 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: 8473001 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0FB03C0553 for ; Wed, 2 Mar 2016 00:25:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DB85D2025A for ; Wed, 2 Mar 2016 00:24:57 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id A631920377 for ; Wed, 2 Mar 2016 00:24:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 36DE26E20C; Wed, 2 Mar 2016 00:24:53 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 900 seconds by postgrey-1.35 at gabe; Wed, 02 Mar 2016 00:24:50 UTC Received: from mail333.us4.mandrillapp.com (mail333.us4.mandrillapp.com [205.201.137.77]) by gabe.freedesktop.org (Postfix) with ESMTPS id DB2276E10B for ; Wed, 2 Mar 2016 00:24: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=pvBXXt9L64xgr8aH9T6TtF4eFXo=; b=YGerALch+KIFNhhFA1kAf6XLgdo6IVjfbyY+1/jwuR5gKlNmRoS4m3HwYf2DfflC5RpOb/oDT0t+ 3VqUot5M8paoQ5W9KIbpBdePfbh2qik2+ue+aeRQij4ctNTcbR5VJEqykh4RBL7Jl8S/TBjzaikn RI/dXCfvfBM0pcdfnvo= DomainKey-Signature: a=rsa-sha1; c=nofws; q=dns; s=mandrill; d=linuxfoundation.org; b=iKvP1H2d2fH8KCSprgPbfTUEuesb1HaqWS3zzZ96cvFMG+8R6NqJgV5hkvGSecrpauVxzO4IJTB1 0gfPo4P62lbLIMzJz6kFaxrth70Y7nYucGjMjLjlePW/bo1eojvvYK1uZIXRzFmm2AZSkEUf1Cp8 Waod3beTyb/11qcHWRU=; Received: from pmta03.dal05.mailchimp.com (127.0.0.1) by mail333.us4.mandrillapp.com id hqopd4174noe for ; Tue, 1 Mar 2016 23:55:01 +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=1456876501; 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=ECtpsY8fD8Ss3ApoEbx79GCUxuHaT4x/zJMN9+i6eII=; b=NFK4+hZwuNQjJ4GkjTJ2h7IGzNeT1Y9DuXsH0kZQEuqTkIkD9JupUYuECohVFEcExy/ld9 t+iAfUchMOoQ6IQb4HhzAjcBtscozDOf36KzxKrln//fb+E8hc+yw/tksGZNX5RMMJTa/nkp FAk50m/Wbklw7tvgDxWax+dKZlQ4A= From: Greg Kroah-Hartman Subject: [PATCH 4.4 232/342] drm: Fix treatment of drm_vblank_offdelay in drm_vblank_on() (v2) Received: from [50.170.35.168] by mandrillapp.com id 5d4bbc8c0bc74b08a7caf31153878bee; Tue, 01 Mar 2016 23:55:01 +0000 X-Mailer: git-send-email 2.7.2 To: Message-Id: <20160301234535.419474625@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.5d4bbc8c0bc74b08a7caf31153878bee X-Mandrill-User: md_30481620 Date: Tue, 01 Mar 2016 23:55:01 +0000 MIME-Version: 1.0 Cc: dri-devel@lists.freedesktop.org, Greg Kroah-Hartman , michel@daenzer.net, stable@vger.kernel.org, Daniel Vetter , alexander.deucher@amd.com, Dave Airlie , christian.koenig@amd.com, vbabka@suse.cz 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 bb74fc1bf3072bd3ab4ed5f43afd287a63baf2d7 upstream. drm_vblank_offdelay can have three different types of values: < 0 is to be always treated the same as dev->vblank_disable_immediate = 0 is to be treated as "never disable vblanks" > 0 is to be treated as disable immediate if kms driver wants it that way via dev->vblank_disable_immediate. Otherwise it is a disable timeout in msecs. This got broken in Linux 3.18+ for the implementation of drm_vblank_on. If the user specified a value of zero which should always reenable vblank irqs in this function, a kms driver could override the users choice by setting vblank_disable_immediate to true. This patch fixes the regression and keeps the user in control. v2: Only reenable vblank if there are clients left or the user requested to "never disable vblanks" via offdelay 0. Enabling vblanks even in the "delayed disable" case (offdelay > 0) was specifically added by Ville in commit cd19e52aee922 ("drm: Kick start vblank interrupts at drm_vblank_on()"), but after discussion it turns out that this was done by accident. Citing Ville: "I think it just ended up as a mess due to changing some of the semantics of offdelay<0 vs. offdelay==0 vs. disable_immediate during the review of the series. So yeah, given how drm_vblank_put() works now, I'd just make this check for offdelay==0." Signed-off-by: Mario Kleiner Reviewed-by: Daniel Vetter Cc: michel@daenzer.net Cc: vbabka@suse.cz Cc: ville.syrjala@linux.intel.com Cc: daniel.vetter@ffwll.ch Cc: dri-devel@lists.freedesktop.org Cc: alexander.deucher@amd.com Cc: christian.koenig@amd.com Signed-off-by: Dave Airlie Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/drm_irq.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c @@ -1494,8 +1494,7 @@ void drm_vblank_on(struct drm_device *de * re-enable interrupts if there are users left, or the * user wishes vblank interrupts to be enabled all the time. */ - if (atomic_read(&vblank->refcount) != 0 || - (!dev->vblank_disable_immediate && drm_vblank_offdelay == 0)) + if (atomic_read(&vblank->refcount) != 0 || drm_vblank_offdelay == 0) WARN_ON(drm_vblank_enable(dev, pipe)); spin_unlock_irqrestore(&dev->vbl_lock, irqflags); }