From patchwork Wed Aug 17 01:11:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 9285077 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 4CF17600CB for ; Wed, 17 Aug 2016 01:11:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3EE6F287C7 for ; Wed, 17 Aug 2016 01:11:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 33A9F287CC; Wed, 17 Aug 2016 01:11: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 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 E1CDA287C7 for ; Wed, 17 Aug 2016 01:11:57 +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 1bZpOf-0003DL-Gp; Wed, 17 Aug 2016 01:11:57 +0000 Received: from mail-pf0-x22a.google.com ([2607:f8b0:400e:c00::22a]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bZpOX-00038g-T7 for linux-rockchip@lists.infradead.org; Wed, 17 Aug 2016 01:11:51 +0000 Received: by mail-pf0-x22a.google.com with SMTP id y134so32569050pfg.0 for ; Tue, 16 Aug 2016 18:11:32 -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=ZQ36PxXSB1cTyfQYrm8ZK1yjM01y5zfod07XVBG9uPs=; b=oJYjd0O1XYJ8tOhJacgicjxeftJCQjgq3H7Eo9uGvGYO6dFPdFsjeQtJfhu3w7NWIk TSwYjdY53m3PDYiv7Jn+bbDR8EsnlObivAHDqmQ2VPD45RfPFBrw9qo3SnRysS6oGXGd ri+R+c+rsWxalQAeI63rr45tUwKTRdNYRyBa8= 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=ZQ36PxXSB1cTyfQYrm8ZK1yjM01y5zfod07XVBG9uPs=; b=Dz12ttnG1UCOlY6euxB6bWHfWwspPPR5LciVF0qT1nEs4Cog+Towp5eym0P9cbdNQL y2VHPRmmW5OfUunFTVR2HJIzXWwIgwr1VpavD9nxjlLSEeMUhALXkhuerc0MYRtF3vx2 xE8o5XbItykf3BcUy0BWvCVDxhn+do37lyyYXCqV1wC/S4/v/qSnbZJK8MEPcZ4MYmSp +yIbmhIFJXMjkQXI2H3nCIrjxwf970+Jct1NtUM143yqbtkTByEJEr5Tq4+yaZ6Oe+/8 xhMo6EUBLAkGMsSBFqDn9GkUutqY0YicR7ayrL8oJmVGg1B7LAnfN9DHO52+Ff+1oFJm t93g== X-Gm-Message-State: AEkoouuI3BUCs0/5/+AFW/GaHy0oJlmhO20LsM5KGySkHbIpizzmJGHDhMxlJ1BDN9Q0BWh3 X-Received: by 10.98.71.91 with SMTP id u88mr69321765pfa.145.1471396291877; Tue, 16 Aug 2016 18:11:31 -0700 (PDT) Received: from seanpaul0.corp.google.com ([172.22.162.59]) by smtp.gmail.com with ESMTPSA id f6sm42170827pfa.17.2016.08.16.18.11.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 16 Aug 2016 18:11:30 -0700 (PDT) From: Sean Paul To: mark.yao@rock-chips.com, dri-devel@lists.freedesktop.org, ykk@rock-chips.com Subject: [PATCH v2 6/6] drm/rockchip: Enable vblank without event Date: Tue, 16 Aug 2016 18:11:16 -0700 Message-Id: <1471396276-8222-7-git-send-email-seanpaul@chromium.org> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 In-Reply-To: <1471396276-8222-1-git-send-email-seanpaul@chromium.org> References: <1471396276-8222-1-git-send-email-seanpaul@chromium.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160816_181150_056834_EFDCA374 X-CRM114-Status: GOOD ( 11.58 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marcheu@chromium.org, Sean Paul , dianders@chromium.org, linux-rockchip@lists.infradead.org MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP vblank should be enabled regardless of whether an event is expected back. This is especially important for a cursor plane. Signed-off-by: Sean Paul Reviewed-by: Yakir Yang Tested-by: Yakir Yang --- Changes in v2: - Rebased on https://cgit.freedesktop.org/~seanpaul/dogwood/log/?h=for-next drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index d1e0e06..1787084 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -112,6 +112,7 @@ struct vop { struct device *dev; struct drm_device *drm_dev; bool is_enabled; + bool vblank_active; /* mutex vsync_ work */ struct mutex vsync_mutex; @@ -1107,10 +1108,11 @@ static void vop_crtc_atomic_begin(struct drm_crtc *crtc, struct vop *vop = to_vop(crtc); spin_lock_irq(&crtc->dev->event_lock); - if (crtc->state->event) { - WARN_ON(drm_crtc_vblank_get(crtc) != 0); - WARN_ON(vop->event); + vop->vblank_active = true; + WARN_ON(drm_crtc_vblank_get(crtc) != 0); + WARN_ON(vop->event); + if (crtc->state->event) { vop->event = crtc->state->event; crtc->state->event = NULL; } @@ -1197,12 +1199,14 @@ 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); - drm_crtc_vblank_put(crtc); vop->event = NULL; } + if (vop->vblank_active) { + vop->vblank_active = false; + drm_crtc_vblank_put(crtc); + } spin_unlock_irqrestore(&drm->event_lock, flags); if (!completion_done(&vop->wait_update_complete)) @@ -1472,6 +1476,7 @@ static int vop_initial(struct vop *vop) clk_disable(vop->aclk); vop->is_enabled = false; + vop->vblank_active = false; return 0;