From patchwork Fri Mar 17 20:20:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9631549 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 8005560245 for ; Fri, 17 Mar 2017 20:20:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 749A1285A1 for ; Fri, 17 Mar 2017 20:20:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 69807285D4; Fri, 17 Mar 2017 20:20:42 +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_SIGNED, 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 350FA285A1 for ; Fri, 17 Mar 2017 20:20:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3DB4C6EDAD; Fri, 17 Mar 2017 20:20:39 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr0-x241.google.com (mail-wr0-x241.google.com [IPv6:2a00:1450:400c:c0c::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 731286EDA8; Fri, 17 Mar 2017 20:20:35 +0000 (UTC) Received: by mail-wr0-x241.google.com with SMTP id u48so10815269wrc.1; Fri, 17 Mar 2017 13:20:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=X6+xPl2rzxbabWONMAiJHt5iX1ovkvKe48VztCuZm1M=; b=u5BjD5Mc+6nv5f7Od8On1mgzqVr6WExHvyK+EvtBnFTmZItB1PlC4j4VyY0vLaYwHU 2IHqh7vHO+ek5kIUMkJDSDlNztfzBPRt1cddFaUNvT74kXPJe08DU/Azd1weD142sBkY xGPHVRVkec3orx8AoqW0g/iqsveTXlXmgkKc60HIsN+obWjOpzlUJ989hMKgbMSwbANv xnM5UCuyIn4P22KsHiVWk1qR3hiiUdnPrgR3w12uGGV1SaoUa7Q3XPl1rkw0DmXiy/sh 1QsdwhxfWEyscvs/CH4G1gsn8rX1h/HLf000pURabLu8CaojU/m9T+WF/1Hvv9H4voQK FUgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=X6+xPl2rzxbabWONMAiJHt5iX1ovkvKe48VztCuZm1M=; b=ImcScupeTOwNtAOGahReAw/QNtpamWgCMv4XYSfIAcS2v/K/tOdwKFST5y+fHMcgF4 +foMkiUAFr1FNrvWlruEsniOONglO8dGfK984/MZFIgMNYkQbx5qbTQNI5+XLFG1bghS fppSGs5vBfJEi1p8o9OE4vUlLPextYXXoIBQwv4pbpFPX0gLJLF6FcZNhKsfsf1/TRbE OrkEtZDEhc6NSsla22zUKOWEHOU2kEXIUUuOmRyx8m6Rfe0yP+7+sNuXN87mH7R28FTP ol5XmRWIpbEXNn4VNPDsrQ+jHPcaGBwObOpxhX0E1eID3WvkWOusMdWIL7CuNis9+CYE Mt5A== X-Gm-Message-State: AFeK/H2H2Ie3Rc8qGf3zXOMvjkTb4THRxqon6G2ewpDCyvptVVFaAX6IK63mCJEStlWhBQ== X-Received: by 10.223.145.97 with SMTP id j88mr14398218wrj.178.1489782034145; Fri, 17 Mar 2017 13:20:34 -0700 (PDT) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id k139sm3829222wmg.11.2017.03.17.13.20.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Mar 2017 13:20:33 -0700 (PDT) From: Chris Wilson To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 2/4] drm: vblank cannot be enabled if dev->irq_enabled is false Date: Fri, 17 Mar 2017 20:20:28 +0000 Message-Id: <20170317202030.24410-2-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170317202030.24410-1-chris@chris-wilson.co.uk> References: <20170317202030.24410-1-chris@chris-wilson.co.uk> Cc: intel-gfx@lists.freedesktop.org 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: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Since we cannot enable the vblank if !dev->irq_enabled, we assert that checking for both !vblank->enabled and !dev->irq_enabled is tautological and only need the former. The only time it may differ is when racing with drm_irq_uninstall(), but that will then disable the vblank and wakeup the waiters. Signed-off-by: Chris Wilson --- drivers/gpu/drm/drm_irq.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index c47e07c89136..a164cf51d093 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c @@ -1647,10 +1647,9 @@ int drm_wait_vblank(struct drm_device *dev, void *data, DRM_DEBUG("waiting on vblank count %u, crtc %u\n", vblwait->request.sequence, pipe); DRM_WAIT_ON(ret, vblank->queue, 3 * HZ, - (((drm_vblank_count(dev, pipe) - - vblwait->request.sequence) <= (1 << 23)) || - !READ_ONCE(vblank->enabled) || - !dev->irq_enabled)); + (drm_vblank_count(dev, pipe) - + vblwait->request.sequence) <= (1 << 23) || + !READ_ONCE(vblank->enabled)); } if (ret != -EINTR) {