From patchwork Wed Sep 14 12:54:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 9331359 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 C6AA160231 for ; Wed, 14 Sep 2016 12:55:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8F411FFC9 for ; Wed, 14 Sep 2016 12:55:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD7A728E22; Wed, 14 Sep 2016 12:55:58 +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 A868A2921C for ; Wed, 14 Sep 2016 12:55:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DCA316E402; Wed, 14 Sep 2016 12:55:42 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf0-x229.google.com (mail-pf0-x229.google.com [IPv6:2607:f8b0:400e:c00::229]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3E1FF6E239 for ; Wed, 14 Sep 2016 12:55:25 +0000 (UTC) Received: by mail-pf0-x229.google.com with SMTP id p64so5578678pfb.1 for ; Wed, 14 Sep 2016 05:55:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LxJTCPDZYH4ulp7NdOuJQppnycuAWaMmxcGi54yLm8U=; b=d+e8tqbCK87bI1WTqXC2oxEOB62craGGccKMIS0v/9JWYKY7APJxrwj+cSsYzAJU9U x6Lty6/Fl0lwHOoNyPdU7VAnvaTNgXZmou0wuNIm90Oyu4l2yMOcaHErkPT2HCVV98QA WMuaVZ/VdHRD7u2rKMepMrIbBHau7crBU+1R4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LxJTCPDZYH4ulp7NdOuJQppnycuAWaMmxcGi54yLm8U=; b=GdXLIbwrVrqtc/nToYIWdSoZJoKJQibxRixuV2sdypivD2I7PmtuiiTSrh/fuWwFE0 thlAB4fC84WeVw6dSSuXbYAdPpA82cjOjuFN9YFQxb0yMxIO+edSr61BxQxBWOxBupZ5 QYtjNCcHSp1p3citYR2C0SHXHqdJpju19s4GBb+Pvl+DywiIkVMojDi20G9CRjRSB0FS Tj/siNt+1uBFC8+1lx7ok1s3mwBjXlpHV61RO7y+Sn/Fij7agbQiK66tZz2+rS4s4ULD 7yT5aPstsK+gbIDYMtnvVChUQXI3VPpPxvosZb6vaBOy7H01oVQjKZ04zQE5LY5SKOxW KJCw== X-Gm-Message-State: AE9vXwP3tG7Wwntzt//CTgeIJ80bYaSR85Dq8vFjMl9xf8FEVXHjesRI5t1IF3DLZu+6fl4X X-Received: by 10.98.49.198 with SMTP id x189mr4232169pfx.135.1473857723892; Wed, 14 Sep 2016 05:55:23 -0700 (PDT) Received: from basement.tok.corp.google.com ([100.103.3.207]) by smtp.gmail.com with ESMTPSA id t7sm5601309paz.21.2016.09.14.05.55.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Sep 2016 05:55:23 -0700 (PDT) From: Tomasz Figa To: dri-devel@lists.freedesktop.org Subject: [PATCH 6/8] drm/rockchip: Do not enable vblank without event Date: Wed, 14 Sep 2016 21:54:59 +0900 Message-Id: <1473857701-9250-7-git-send-email-tfiga@chromium.org> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 In-Reply-To: <1473857701-9250-1-git-send-email-tfiga@chromium.org> References: <1473857701-9250-1-git-send-email-tfiga@chromium.org> Cc: linux-kernel@vger.kernel.org, Tomasz Figa , linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.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 Originally we needed to enable vblank for any atomic commit to kick the PSR machine, but that was changed and we no longer need to do so from a vblank interrupt. Let's return to original behavior of enabling vblank only if it is really necessary. This essentially reverts commit 5b6804034ae9 ("drm/rockchip: Enable vblank without event"). Signed-off-by: Tomasz Figa --- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index af9ddbe..bb7a865 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -116,7 +116,6 @@ struct vop { struct device *dev; struct drm_device *drm_dev; bool is_enabled; - bool vblank_active; /* mutex vsync_ work */ struct mutex vsync_mutex; @@ -1135,11 +1134,10 @@ static void vop_crtc_atomic_begin(struct drm_crtc *crtc, rockchip_drm_psr_flush(crtc); spin_lock_irq(&crtc->dev->event_lock); - vop->vblank_active = true; - WARN_ON(drm_crtc_vblank_get(crtc) != 0); - WARN_ON(vop->event); - if (crtc->state->event) { + WARN_ON(drm_crtc_vblank_get(crtc) != 0); + WARN_ON(vop->event); + vop->event = crtc->state->event; crtc->state->event = NULL; } @@ -1236,12 +1234,8 @@ static void vop_handle_vblank(struct vop *vop) spin_lock_irqsave(&drm->event_lock, flags); if (vop->event) { drm_crtc_send_vblank_event(crtc, vop->event); - vop->event = NULL; - - } - if (vop->vblank_active) { - vop->vblank_active = false; drm_crtc_vblank_put(crtc); + vop->event = NULL; } spin_unlock_irqrestore(&drm->event_lock, flags); @@ -1518,7 +1512,6 @@ static int vop_initial(struct vop *vop) clk_disable(vop->aclk); vop->is_enabled = false; - vop->vblank_active = false; return 0;