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: 9331397 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 A9AC960231 for ; Wed, 14 Sep 2016 13:01:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A5A229D8C for ; Wed, 14 Sep 2016 13:01:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8EB7029DC2; Wed, 14 Sep 2016 13:01:18 +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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B080D29D8C for ; Wed, 14 Sep 2016 13:01:14 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bk9mp-0000kw-RS; Wed, 14 Sep 2016 12:59:35 +0000 Received: from mail-pf0-x230.google.com ([2607:f8b0:400e:c00::230]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bk9j5-0007LD-AB for linux-arm-kernel@lists.infradead.org; Wed, 14 Sep 2016 12:55:43 +0000 Received: by mail-pf0-x230.google.com with SMTP id 128so5534266pfb.3 for ; Wed, 14 Sep 2016 05:55:24 -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=Gj/XlT9jl6y00kw3GaRlHnAc1Z3zlmFtT/fSHXuo/sdub4Y1+SfmwiewBo/3IxFDVG 6ymRm4fk/P8nganQxbvLkqLwyD3+43SjMOtLclq/V7Hw7jgc4rR5+kdt0d1K8HGVouET v2Lxyrn2qCSd7y6N5nbV7lm6YUhTqt74G6x0u5CJI3pby1PqsHXDmmJfZymNV6d9Ztae jD7yC3tekTdqFnQ5Z1YPN84V+jokKsiWARVI/j+72q19rYnhH8737naYgTTJr7B557Tq iDf4vMNqJEhW7+tSwbbGjL/xnVlSLsmm5Mi/L7Sgow4ruuRxSbJcF3odYcTerjEaenrl 7JEw== X-Gm-Message-State: AE9vXwP10bjl5RI2c0jSQtIdACFutc9/HZP9cbj7pgfLb6+NHfJP2fGwcvz9jrHIVanNSDRk 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160914_055543_422309_190569F4 X-CRM114-Status: GOOD ( 13.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heiko Stuebner , David Airlie , linux-kernel@vger.kernel.org, Daniel Kurtz , Tomasz Figa , linux-rockchip@lists.infradead.org, Sean Paul , linux-arm-kernel@lists.infradead.org, Mark Yao MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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;